---
title: Find Requests
slug: backyardapi/collections-api/requests/find
docTags: 
createdAt: 2024-07-23T14:57:52.062Z
---

# Find Requests

You can Find (or search) the Requests in a Collection by making making a `HTTP GET` request to the `/collections/COLLECTION_ID/requests/PAGE?q=XYZ` endpoint (where `COLLECTION_ID` is the `id` of the Collection to get Requests for,  `PAGE` is the page of matching Requests 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 Requests within Collections on your UI as you can allow them to search through all of the Requests in the Collection to find the one they'd like to modify.

:::hint{type="info"}
**Concurrency when Finding Requests**
You should make calls to the Find Request 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>  `/collections/COLLECTION_ID/requests/PAGE?q=XYZ`

In the example below we return  `page 1` of the Requests from the Collection 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**
Backyard API will look for the  `q`  parameter in the Request and in the custom\_id (if any) you assigned to the Request. This way it's easy to find Requests using the custom\_id from your app.
:::

:::CodeblockTabs
HTTP

```HTTP
https://api.backyardapi.com/collections/123456/requests/1?api_key=demo&q=test
```

```curl
$ curl "https://api.backyardapi.com/collections/123456/requests/1?api_key=demo&q=test"
```

```nodejs
const axios = require('axios');

axios.get('https://api.backyardapi.com/collections/123456/requests/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.backyardapi.com/collections/123456/requests/1?api_key=demo&q=test'')

api_response = api_result.json()
```

```php
<?php
      
$ch = curl_init('https://api.backyardapi.com/collections/123456/requests/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);

?>
```
:::

Backyard API responds with the following JSON showing all the Requests on page 1 of the Collection:

```json
{
  "request_info": {
    "success": true
  },
  "collection_id": "123456",
  "requests_page_current": 1,
  "requests_page_count": 1,
  "requests_total_count": 1,
  "search_term": "test",
  "requests": [
    {
      "type": "product",
      "customer_zipcode": "77001",
      "item_id": "782866746",
      "custom_id": "MyCustomID_001",
      "id": "ABCDEFGHIJKLMNOP"
    }
  ]
}
```

***

### Finding by Custom ID

<font color="#52c41a">`GET`</font>  `/collections/COLLECTION_ID/requests/PAGE?custom_id=XYZ`
In the example below we return  `page 1` of the Requests from Collection with `custom_id=123456` . This is useful for keeping track of Requests and referencing them by the ID you passed into the  `custom_id`  field.

:::CodeblockTabs
HTTP

```HTTP
https://api.backyardapi.com/collections/123456/requests/1?api_key=demo&custom_id=MyCustomID_001
```

```curl
$ curl "https://api.backyardapi.com/collections/123456/requests/1?api_key=demo&custom_id=MyCustomID_001"
```
:::

Backyard API responds with the following JSON showing all the Requests matching the passed  `custom_id` :

```json
{
  "request_info": {
    "success": true
  },
  "collection_id": "123456",
  "requests_page_current": 1,
  "requests_page_count": 1,
  "requests_total_count": 1,
  "search_term": "test",
  "requests": [
    {
      "type": "product",
      "customer_zipcode": "77001",
      "item_id": "782866746",
      "custom_id": "MyCustomID_001",
      "id": "ABCDEFGHIJKLMNOP"
    }
  ]
}
```

