# Run a scrolling search **POST /_search/scroll/{scroll_id}** **All methods and paths for this operation:**
GET /_search/scroll
POST /_search/scroll
GET /_search/scroll/{scroll_id}
POST /_search/scroll/{scroll_id}
IMPORTANT: The scroll API is no longer recommend for deep pagination. If you need to preserve the index state while paging through more than 10,000 hits, use the `search_after` parameter with a point in time (PIT). The scroll API gets large sets of results from a single scrolling search request. To get the necessary scroll ID, submit a search API request that includes an argument for the `scroll` query parameter. The `scroll` parameter indicates how long Elasticsearch should retain the search context for the request. The search response returns a scroll ID in the `_scroll_id` response body parameter. You can then use the scroll ID with the scroll API to retrieve the next batch of results for the request. If the Elasticsearch security features are enabled, the access to the results of a specific scroll ID is restricted to the user or API key that submitted the search. You can also use the scroll API to specify a new scroll parameter that extends or shortens the retention period for the search context. IMPORTANT: Results from a scrolling search reflect the state of the index at the time of the initial search request. Subsequent indexing or document changes only affect later search and scroll requests. ## Required authorization * Index privileges: `read` [External documentation](https://www.elastic.co/docs/reference/elasticsearch/rest-apis/paginate-search-results#scroll-search-results) ## Servers - http://api.example.com: http://api.example.com () ## Authentication methods - Api key auth ## Parameters ### Path parameters - **scroll_id** (string) The scroll ID ### Query parameters - **scroll** (string) The period to retain the search context for scrolling. - **scroll_id** (string) The scroll ID for scrolled search - **rest_total_hits_as_int** (boolean) If true, the API response’s hit.total property is returned as an integer. If false, the API response’s hit.total property is returned as an object. ### Body: application/json (object) - **scroll** (string) The period to retain the search context for scrolling. - **scroll_id** (string) The scroll ID of the search. ## Responses ### 200 #### Body: application/json (object) - **took** (number) The number of milliseconds it took Elasticsearch to run the request. This value is calculated by measuring the time elapsed between receipt of a request on the coordinating node and the time at which the coordinating node is ready to send the response. It includes: * Communication time between the coordinating node and data nodes * Time the request spends in the search thread pool, queued for execution * Actual run time It does not include: * Time needed to send the request to Elasticsearch * Time needed to serialize the JSON response * Time needed to send the response to a client - **timed_out** (boolean) If `true`, the request timed out before completion; returned results may be partial or empty. - **_shards** (object) A count of shards used for the request. - **hits** (object) The returned documents and metadata. - **aggregations** (object) - **_clusters** (object) - **fields** (object) - **max_score** (number) - **num_reduce_phases** (number) - **profile** (object) - **pit_id** (string) - **_scroll_id** (string) The identifier for the search and its search context. You can use this scroll ID with the scroll API to retrieve the next batch of search results for the request. This property is returned only if the `scroll` query parameter is specified in the request. - **suggest** (object) - **terminated_early** (boolean) [Powered by Bump.sh](https://bump.sh)