Management APIs
Destinations API
List Destinations
4 min
list destinations you can list all of the destinations currently set up on your account by making making a http get request to the /destinations endpoint parameters the following querystring (http get) parameters allow you to refine the results returned by the destinations list api true false 140false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type example get get /destinations in the example below we list page 1 of all the destinations on your account http https //api rainforestapi com/destinations?api key=demo$ curl "https //api rainforestapi com/destinations?api key=demo"const axios = require('axios'); axios get('https //api rainforestapi com/destinations?api key=demo') then(response => { const apiresponse = response data; console log("total destinations ", apiresponse usage used); apiresponse destinations map((destination, number) => console log((number + 1) + ' ' + destination name); }) catch(error => { console error(error); });import requests import json params = { 'api key' 'demo' } api result = requests get('https //api rainforestapi com/destinations', { params }) api response = api result json() for number, destination in enumerate(api response\['destinations'], start=1) print "%s %s" % (number, destination\['name'])\<?php $querystring = http build query(\[ 'api key' => 'demo', ]); $ch = curl init(sprintf('%s?%s', 'https //api rainforestapi com/destinations', $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 destinations ", $api result\['usage']\['used'], php eol; foreach ($api result\['destinations'] as $number => $destination) { echo "{$number} {$destination\['name']}", php eol; } ?> rainforest api responds with the following json showing page 1 of all the destinations on your rainforest api account { "request info" { "success" true }, "usage" { "used" 1, "limit" 50, "available" 49 }, "destinations" \[ { "id" "abcdefg", "name" "my first s3 destination", "type" "s3", "enabled" true, "used by" 0, "s3 bucket name" "s3 bucket name", "s3 path prefix" "my path prefix" } ] } next steps update destination https //docs trajectdata com/rainforestapi/destinations api/update delete destination https //docs trajectdata com/rainforestapi/destinations api/delete