slashpeak

REST API and CSV exports

Read-only REST API (v1) with API keys (Growth, Pro and Enterprise), plus CSV downloads and the Excel report (every plan).

  • The REST API and API keys are on the Growth (1 key, 1,000 calls per day), Pro (5 keys, 10,000 calls per day) and Enterprise (up to 10 active keys, no daily cap) plans. The trial and Starter have no API.
  • CSV downloads and the Excel report are on every plan. To get the report by email on a schedule, see Alerts and notifications.

API keys

An owner creates keys in Settings → API.

  • A key looks like dp_live_…. The full key is shown once. Store it safely.
  • Keys are read-only. No endpoint changes data.
  • The number of active keys depends on your plan: 1 on Growth, 5 on Pro, up to 10 on Enterprise. Revoke a key to stop it at once and free its slot.
  • After a downgrade to a plan without the API, keys are kept but every call answers 403 plan_required.

Send the key in the Authorization header:

curl -H "Authorization: Bearer dp_live_…" https://slashpeak.com/api/v1/spend/summary?days=30

Rules

  • Base path: /api/v1. A breaking change gets a new version (/api/v2).
  • All endpoints are GET and return JSON. Endpoints marked CSV also take ?format=csv.
  • Money is in USD. Days are whole calendar days in your account timezone (Settings → General), today included: days=7 is today and the 6 days before it.
  • An account can have several connections. Without ?connection=, an endpoint reads your default (newest active) connection. List your connections with /api/v1/connections and pass an id as ?connection=<id> to read another. Every endpoint takes connection.
  • Rate limits: 60 requests per minute per key, plus a daily cap per account (1,000 on Growth, 10,000 on Pro, none on Enterprise; days are UTC). Over a limit you get 429 and a Retry-After header.
  • Errors always have this shape:
{ "error": { "code": "plan_required", "message": "The API needs the Growth, Pro or Enterprise plan." } }
StatuscodeMeaning
400invalid_requestA query parameter is wrong.
401unauthorizedNo key, a wrong key, or a revoked key.
403plan_requiredThe account is not on Growth, Pro or Enterprise.
404no_connectionThe account has no active BigQuery connection.
429rate_limitedToo many requests for this key.
500internal_errorTry again.

Endpoints

EndpointParametersCSV
/api/v1/connectionsnoneyes
/api/v1/spend/summarydays (1–90, default 30)yes
/api/v1/spend/dailyfrom, to (YYYY-MM-DD), or days (not both); groupBy = project | user | cost_centeryes
/api/v1/spend/by-userdays, limit (1–1000)yes
/api/v1/tables/toplimit (1–1000)yes
/api/v1/storagedatasetId (optional)no
/api/v1/reservationsdays (1–30, rounded up to 1, 7 or 30), limityes
/api/v1/findingsstatus = open | all, type, limit (1–200), cursoryes
/api/v1/queries/repeateddays, limityes

Spend

  • spend/summary: compute and other usage spend per day (other includes network egress, BigQuery Omni and Datastream when you set up the billing export), plus the current storage monthly rate.
  • spend/daily: compute spend per day per project, user, or cost center. Cache hits cost 0. The range is at most 90 days and from / to are inclusive. to after today counts as today, and from before your data starts moves to the first day of your data, so the reply's from can differ from the one you sent. A range with no days is a 400. days cannot be combined with from or to; with only to, you get the 30 days up to it. If there are more than 100,000 rows the reply has "truncated": true, drops the oldest days, and from moves forward.
  • spend/by-user: compute spend per user in the window. "truncated": true means more users spent than limit returned.

Findings

Findings are sorted by estimated monthly savings. A page has at most 200 rows. When there are more, the reply has nextCursor. Send it back as ?cursor= with the same status and type to get the next page; a cursor used with different filters is a 400. Paging stays correct if findings resolve while you page.

curl -H "Authorization: Bearer $KEY" "https://slashpeak.com/api/v1/findings?status=open&limit=100"

Storage and tables

  • tables/top: datasets ranked by storage cost (a monthly rate). "truncated": true means there are more datasets than limit.
  • storage: storage cost by class (active, long-term, time travel, fail-safe) as a monthly rate. Amounts have 4 decimals.

Excel report

The dashboard has an Email report button next to the range buttons. It sends the Excel file to your email. Nothing downloads in the browser. It uses the range, project, region and cost center you picked. It is the same file the report email attaches, with only the parts you get (see Report emails).

  • The page tells you that the report is on its way. The email arrives when the file is ready.
  • Your Reports setting (Settings → Notifications → Reports) must not be Never. If it is, the page tells you to turn it on first. A viewer can also ask an account owner to turn it on.
  • Owners and viewers can use it. An admin who views your account cannot.

One tab per dashboard section, plus Findings:

  • Executive summary: the key numbers, daily spend, daily health, spend by cost center and BigQuery SKUs.
  • Top offenders: top queries, users, projects, pipelines, datasets and tables, and tables read. Top lists hold the rows the dashboard shows.
  • Operational efficiency: savings opportunities, unused tables, failure rate by user, partition use, cache hit ratio and slot utilization.
  • Anomalies: every anomaly in the range, except ones marked "Not an anomaly".
  • Findings: every open finding of the connection, largest saving first.

The Export CSV button on Findings downloads the open findings as one CSV.

CSV format

UTF-8 with a byte-order mark (for Excel), a header row, and RFC 4180 quoting. A text cell that starts with =, +, -, @, tab, or carriage return gets a leading ', so a spreadsheet does not run it as a formula. SQL comments that start with -- are left as they are. Numbers have at most 8 decimals. A cell is cut at 32,767 characters, the Excel limit. Excel files (.xlsx) hold text as typed text and add no '.

On this page