I am using Wikipedia API where I get the images of certain string I input. It always returns 10 result but I want more than that approx 50.
https://en.wikipedia.org/w/api.php?action=query&prop=pageimages&format=json&piprop=thumbnail&pithumbsize=500&pilimit=50&generator=prefixsearch&gpssearch=game of thrones
How do I get 50 results?
Solved also need to add
&gpslimit=100
it should be in the range 1-100
By default most of the generators and props used in query action are with limit of 10. Always when you need to increase the limit for your query you have to set the corresponding limit value for all them, because the resulting query limit is equal to smallest of all them.
So, if your query uses generator=geosearch
with prop=links|extracts|categories|images
and you need 20 results, you must set the limit parameters for geosearch
, links
, extracts
, categories
and images
to 20.
https://en.wikipedia.org/w/api.php?...&ggslimit=20&pllimit=20&exlimit=20&cllimit=20&imlimit=20
Of course this has to comply with the allowed max limit for each parameter. For example, for extracts the allowed max limit is 20 (default: 1), which means that you can't get more than 20 pages in your final response, although others are more than 20. This also means that in your case above the effect of gpslimit=100
will be the same as gpslimit=50
, because pilimit=50
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With