Get started
Quickstart
Get a key, call the API and read your first listings.
1. Get a key
Sign in on SiteSwap as an owner or admin of your company, open API keys, name the key, say what it is for and tick what it may do. The key is shown once, so copy it. It works once a SiteSwap admin approves it; until then every call answers 403 key_pending.
2. Call the API
Send the key in a header on every call.
curl -H "Authorization: Bearer ssk_YOUR_KEY" "https://dev.siteswap.pro/api/v1/listings?marketplace=materials&zip=01801&limit=5"const res = await fetch("https://dev.siteswap.pro/api/v1/listings?marketplace=materials&zip=01801&limit=5", {
headers: { Authorization: "Bearer " + process.env.SITESWAP_KEY },
});
const { data, next_cursor } = await res.json();
console.log(data.map((l) => l.title), next_cursor);import os, requests
r = requests.get("https://dev.siteswap.pro/api/v1/listings", params={"marketplace": "materials", "zip": "01801", "limit": 5},
headers={"Authorization": "Bearer " + os.environ["SITESWAP_KEY"]})
r.raise_for_status()
print([l["title"] for l in r.json()["data"]])3. See who you are
curl -H "X-API-Key: ssk_YOUR_KEY" https://dev.siteswap.pro/api/v1/companyThe answer names your company, the role of the person who asked for the key and what the key may do.
Next
- Read listings: filters and paging.
- Errors and rate limits: what to retry and when.
SiteSwap API v1Support