Getting Started
Everything you need to start using the Keychain API.
Base URL
All API requests use the following base URL:
https://api.keychain.com/v1
Authentication
Every request must include your API key in the X-API-Key header:
X-API-Key: your-api-key-here
To obtain an API key, contact us at support@keychain.com.
Requests without a valid key receive a 401 Unauthorized response.
Pagination
List endpoints return paginated results using offset/limit parameters:
| Parameter | Default | Max | Description |
|---|---|---|---|
offset | 0 | — | Number of records to skip |
limit | 20 | 100 | Number of records to return |
Every paginated response includes a pagination object:
{
"data": [ ... ],
"pagination": {
"offset": 0,
"limit": 20,
"total": 142
}
}
To fetch the next page, set offset to the current offset + limit.
Error handling
Errors return a JSON object with code and message:
{
"code": 400,
"message": "Invalid parameter: offset must be >= 0"
}
| Status | Meaning |
|---|---|
400 | Bad request — check your query parameters |
401 | Unauthorized — missing or invalid API key |
404 | Not found — the resource doesn't exist |
Rate limits
Rate limits apply per API key. Contact us at support@keychain.com for details about your plan's limits.
Code examples
cURL
curl -H "X-API-Key: your-api-key-here" \
"https://api.keychain.com/v1/skus?limit=5"
Python
import requests
headers = {"X-API-Key": "your-api-key-here"}
response = requests.get(
"https://api.keychain.com/v1/skus",
headers=headers,
params={"limit": 5},
)
data = response.json()
for sku in data["data"]:
print(f"{sku['name']} (v{sku['version']})")
JavaScript
const response = await fetch(
"https://api.keychain.com/v1/skus?limit=5",
{
headers: { "X-API-Key": "your-api-key-here" },
}
);
const { data, pagination } = await response.json();
data.forEach((sku) => {
console.log(`${sku.name} (v${sku.version})`);
});