How do I get a complete list in the API call response?

Marcelo Romero

I'm currently having an issue with the endpoint to get the list of all our courses (currently more than 3,000). I'm using the "GET /api/author/course_templates" endpoint and adding the "limit" parameter to get up to 4000 (GET /api/author/course_templates?limit=4000).  My problem is that no matter what the limit is, it always gives me 1,000 max. Is there a way to get the complete list?

0

Comments

3 comments

  • Comment author
    Douglas Costa
    • Edited

    @MarcelRomero I'm currently having an issue with the endpoint to get the list of all our courses (currently more than 3,000). I'm using the "GET /api/author/course_templates" endpoint and adding the "limit" parameter compassmobile dollartree com to get up to 4000 (GET /api/author/course_templates?limit=4000).  My problem is that no matter what the limit is, it always gives me 1,000 max. Is there a way to get the complete list?

    It sounds like the API might have a hard limit of 1,000 items per request. You may need to implement pagination to retrieve the full list. Check if the API provides pagination parameters like page or offset to help you fetch all the courses.

     

    0
  • Comment author
    Marcelo Romero

    Hi Douglas! Thank you for your comment. They DO provide a pagination system in the response which is a link to the next page. All good now 👍

    0
  • Comment author
    Gael
    • Edited

    The best solution is to implement pagination. Most APIs have a hard limit (like 1,000) per request, so you’ll need to use offset or page parameters to fetch data in chunks. For example:
    GET /api/author/course_templates?limit=1000&offset=0,
    then
    offset=1000, offset=2000, and so on—until you retrieve all courses.

    Check the API documentation for exact pagination support.

    0

Please sign in to leave a comment.