I am making a project in python/flask. I want to get a list of all the courses of edx. But the API provides the list page by page. I can't figure out how to get the entire list. Any help is appreciated. Thanks!
I am making a project in python/flask. I want to get a list of all the courses of edx. But the API provides the list page by page. I can't figure out how to get the entire list. Any help is appreciated. Thanks!
I assume you are using this endpointhttps://courses.edx.org/api/courses/v1/courses/
As can be seen, there is a pagination
block in the result:
"pagination": {"count": 3261,"previous": null,"num_pages": 327,"next": "https://courses.edx.org/api/courses/v1/courses/?page=2"},
The next
field in this block will help you fetch the next page of the results. You cannot fetch all the courses in one go.