GET /usage
Read your organization's Web Access fetches, searches, browser sessions and spend with an API key, by day or hour.
Returns your organization's Web Access usage over a window you choose: fetches and searches with their successes, failures and spend, and browser sessions with theirs, in total and for every day or hour, plus your top 50 domains with how their requests were billed. Use it to pull usage into your own reporting on a schedule, with an API key instead of a portal sign-in.
GET https://request.usestring.ai/v1/usageAuthenticate with a Web Access API key that has the usage scope, as a
Bearer token. Every key has it unless it was created with scopes that leave it out.
The figures always cover the organization that owns the key, across all its keys. Reads are free and work with no
balance left.
Query parameters
| Field | Type | Default | Description |
|---|---|---|---|
start | date or datetime | — | Required. Start of the window. |
end | date or datetime | now | End of the window, exclusive. |
granularity | string | day | day or hour. |
domain | string | — | Only requests to this exact domain, as domains[].domain lists it (1–253 characters). |
A date such as 2026-11-01 is midnight UTC. A datetime must carry Z or an offset, such as 2026-11-01T09:00:00Z;
URL-encode a + offset as %2B. start rounds down and end rounds up to a whole UTC day or hour, and the window can
span at most 31 days. With the default end, the last day or hour is still in progress. Any other parameter is
rejected with a 400.
Example request
Usage for November 2026, by day:
curl --get 'https://request.usestring.ai/v1/usage' \
--header "Authorization: Bearer $STRING_API_KEY" \
--data-urlencode 'start=2026-11-01' \
--data-urlencode 'end=2026-12-01' \
--data-urlencode 'granularity=day'Response
A 200, with the lists trimmed:
{
"start": "2026-11-01T00:00:00Z",
"end": "2026-12-01T00:00:00Z",
"granularity": "day",
"total": {
"fetch": { "requests": 176412, "successes": 173296, "failures": 3116, "spend": 398.45 },
"search": { "requests": 5928, "successes": 5725, "failures": 203, "spend": 6.87 },
"browser": { "sessions": 214, "spend": 7.05 },
"spend": 412.37
},
"days": [
{
"date": "2026-11-01",
"fetch": { "requests": 5751, "successes": 5653, "failures": 98, "spend": 12.71 },
"search": { "requests": 200, "successes": 194, "failures": 6, "spend": 0.23 },
"browser": { "sessions": 7, "spend": 0.18 },
"spend": 13.12
}
],
"domains": [
{
"domain": "example.com",
"requests": 120400,
"successes": 118950,
"failures": 1450,
"spend": 64.55,
"billing": {
"request_standard": { "requests": 104200, "spend": 26.05 },
"request_premium": { "requests": 15800, "spend": 37.92 },
"browser_premium": { "requests": 120, "spend": 0.58 },
"not_billed": { "requests": 280, "spend": 0 }
}
},
{
"domain": "www.google.com",
"requests": 5928,
"successes": 5725,
"failures": 203,
"spend": 6.87,
"billing": {
"search": { "requests": 5725, "spend": 6.87 },
"not_billed": { "requests": 203, "spend": 0 }
}
}
]
}| Field | Description |
|---|---|
start, end | The window the figures cover, in UTC, after rounding. end is exclusive. |
granularity | day or hour, as requested. |
total | The whole window's fetch, search, browser and spend, described below. |
days | One entry for every UTC day of the window, by date, with the same fields as total. A day with no usage reads as zero. |
hours | With granularity=hour, in place of days: one entry for every hour, by hour, such as 2026-11-01T09:00:00Z. |
domains | Up to 50 destination domains by requests, each with its requests, successes, failures and spend, and the same requests and spend by billed type in billing. Site integration calls are listed as Site integration: <site>. |
total and each day or hour have:
| Field | Description |
|---|---|
fetch | Your fetches, including browser-based fetches and site integration calls: requests, successes, failures and spend. |
search | Your searches, with the same fields. |
browser | Your browser sessions: sessions and spend. null when you pass domain, since a session has no single domain. |
spend | The total of the three. |
billing lists only the types a domain used:
| Type | Billed as |
|---|---|
request_standard, request_premium | A request-based fetch on a standard or premium proxy |
browser_standard, browser_premium | A browser-based fetch on a standard or premium proxy |
search | A search |
site_integration | A site integration call |
not_billed | Not billed, such as a request that failed |
unrecorded | No type was recorded, as on requests from before billing recorded one |
- Spend is in USD. See Pricing for the rates.
- A request counts once, however many times it was retried, and
failuresare the requests that did not succeed. - A type can show spend with no requests: each billed attempt of a retried request counts toward its spend, while the request itself counts once, under its last attempt's type.
- With
domain, only that domain's fetches and searches count.
Errors
| Status | Meaning | Retry |
|---|---|---|
400 | A parameter is missing, invalid or unknown, or the window is longer than 31 days. | After correcting the request |
401 | No usable API key: code is missing_api_key, invalid_api_key or key_expired. | After correcting the key |
403 | The key doesn't have the usage scope: code is key_scope_missing. | With a key that has it |
429 | Over the usage limit (limit: "usage") or your organization's request rate (limit: "org_rate"). | After the Retry-After header's seconds |
500 | The figures could not be read. | Yes |
None of them is billed. A 400 lists each problem in issues:
{
"error": "Validation error",
"message": "The window can span at most 31 days",
"issues": [{ "field": "end", "message": "The window can span at most 31 days" }]
}A 429 from the usage limit:
{
"error": "Rate limit exceeded",
"limit": "usage",
"code": "usage_rate_limited",
"message": "Usage reads are limited to 1 a second per organization. Retry in 1 second.",
"retryable": true,
"retry_after_seconds": 1,
"next_actions": [{ "type": "docs", "url": "https://docs.usestring.ai/api-reference/rate-limits" }]
}A 500:
{ "error": "Internal Server Error", "message": "Usage is unavailable" }Limits
An organization can read usage once a second, across all its keys. A faster read returns 429 with limit: "usage";
retry after the Retry-After header's seconds. Each read also counts toward your organization's
request rate.