You should use the search endpoint to fetch 1000 records each time ordered by ID, then use the last ID to perform the next search of 1000 records.
See this post for more details on how to use search endpoints.
You should use the search endpoint to fetch 1000 records each time ordered by ID, then use the last ID to perform the next search of 1000 records.
See this post for more details on how to use search endpoints.