I'm trying to access the thumbnail source, but the pageid changes dynamically and I can't find a way to access it. I am working with PHP and in this way I access the resources of the Wikipedia API
$wikipediaArticleImage = $wikipediaArticle['query']["pages"][36408]["thumbnail"]["source"]
Where the pageid [36408]
changes dynamically depending on the article searched
Thank you
You can simply iterate over all elements
Keep in mind that if you have more than one page, this code will bring the image of the last page, if you want the first one, put a break
If you want to save all put them in an arrangement
You can get the id like this. It's the value left in $key when you loop.
If your code is in java, you can use something similar to this
You put it in a jsonElement, extract the json object, and then serialize it to Json, and at the end iterate through each object to get the listing.
If it is in C#, with a simple
JArray