4

How can I limit the amount of items returned to me when performing an API call?

I only want the top 10 most commonly used tags, by default I'm sent back 30. EG:

api.stackexchange.com/2.2/tags?order=desc&sort=popular&site=stackoverflow

Yields:

[items] => Array (
    [0] => Array (
            [has_synonyms] => 1
            [is_moderator_only] => 
            [is_required] => 
            [count] => 804152
            [name] => java
        )
    [1] => Array ( 
            [has_synonyms] => 1
            [is_moderator_only] => 
            [is_required] => 
            [count] => 793946
            [name] => javascript
        )
    ... ...
    [29] => Array (
            [has_synonyms] => false
            [is_moderator_only] => false
            [is_required] => false
            [count] => 90377
            [name] => ]django]
        )
    ...
4

Just set pagesize in the URL, like:

https://api.stackexchange.com/2.2/tags?pagesize=10&order=desc&sort=popular&site=stackoverflow

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .