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?

Jeanne Holm
  • 4,447
  • 1
  • 18
  • 40

2 Answers2

1

In fact, it is possible using MediaWiki API generators:


See also this answer on how to receive additional information.

Stanislav Kralin
  • 2,975
  • 1
  • 12
  • 33
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.

svick
  • 869
  • 4
  • 9