Collections
...
Collections API
Collections
Get Collection
3min
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) rainforest 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 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/rainforestapi/collections api/requests/list and list result sets https //docs trajectdata com/rainforestapi/collections api/results/list endpoints example get get /collections/collection id in the example below we get a collection with id=123456 http https //api rainforestapi com/collections/123456?api key=demo$ curl "https //api rainforestapi com/collections/123456?api key=demo"const axios = require('axios'); const params = { api key 'demo' } axios get('https //api rainforestapi com/collections/123456', { params }) then(response => { const apiresponse = response data; console log('collection name ' + apiresponse collection name); }) catch(error => { console log(error); });import requests params = { 'api key' 'demo' } api result = requests get('https //api rainforestapi com/collections/123456', params) api response = api result json() print "collection name ", api response\['collection']\['name']\<?php $querystring = http build query(\[ 'api key' => 'demo', ]); $ch = curl init(sprintf('%s?%s', 'https //api rainforestapi 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; ?> rainforest api responds with the following json showing all details of the collection { "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/rainforestapi/collections api/requests/list list result sets https //docs trajectdata com/rainforestapi/collections api/results/list