Using the Tap API
Base URL, authentication, and core endpoints for the Tap public REST API at sdk.tap.co.
Overview#
The Tap API is the public REST gateway to every supplier, platform, and plan on Tap. Use it to search inventory, generate plans, and manage campaigns programmatically — from your own backend, an internal tool, or the Tap CLI.
If your use case is AI-assistant-driven (an LLM that reasons over Tap data and calls tools), use the Tap MCP server instead — same auth, same data, MCP transport.
Base URL#
https://sdk.tap.co/v1
Related endpoints under the same auth:
https://mcp.tap.co— MCP server (for Claude Desktop and other MCP clients)https://adcp.tap.co— ADCP gateway (Prebid.org Ad Context Protocol)
Authentication#
Every request requires Bearer authentication:
Authorization: Bearer sk_live_…
Get an API key from Profile → API Keys in the Tap dashboard, or request access if you don't have an account yet. Requests without a valid key get 401 Unauthorized.
API keys grant access to your account's data. Never commit them to source control, embed them in client-side code, or share them in plain text. Revoke and rotate immediately if a key is exposed.
Core endpoints#
Discovery#
| Method | Endpoint | Description |
|---|---|---|
POST | /platforms/search | Search platforms by market, format, audience, budget |
Planning#
| Method | Endpoint | Description |
|---|---|---|
POST | /plans/generate | Generate a media plan from a brief (goal, budget, audience, markets) |
Campaigns#
| Method | Endpoint | Description |
|---|---|---|
GET | /campaigns | List your campaigns (optional ?status= filter) |
GET | /campaigns/{id} | Get a single campaign |
Example request#
Search for TV inventory in a specific market:
curl -X POST "https://sdk.tap.co/v1/platforms/search" \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"market": "Phoenix",
"format": "tv",
"audience": "adults_25_54",
"budget": 30000
}'Response:
{
"platforms": [
{
"id": "plat_kpho",
"name": "KPHO Phoenix",
"type": "tv",
"market": "Phoenix",
"reach": 850000,
"cpm": 18.50
}
],
"total": 12
}Generating a plan#
curl -X POST "https://sdk.tap.co/v1/plans/generate" \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"goal": "brand awareness for a new product launch",
"budget": 50000,
"audience": "women_25_54",
"markets": ["Los Angeles", "San Francisco"]
}'Response includes the generated plan with platforms, allocation, and projected reach.
Tap CLI#
If you'd rather not write code, the Tap CLI wraps the API:
npm install -g @tap/cli
tap auth login
tap platforms search --market "Phoenix" --format tv
tap plans generate --budget 50000 --audience "women_25_54" --markets "Los Angeles,San Francisco"By default the CLI talks to https://sdk.tap.co/v1. Override with TAP_API_URL if you need to point at a different environment.
Error handling#
Standard HTTP status codes:
| Status | Meaning |
|---|---|
400 | Validation error in the request body or query params |
401 | Missing or invalid API key |
403 | Key doesn't have permission for this resource |
404 | Resource doesn't exist |
429 | Rate limited |
5xx | Server error — retry with backoff |
Error response shape:
{
"error": "Unauthorized",
"message": "Invalid API key. Please provide a valid API key using Bearer authentication.",
"code": "INVALID_API_KEY"
}Best practices#
- Always check the status code before parsing the response body
- Log full error responses for debugging
- Retry on 5xx with exponential backoff (max ~3 attempts)
- Don't retry on 4xx — fix the request and resend
- Use environment variables for API keys — never hardcode
- Cache discovery results — platform/inventory data changes infrequently; 15–30 minute TTLs are reasonable
Rate limiting#
The API is rate-limited per API key. If you hit the limit you'll get 429 Too Many Requests. Slow your request rate or contact support about higher limits for your use case.
Documentation#
The full reference and request/response schemas live at docs.tap.co.