Management APIs
Destinations API

List Destinations

4min
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 parameter required description api key required the api key for your account search term optional limits the returned destinations to just those containing the search term in their name page optional set the page number of destinations to return, defaults to page=1 10 destinations are returned per page sort by optional the sort order to apply to the results valid values are type (to sort by destination type) or name (to sort by destination name) 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 /destinations in the example below we list page 1 of all the destinations on your account http https //api scaleserp com/destinations?api key=demo$ curl "https //api scaleserp com/destinations?api key=demo"const axios = require('axios'); axios get('https //api scaleserp 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 scaleserp 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 scaleserp 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; } ?> scale serp responds with the following json showing page 1 of all the destinations on your scale serp 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/scaleserp/destinations api/update delete destination https //docs trajectdata com/scaleserp/destinations api/delete