4

For a Wikipedia page: is it possible to get the list of all Wikipedia links on that page with their respective wikidata IDs in a single query/API call?

Optional: can additional information of the respective wikidata items like a property value also be received with the query?

  • Why don't you process the HTML page? – Ho1 May 7 '16 at 11:15
  • I was looking for an easier and "cleaner" solution, and I think using available API calls is the approach preferred by wikipedia / wikidata. – G. L. Merebet May 7 '16 at 11:36
1

That doesn't seem to be possible using the Wikipedia API.

You can get a list of all links from a certain article: https://en.wikipedia.org/w/api.php?action=query&prop=links&titles=London

You can also get information about description, alias and label from Wikidata for all links from an article: https://en.wikipedia.org/w/api.php?action=query&generator=links&titles=London&prop=pageterms

But there doesn't seem to be any way to get any other information from Wikidata on Wikipedia.

If you use Wikidata API, you can get all the Wikidata-related information you want, but there is no way to get the links of a Wikipedia article there.

1

In fact, it is possible using MediaWiki API generators:


See also this answer on how to receive additional information.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.