---
title: List Requests
slug: bluecartapi/collections-api/requests/list
docTags: 
createdAt: 2024-07-27T17:51:31.971Z
---

# List Requests

You can List the Requests for a Collection by making making a `HTTP GET` request to the `/collections/COLLECTION_ID/requests/PAGE` endpoint (where `COLLECTION_ID` is the `id` of the Collection to get Requests for, and `PAGE` is the page of Requests to get).

The `/collections/COLLECTION_ID/requests/PAGE` endpoint returns the Requests for a Collection in pages of 1000 Requests per page. Pages start at `1` . You can find out how many pages a Collection has by inspecting the `requests_page_count` field returned from the [Get Collection](https://docs.trajectdata.com/bluecartapi/collections-api/collections/get) endpoint.

BlueCart API also provides two more endpoints to allow you to retrieve a download link for all Requests in a Collection, in either `JSON` or `CSV` format.

***

### List Requests by Page

<font color="#52c41a">`GET`</font>  `/collections/COLLECTION_ID/requests/PAGE`

In the example below we List `page 1` of the Requests for the Collection with `id=123456` :

:::CodeblockTabs
HTTP

```HTTP
https://api.bluecartapi.com/collections/123456/requests/1?api_key=demo
```

```curl
$ curl "https://api.bluecartapi.com/collections/123456/requests/1?api_key=demo"
```

```nodejs
const axios = require('axios');
const params = {
  api_key: 'demo'
}

axios.get('https://api.bluecartapi.com/collections/123456/requests/1', { params })
  .then(response => {
    const apiResponse = response.data;

  }).catch(error => {
    console.log(error);
  });
```

```python
import requests

params = {
  'api_key': 'demo'
}

api_result = requests.get('https://api.bluecartapi.com/collections/123456/requests/1', params)

api_response = api_result.json()
```

```php
<?php
      
$queryString = http_build_query([
  'api_key' => 'demo',
]);

$ch = curl_init(sprintf('%s?%s', 'https://api.bluecartapi.com/collections/123456/requests/1', $queryString));
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);

?>
```
:::

BlueCart 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": [
    {
      "type": "product",
      "customer_zipcode": "77001",
      "item_id": "782866746",
      "custom_id": "MyCustomID_001",
      "id": "ABCDEFGHIJKLMNOP"
    }
  ]
}
```

***

### Get JSON Download Links

<font color="#52c41a">`GET`</font>  `/collections/COLLECTION_ID/requests/json`

In the example below we retrieve download links for all Requests for Collection with `id=123456` in `JSON` format:

:::CodeblockTabs
HTTP

```HTTP
https://api.bluecartapi.com/collections/123456/requests/json?api_key=demo
```

```curl
$ curl "https://api.bluecartapi.com/collections/123456/requests/json?api_key=demo"
```

```nodejs
const axios = require('axios');
const params = {
  api_key: 'demo'
}

axios.get('https://api.bluecartapi.com/collections/123456/requests/json', { params })
  .then(response => {
    const apiResponse = response.data;

  }).catch(error => {
    console.log(error);
  });
```

```python
import requests

params = {
  'api_key': 'demo'
}

api_result = requests.get('https://api.bluecartapi.com/collections/123456/requests/json', params)

api_response = api_result.json()
```

```php
<?php
      
$queryString = http_build_query([
  'api_key' => 'demo',
]);

$ch = curl_init(sprintf('%s?%s', 'https://api.bluecartapi.com/collections/123456/requests/json', $queryString));
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);

?>
```
:::

BlueCart API responds with the following JSON detailing the total number of Requests  `requests_total_count` , the total number of pages  `requests_page_count`  and a JSON file  `download_link` for each page:

```json
{
  "request_info": {
    "success": true
  },
  "collection_id": "123456",
  "requests_total_count": 1,
  "requests_page_count": 1,
  "download_links": {
    "pages": [
      "https://requests.bluecartapi.com/Collection_Requests_123456_Page_1.json"
    ]
  }
}
```

***

### Get CSV Download Links

<font color="#52c41a">`GET`</font>  `/collections/COLLECTION_ID/requests/csv`

In the example below we retrieve download links for all Requests for Collection with `id=123456` in `CSV` format:

:::CodeblockTabs
HTTP

```HTTP
https://api.bluecartapi.com/collections/123456/requests/csv?api_key=demo
```

```curl
$ curl "https://api.bluecartapi.com/collections/123456/requests/csv?api_key=demo"
```

```nodejs
const axios = require('axios');
const params = {
  api_key: 'demo'
}

axios.get('https://api.bluecartapi.com/collections/123456/requests/csv', { params })
  .then(response => {
    const apiResponse = response.data;

  }).catch(error => {
    console.log(error);
  });
```

```python
import requests

params = {
  'api_key': 'demo'
}

api_result = requests.get('https://api.bluecartapi.com/collections/123456/requests/csv', params)

api_response = api_result.json()
```

```php
<?php
      
$queryString = http_build_query([
  'api_key' => 'demo',
]);

$ch = curl_init(sprintf('%s?%s', 'https://api.bluecartapi.com/collections/123456/requests/csv', $queryString));
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);

?>
```
:::

BlueCart API responds with the following JSON detailing the total number of Requests  `requests_total_count` , the total number of pages  `requests_page_count`  and a CSV file  `download_link` for each page:

```json
{
  "request_info": {
    "success": true
  },
  "collection_id": "123456",
  "requests_total_count": 1,
  "requests_page_count": 1,
  "download_links": {
    "pages": [
      "https://requests.bluecartapi.com/Collection_Requests_123456_Page_1.csv"
    ]
  }
}
```

***

**Next Steps**
     [Listing Result Sets](https://docs.trajectdata.com/bluecartapi/collections-api/results/list)
     [Getting Result Sets](https://docs.trajectdata.com/bluecartapi/collections-api/results/get)
