I am trying to query wikipedia using the API. However when I search, it does 
not give page IDs:


https://en.wikipedia.org/w/api.php?action=query&list=search&srlimit=1&srsearch=SVT&format=json

{"query-continue":{"search":{"sroffset":1}},"query":{"searchinfo":{"totalhits":1786},"search":[{"ns":0,"title":"Sveriges
 Television","snippet":"Sveriges Television AB (<span 
class='searchmatch'>SVT</span>. <span class='searchmatch'>SVT</span>_Swedish. 
ogg | Pronunciation Sweden's Television, is the Swedish  national public TV 
broadcaster , funded by <b>...</b> 
","size":28091,"wordcount":3891,"timestamp":"2013-10-19T22:45:43Z"}]}}


It seems that I have to do two queries then to get the pageid/url, following 
that one  up with this one:

https://en.wikipedia.org/w/api.php?action=query&titles=SVT


{"query":{"pages":{"452098":{"pageid":452098,"ns":0,"title":"SVT"}}}}

Is there anyway of returning the pageid or fullurl in the first query? 
(action=query&list=search) 

Thanks!

_______________________________________________
MediaWiki-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

Reply via email to