Pagination options in launches/query don't work. No matter what page number you post, query would always return the first page.
Author: pavlokurochkaCreated Aug 20, 2024Updated Jan 16, 2026
Pagination options in spacexdata don't work. No matter what page number you post, query would always return the first page.
import requests
rc = requests.delete(f"https://api.spacexdata.com/admin/cache")
rc.raise_for_status()
print(rc)
response = requests.post(
"https://api.spacexdata.com/v4/launches/query",
json={
"query": {
"date_utc": {
"$gt": "2017-01-24T00:00:00.000Z",
},
"options": {
"page": 5,
"limit": 10
}
}
}
)
response_json = response.json()
for k in response_json.keys():
print(f'{k}:{response_json[k]}')totalDocs:170 offset:0 limit:10 totalPages:17 page:1 pagingCounter:1 hasPrevPage:False hasNextPage:True prevPage:None nextPage:2
Source: r-spacex/SpaceX-API