Wikipedia API - for multiple titles generate links with ids

Viewed 35

There are two things I can do:

  1. Using a generator, I can make a request to retrieve links with ids for a specific title:

https://en.wikipedia.org/w/api.php?action=query&generator=links&titles=Klaksvik&gpllimit=500&format=json

Of course, I can retrieve links for more than one title, but there is no information about which link refers to which title.

  1. I can use a query parameter and retrieve JSON with links for each requested title (with mapping):

https://en.wikipedia.org/w/api.php?action=query&titles=England%20Salisbury|Klaksvik&prop=links

The problem is, that there are no ids - only titles for each link.

I want to combine these two options: the response contains both information about which link refers to which title and the pageid for each link.

(The second option but with id for each link.)

0 Answers
Related