Setpilot API v2 lets you pull your own profit analytics data out of Setpilot into your own dashboards, scripts, or BI tools. Access is authorised with a store API key that you generate in Settings.
When to use API v2
Building a custom dashboard in Looker, Metabase, Google Sheets, or similar.
Running a weekly P&L export as a scheduled script.
Feeding Setpilot data into a data warehouse (BigQuery, Snowflake, Postgres).
Powering an AI assistant through the Setpilot MCP server — see the separate article on the MCP server.
Create an API key
Go to Settings → API Keys.
Click New API key.
Give the key a name (for example, "Looker dashboard") so you recognise it later.
Select the scopes the key is allowed to access — keep this minimal.
Click Create and copy the key. It starts with
spa_sk_. You will see the full key only once; if you lose it, revoke it and create a new one.
Scopes
Each key is limited to one or more scopes. Scope a key down to only what the integration needs.
Scope | Gives access to |
dashboard | Summary P&L, daily breakdowns, cost breakdown, top products, customer metrics, marketing spend. |
orders | Paginated order list with search. |
products | Paginated product list with search. |
inventory | Inventory with low-stock filter and sort. |
Making a request
Send the key as a bearer token in the Authorization header. Base URL: https://app.setpilot.io/api/v2/.
Endpoint | Scope | Notes |
GET dashboard/summary/ | dashboard | Query params: year. |
GET dashboard/daily/ | dashboard | start_date, end_date, days (default 90), country. |
GET dashboard/cost-breakdown/ | dashboard | year, country. |
GET top-products/ | dashboard | year, limit (max 100). |
GET customer-metrics/ | dashboard | year, months (max 24). |
GET marketing/ | dashboard | months (max 24). |
GET orders/ | orders | page, page_size (max 100), search. |
GET products/ | products | page, page_size (max 100), search. |
GET inventory/ | inventory | limit (max 100), sort_by, include_low_stock_only. |
All responses use the same envelope shape:
{ "data": { ... }, "meta": { "shop": "...", "currency": "...", "timezone": "...", "generated_at": "..." } }
Rate limits
Each key is limited to 120 requests per minute. If you need a higher limit for a specific integration, contact support.
Revoke a key
In Settings → API Keys click Revoke next to the key. Revoked keys stop working immediately. Existing callers will start seeing HTTP 401. Create a new key to replace it.
Security
Store API keys in environment variables or a secret manager — never commit them to git.
Create one key per integration so you can revoke them independently.
Only grant the scopes a given integration actually needs.
Rotate keys on a schedule (for example, every 6 months) and whenever a teammate with access leaves.
Related articles
MCP server for Claude, Cursor and ChatGPT — how to use your API key with AI tools.
Team management and roles — who can create API keys.
