API GET record limit Topic is solved

General questions relating to Joomla! 4.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Post Reply
sclg
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 124
Joined: Mon Nov 06, 2006 7:46 pm
Location: Gloucestershire, UK

API GET record limit

Post by sclg » Fri Feb 23, 2024 12:26 pm

Playing with the API and users, it seems that it only returns 20 at a time - along with links to other pages.
Is it possible to change this limit? I want all the user data in one array (about 50 users) and it would be easiest if I could get it all at once.
If it's not possible I'd welcome some advice on how to use the pagination links to actually get everything into one array.
Thanks

User avatar
pe7er
Joomla! Master
Joomla! Master
Posts: 24968
Joined: Thu Aug 18, 2005 8:55 pm
Location: Nijmegen, Netherlands
Contact:

Re: API GET record limit

Post by pe7er » Fri Feb 23, 2024 12:31 pm

You can add parameters. Add something like
&list[limit]=50 for 50 results
or
&list[limit]=50 for all results
behind the URL
Kind Regards,
Peter Martin, Global Moderator
Company website: https://db8.nl/en/ - Joomla specialist, Nijmegen, Netherlands
The best website: https://the-best-website.com

sclg
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 124
Joined: Mon Nov 06, 2006 7:46 pm
Location: Gloucestershire, UK

Re: API GET record limit

Post by sclg » Fri Feb 23, 2024 12:51 pm

Tried
{{base_url}}/{{base_path}}/users?list[limit]=200
... but it still returned only 20...

sclg
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 124
Joined: Mon Nov 06, 2006 7:46 pm
Location: Gloucestershire, UK

Re: API GET record limit

Post by sclg » Fri Feb 23, 2024 3:26 pm

?page[limit]=200 worked.
Thanks

User avatar
pe7er
Joomla! Master
Joomla! Master
Posts: 24968
Joined: Thu Aug 18, 2005 8:55 pm
Location: Nijmegen, Netherlands
Contact:

Re: API GET record limit

Post by pe7er » Fri Feb 23, 2024 3:34 pm

Good to hear that you've solved it. Thanks for sharing your solution!
Kind Regards,
Peter Martin, Global Moderator
Company website: https://db8.nl/en/ - Joomla specialist, Nijmegen, Netherlands
The best website: https://the-best-website.com


Post Reply

Return to “General Questions/New to Joomla! 4.x”