• Hi,

    I haven’t seen anything in the docs about this or anywhere else. I’m working on a site that has 115 users that all need to be represented in an app. The max I can go with ‘per_page’ is 100 and I don’t see any other parameters to get around this. Does anyone know how I can get ALL users, either using ‘/wp-json/wp/v2/users’ (with a query such as ‘?per_pag=’ ) or anything else?

    Thanks in advance.

    tim

    https://wordpress.org/plugins/rest-api/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Daniel Bachhuber

    (@danielbachhuber)

    Does anyone know how I can get ALL users, either using ‘/wp-json/wp/v2/users’ (with a query such as ‘?per_pag=’ ) or anything else?

    Can you modify PHP on the site running the API?

    Or, alternatively, have you consider using the page argument to get the second page of results?

    Thread Starter anartica

    (@anartica)

    Hi,

    thanks for the speedy reply. I’ve tried using the page argument – but seems to paginate at 10 (no matter ‘per_page’ number is set, which means, unless I’m missing something, running through 11 different queries. I’ve tried it in Postman and in the browser and the result is the same.

    I can modify, just thought there might a query that would produce all the results. I think the earlier version could return all users (and categories), like posts can be done now – any plans to implement this?

    Thanks,

    Tim

    Plugin Author Daniel Bachhuber

    (@danielbachhuber)

    I’ve tried using the page argument – but seems to paginate at 10 (no matter ‘per_page’ number is set, which means, unless I’m missing something, running through 11 different queries. I’ve tried it in Postman and in the browser and the result is the same.

    Huh. I’m not able to reproduce this locally. Can you share the request you’re making, and the full response, in a Pastebin or similar so I can understand the problem a bit further?

    Also, just to confirm, you’ve deactivated all other plugins and have temporarily switched to the Twenty Sixteen theme to make sure there isn’t some custom code causing a problem?

    I can modify, just thought there might a query that would produce all the results. I think the earlier version could return all users (and categories), like posts can be done now – any plans to implement this?

    No. We’ve intentionally limited the upper bound, because running unbounded queries can cause performance issues.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘get ALL users’ is closed to new replies.