---
title: Find Searches
slug: serpwow/batches-api/searches/find
docTags: 
createdAt: 2024-08-05T14:13:33.938Z
---

# Find Searches

You can Find (or search) the Searches in a Batch by making making a `HTTP GET` request to the `/batches/BATCH_ID/searches/PAGE?q=XYZ` endpoint (where `BATCH_ID` is the `id` of the Batch to get Searches for,  `PAGE` is the page of matching Searches to get and the  `q`  querystring parameter is the search term to search for).

This endpoint is particuarly useful if you are allowing your users to modify the Searches within Batches on your UI as you can allow them to search through all of the Searches in the Batch to find the one they'd like to modify.

:::hint{type="info"}
**Concurrency when Finding Searches**
You should make calls to the Find Search endpoint sequentially, rather than in parallel. If you make too many concurrent calls you will receive an  `HTTP 429`  error.
:::

***

### Example

<font color="#52c41a">`GET`</font>  `/batches/BATCH_ID/searches/PAGE?q=XYZ`

In the example below we return  `page 1` of the Searches from the Batch with `id=123456` that match the search term  `test`  (note the search term is specified using the "q" querystring parameter):

:::hint{type="info"}
**Searching by Custom IDs**
SerpWow will look for the  `q`  parameter in the Search and in the custom\_id (if any) you assigned to the Search. This way it's easy to find Searches using the custom\_id from your app.
:::

:::CodeblockTabs
HTTP

```HTTP
https://api.serpwow.com/live/batches/123456/searches/1?api_key=demo&q=test
```

```curl
$ curl "https://api.serpwow.com/live/batches/123456/searches/1?api_key=demo&q=test"
```

```nodejs
const axios = require('axios');

axios.get('https://api.serpwow.com/live/batches/123456/searches/1?api_key=demo&q=test')
  .then(response => {
    const apiResponse = response.data;

  }).catch(error => {
    console.log(error);
  });
```

```python
import requests

api_result = requests.get('https://api.serpwow.com/live/batches/123456/searches/1?api_key=demo&q=test'')

api_response = api_result.json()
```

```php
<?php
      
$ch = curl_init('https://api.serpwow.com/live/batches/123456/searches/1?api_key=demo&q=test');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
# the following options are required if you're using an outdated OpenSSL version
# more details: https://www.openssl.org/blog/blog/2021/09/13/LetsEncryptRootCertExpire/
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 180);

$json = curl_exec($ch);
curl_close($ch);

$api_result = json_decode($json, true);

print_r($api_result);

?>
```
:::

SerpWow responds with the following JSON showing all the Searches on page 1 of the Batch:

```json
{
  "request_info": {
    "success": true
  },
  "batch_id": "123456",
  "searches_page_current": 1,
  "searches_page_count": 1,
  "searches_total_count": 1,
  "search_term": "test",
  "searches": [
    {
      "q": "mcdonalds",
      "location": "United States",
      "search_type": "images",
      "custom_id": "MyCustomID_001",
      "id": "ABCDEFGHIJKLMNOP"
    }
  ]
}
```

***

### Finding by Custom ID

<font color="#52c41a">`GET`</font>  `/batches/BATCH_ID/searches/PAGE?custom_id=XYZ`

In the example below we return  `page 1` of the Searches from Batch with `custom_id=123456` . This is useful for keeping track of Searches and referencing them by the ID you passed into the  `custom_id`  field.

:::CodeblockTabs
HTTP

```HTTP
https://api.serpwow.com/live/batches/123456/searches/1?api_key=demo&custom_id=MyCustomID_001
```

```curl
$ curl "https://api.serpwow.com/live/batches/123456/searches/1?api_key=demo&custom_id=MyCustomID_001"
```
:::

SerpWow responds with the following JSON showing all the Searches matching the passed  `custom_id` :

```json
{
  "request_info": {
    "success": true
  },
  "batch_id": "123456",
  "searches_page_current": 1,
  "searches_page_count": 1,
  "searches_total_count": 1,
  "search_term": "test",
  "searches": [
    {
      "q": "mcdonalds",
      "location": "United States",
      "search_type": "images",
      "custom_id": "MyCustomID_001",
      "id": "ABCDEFGHIJKLMNOP"
    }
  ]
}
```

