0

I want to search a term using Wikidata API, and retrieve a list of corresponding entities identifiers and related Wikipedia page titles (if available). I'm currently using the following URL:

https://www.wikidata.org/w/api.php?action=query&list=search&format=json&srinterwiki&srsearch=nyc

however parameter 'srinterwiki', documented here, does not return any Wikipedia link.

Many many thanks

Ps: I know this can be achieved using 'wbsearchentities' with 'props' parameter, but it does not perform a full-text search. Indeed, it is not capable of returning the same results of the Wikdata search box as stated here.

mp94
  • 47
  • 6

1 Answers1

0

srinterwiki returns interwiki search results (that is, search results for the same search query from other wikis), not interwiki links for the normal search results. Pass the results to wbgetentities to get sitelinks.

(Normally you would use generators for this kind of thing, unfortunately wbgetentities does not support generators.)

Tgr
  • 27,442
  • 12
  • 81
  • 118