Get the usage breakdown
Returns what the workspace used and was charged over a period, in US cents at list price. Each call groups rows by one by value, day, platform or keyword, and always includes the totals. range reads the past UTC days up to today (30d by default). month reads one calendar month (YYYY-MM), which is what you match against a bill or a per-client margin. Keyword-days come from the daily run and mention charges from billed matches. So a deleted keyword keeps its charges in the keyword rows (keyword.removed), while its mention counts show 0. Each keyword carries the same numbers for the current month as stats.cost. totals.ledgerDebitCents is what the balance has been debited so far for the period's days. Mentions settle the morning after, so a period ending today is below totals.totalCents by the unsettled ones, and a finished month differs only by cumulative rounding. Rows come in pages (limit, offset, total). A workspace can call this 30 times a minute across all its keys and tokens.
Authorization
bearerAuth An API key from POST /v1/api-keys. Keys start with ref_.
In: header
Query Parameters
How to group the rows. day gives one row per UTC day, then platform, keyword (the default, used to work out margins), or group (the cost of a client or campaign).
"keyword"Value in
- "day"
- "platform"
- "keyword"
- "group"
How many UTC days back from today to read. One of 7d, 30d or 90d, 30d by default. Ignored when you send month.
Value in
- "7d"
- "30d"
- "90d"
A calendar month (YYYY-MM, UTC) to read instead of a range. It covers the month's first to last day, or up to today for the current month. A future month returns 400.
^\d{4}-(0[1-9]|1[0-2])$How many rows to return, from 1 to 500, 100 by default. Only by=keyword can need more than one page, since a period has at most 90 days and there are only a dozen platforms.
1 <= value <= 500100How many rows to skip.
0 <= value0Response Body
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/v1/usage/breakdown"{ "window": { "from": "string", "to": "string", "days": 0, "keywordDaysFrom": "string" }, "by": "day", "currency": "USD", "totals": { "keywordDays": 0, "keywordCents": 0, "matchedMentions": 0, "billableMentions": 0, "mentionCents": 0, "totalCents": 0, "unclassifiedMentions": 0, "ledgerDebitCents": 0, "unattributedBillable": 0 }, "data": [ { "key": "string", "label": "string", "keyword": { "id": "string", "term": "string", "removed": true }, "group": { "id": "string", "name": "string", "removed": true }, "keywordDays": 0, "keywordCents": 0, "matchedMentions": 0, "billableMentions": 0, "mentionCents": 0, "totalCents": 0 } ], "total": 0}Update a segment
Changes a segment's name, description or filter. A new filter replaces the old one completely.
Get usage and balance
Shows whether tracking is stopped or the balance is low. Also returns the prepaid balance (ledger total, pending mention charges, and the effective balance that decides pausing), daily spend and days left, running and paused keywords, and matches today and over 30 days. Pricing is $0.008 per matched mention, relevant or not, and $5 a month per active keyword, charged daily.