Collections
...
Collections API
Result Sets

List Result Sets

3min
list result sets you can list all of the result sets for a collection by making a http get request to the /collections/collection id/results endpoint (where collection id is the id of the collection to get result sets for) rainforest api retains result sets for 14 days so you should download your result set data within this 14 day window example get get /collections/collection id/results in the example below we list all of the result sets for the collection with id=123456 http https //api rainforestapi com/collections/123456/results?api key=demo$ curl "https //api rainforestapi com/collections/123456/results?api key=demo"const axios = require('axios'); const params = { api key 'demo' } axios get('https //api rainforestapi com/collections/123456/results', { params }) then(response => { const apiresponse = response data; }) catch(error => { console log(error); });import requests params = { 'api key' 'demo' } api result = requests get('https //api rainforestapi com/collections/123456/results', params) api response = api result json()\<?php $querystring = http build query(\[ 'api key' => 'demo', ]); $ch = curl init(sprintf('%s?%s', 'https //api rainforestapi com/collections/123456/results', $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); ?> rainforest api responds with the following json showing all the results sets for the collection note the results array contains a list of all of the result sets the id property of a result set should be used with the get result set https //docs trajectdata com/rainforestapi/collections api/results/get endpoint to retrieve the actual results within the result set note the results array is sorted by the most recently run result set first { "request info" { "success" true }, "collection id" "123456", "collection" { "id" "123456", "created at" "2019 01 01t00 00 00 000z", "name" "my first collection", "schedule type" "daily", "enabled" true, "status" "idle", "requests total count" 1, "requests page count" 1, "results count" 1, "schedule hours" \[ 9, 17 ], "notification email" "john smith\@example com", "notification as json" false, "notification as jsonlines" false, "notification as csv" true }, "results count" 1, "results" \[ { "id" 1, "started at" "2019 01 02t00 00 00 000z", "ended at" "2019 01 02t00 00 10 000z", "expires at" "2019 01 08t00 00 10 000z", "results page count" 1, "requests completed" 1, "requests failed" 0, "requests total" 1, "webhook status" { "status" "ok", "log" \[ { "date time" "2020 01 01t00 00 00 000z", "text" "webhook post completed successfully " } ] }, "destination status" { "destination id" { "status" "ok", "log" \[ { "date time" "2020 01 01t00 00 00 000z", "text" "destination upload completed successfully " } ] } } } ] }