---
title: Get Collection
slug: backyardapi/collections-api/collections/get
docTags: 
createdAt: 2024-07-23T14:57:52.062Z
---

# Get Collection

You can get a Collection by making making a `HTTP GET` request to the `/collections/COLLECTION_ID` endpoint (where `COLLECTION_ID` is the `id` of the Collection you wish to get).

Backyard API will return all information about the Collection, including whether it is currently running and how many Requests and Results Sets the Collection currently has.

:::hint{type="info"}
Note that the Collection Get endpoint just returns counts of the number of Requests and Result Sets the Collection contains. If you wish to retrieve the actual Requests or Result Sets in the Collection you should use the [List Requests](https://docs.trajectdata.com/backyardapi/collections-api/requests/list) and [List Result Sets](https://docs.trajectdata.com/backyardapi/collections-api/results/list) endpoints.
:::

***

### Example

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

In the example below we Get a Collection with `id=123456` :

:::CodeblockTabs
HTTP

```HTTP
https://api.backyardapi.com/collections/123456?api_key=demo
```

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

```nodejs
const axios = require('axios');
const params = {
  api_key: 'demo'
}

axios.get('https://api.backyardapi.com/collections/123456', { params })
  .then(response => {
    const apiResponse = response.data;

    console.log('Collection Name: ' + apiResponse.collection.name);

  }).catch(error => {
    console.log(error);
  });
```

```python
import requests

params = {
  'api_key': 'demo'
}

api_result = requests.get('https://api.backyardapi.com/collections/123456', params)

api_response = api_result.json()

print "Collection Name: ", api_response['collection']['name']
```

```php
<?php
      
$queryString = http_build_query([
  'api_key' => 'demo',
]);

$ch = curl_init(sprintf('%s?%s', 'https://api.backyardapi.com/collections/123456', $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);

echo "Collection Name: ", $api_result['collection']['name'], PHP_EOL;

?>
```
:::

Backyard API responds with the following JSON showing all details of the Collection:

```json
{
  "request_info": {
    "success": true
  },
  "collection": {
    "id": "123456",
    "created_at": "2020-01-01T00:00:00.000Z",
    "name": "My First Collection",
    "schedule_type": "manual/daily/weekly/monthly",
    "priority": "normal",
    "destination_ids": [
      "destination_id_1",
      "destination_id_2"
    ],
    "enabled": true,
    "status": "idle/queued/running",
    "request_total_count": 0,
    "request_page_count": 0,
    "credits_required": 0,
    "next_result_set_id": 1,
    "results_count": 0,
    "schedule_hours": [
      9,
      17
    ],
    "notification_email": "john.smith@example.com",
    "notification_as_json": false,
    "notification_as_jsonlines": false,
    "notification_as_csv": true
  }
}
```

***

**Next Steps**
     [List Requests](https://docs.trajectdata.com/backyardapi/collections-api/requests/list)
     [List Result Sets](https://docs.trajectdata.com/backyardapi/collections-api/results/list)
