Reputation: 140
I want to list all pages from category with the title and primary image.
My current API url is this:
with this results:
....
{
"pageid": 3600962,
"ns": 0,
"title": "Lee Aaker"
},
....
I don't know the right parameters to get a response like this:
{
"pageid": 3600962,
"ns": 0,
"title": "Lee Aaker",
"thumbnail": {
"original": "https://upload.wikimedia.org/wikipedia/some_image_path.jpg"
}
}
Upvotes: 2
Views: 1207
Reputation: 7036
You can do this by using categorymembers in combination with pageimages:
https://en.wikipedia.org/w/api.php?action=query&generator=categorymembers&gcmlimit=100&gcmtitle=Category:American male film actors&prop=pageimages&pilimit=100
gcmtitle=Category:American male film actors
, gcmlimit=100
pilimit=100
Upvotes: 3