Collections
...
Collections API
Collections
List Collections
5min
list collections you can list all of the collections currently set up on your account by making making a http get request to the /collections endpoint note that the collection list endpoint is rate limited to 60 requests per minute for real time updates as to your collection status it is recommended you use webhooks parameters the following querystring (http get) parameters allow you to refine the results returned by the collections list api parameter required description api key required the api key for your account only with results optional set to only with results=true to only return collections that have result sets available only without results optional set to only without results=true to only return collections that have no result sets available (i e that haven't yet been run) search term optional limits the returned collections to just those containing the search term in their name search type optional determines how the search term parameter is treated valid values are parameter values contains returns collections that contains all of the words (split by spaces) in the search term in their name or id properties (case insensitive) non alphanumeric characters are replaced by spaces starts with returns collections whose name property starts with the search term (case insensitive) ends with returns collections whose name property ends with the search term (case insensitive) exact returns collections whose name property exactly matches the search term (case sensitive) status optional filters the collections returned to only those matching the given status valid values are all , idle , queued or running defaults to all created before optional filters the collections returned to only those with a created at date before the value specified should be specified as an iso utc timestamp https //docs trajectdata com/rainforestapi/collections api/collections/https //en wikipedia org/wiki/iso 8601 , for example created before=2020 09 01t00 00 00 000z created after optional filters the collections returned to only those with a created at date after the value specified should be specified as an iso utc timestamp https //docs trajectdata com/rainforestapi/collections api/collections/https //en wikipedia org/wiki/iso 8601 , for example created after=2020 06 01t00 00 00 000z last run before optional filters the collections returned to only those with a last run date before the value specified should be specified as an iso utc timestamp https //docs trajectdata com/rainforestapi/collections api/collections/https //en wikipedia org/wiki/iso 8601 , for example last run before=2020 09 01t00 00 00 000z last run after optional filters the collections returned to only those with a last run date after the value specified should be specified as an iso utc timestamp https //docs trajectdata com/rainforestapi/collections api/collections/https //en wikipedia org/wiki/iso 8601 , for example last run after=2020 06 01t00 00 00 000z destination id optional filters the collections returned to only those with the specified destination id set you can view destination ids on the destinations page of the dashboard or via the destinations api page optional set the page number of collections to return, defaults to page=1 unless otherwise specified using the page size parameter, 25 collections are returned per page page size optional sets the number of results returned per page if the page size parameter is omitted then 25 results are returned per page by default the maximum number of results returned per page is 1000 ( page size=1000 ) sort by optional the sort order to apply to the results valid values are created at (to sort by collection creation date), last run (to sort by the date the collection was last run), name (to sort by collection name, the default), priority (to sort by collection priority) or status (to sort by collection status) use in conjunction with the sort direction parameter sort direction optional the sort direction to return results valid values are descending or ascending (the default) use in conjunction with the sort by parameter example get get /collections in the example below we list all the collections on your account http https //api rainforestapi com/collections?api key=demo$ curl "https //api rainforestapi com/collections?api key=demo"const axios = require('axios'); const params = { api key 'demo' } axios get('https //api rainforestapi com/collections?api key=demo') then(response => { const apiresponse = response data; console log("total collections ", apiresponse total count); apiresponse collections map((collection, number) => console log((number + 1) + ' ' + collection name); }) catch(error => { console error(error); });import requests params = { 'api key' 'demo' } api result = requests get('https //api rainforestapi com/collections', { params }) api response = api result json() print "total collections ", api response\['total count'] for number, collection in enumerate(api response\['collections'], start=1) print "%s %s" % (number, collection\['name'])\<?php $querystring = http build query(\[ 'api key' => 'demo', ]); $ch = curl init(sprintf('%s?%s', 'https //api rainforestapi com/collections', $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 "total collections ", $api result\['total count'], php eol; foreach ($api result\['collections'] as $number => $collection) { echo "{$number} {$collection\['name']}", php eol; } ?> rainforest api responds with the following json showing all the collections on your rainforest api account { "request info" { "success" true }, "total count" 2, "total pages" 1, "current page" 1, "count this page" 2, "collections" \[ { "id" "2a6f94bb", "created at" "2020 01 01t00 00 01 000z", "last run" "2020 09 01t00 00 00 000z", "name" "my second collection", "schedule type" "weekly", "priority" "normal", "destination ids" \[ "destination id 1", "destination id 2" ], "enabled" true, "status" "idle", "requests total count" 0, "requests page count" 0, "next result set id" 1, "results count" 0, "schedule days of week" \[ 0, 3 ], "schedule hours" \[ 8 ], "notification email" "john smith\@example com", "notification as json" false, "notification as jsonlines" false, "notification as csv" false }, { "id" "cac8651d", "created at" "2020 01 02t00 00 00 000z", "last run" "2020 09 01t00 10 00 000z", "name" "my first collection", "schedule type" "daily", "priority" "normal", "destination ids" \[], "enabled" true, "status" "idle", "requests total count" 0, "requests page count" 0, "results count" 0, "schedule hours" \[ 9, 17 ], "notification email" "john smith\@example com", "notification as json" false, "notification as csv" true } ] } next steps webhook https //docs trajectdata com/rainforestapi/collections api/collections/webhook list requests https //docs trajectdata com/rainforestapi/collections api/requests/list list result sets https //docs trajectdata com/rainforestapi/collections api/results/list