Use the Query resource to execute a SOQL query that returns all the results in a single response, or if needed, returns part of the results and a locator used to retrieve the remaining results.
The following query requests the value from name fields from all Account records.
In such cases, request the next batch of records and repeat until all records have been retrieved. These requests use nextRecordsUrl, and don’t include any parameters.
Example usage for retrieving the remaining query results