API reference
Break down performance
curl "https://api.onsite.so/api/v1/sites/example.com/performance/queries" \ -H "Authorization: Bearer $ONSITE_API_KEY"Splits a period’s performance by search, page, country, device, bucket or page type, sorted and paged. Sort by clicks_change with order=asc to find what lost the most clicks.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Example
example.comThe site: its ID, its address in Onsite, its domain or its Search Console property, as List sites shows them.
Example
queriesWhat to break performance down by.
Query Parameters
Section titled “Query Parameters”The period: last_7d, last_14d, last_28d, last_3m, last_6m, last_12m, last_16m, this_month, last_month, last_quarter or year_to_date, or two dates like 2026-08-01..2026-08-31. Presets end on the latest day with complete data.
What to compare with: the same number of days just before (previous_period), the same days a year earlier with weekdays matched (previous_year), or nothing (none).
The Search Console search type.
Only searches matching this text. See query_match.
How query matches: contains, not_contains, exact or regex.
Only pages whose URL matches this text. See page_match.
How page matches: contains, not_contains, exact or regex.
Only these countries, comma-separated: ISO codes (usa, gb) or English names.
Only these devices, comma-separated: desktop, mobile, tablet.
Only branded or only non-branded searches, by the site’s branded terms.
Only searches ranking in this band: top3, top10, top20, or striking (positions 4 to 20).
Only searches in this bucket, by its name as Get a site lists it.
Only pages of this page type, by its name as Get a site lists it.
True: only searches phrased as a question.
What to sort by. clicks_change is the change in clicks in percent; position_change is places gained.
Sort direction: desc (biggest first) or asc.
Rows per page.
The page to get: page.nextCursor from the previous response. Leave it out for the first page, and keep the other parameters the same.
Responses
Section titled “Responses”OK
object
The site’s address, as Search Console names the property.
The dates the numbers cover, in the site’s Search Console time zone (Pacific Time).
object
First day of the period.
Last day of the period. Presets end on the latest day with complete data.
Number of days in the period.
The period compared with, or null when compare is none or Search Console no longer keeps those dates.
The dates the numbers cover, in the site’s Search Console time zone (Pacific Time).
object
First day of the period.
Last day of the period. Presets end on the latest day with complete data.
Number of days in the period.
The Search Console search type the numbers are for.
The filters applied, in the form Onsite’s Overview shows them.
Totals for the whole period.
object
Clicks from Google Search.
Times a page of the site was shown in Google Search.
The same numbers for the comparison period, or null without one.
object
Clicks from Google Search.
Times a page of the site was shown in Google Search.
How the period compares with the comparison period, or null without one.
object
One row each, in the order asked for.
object
What the row is about: the search, the page URL, the country, the device, the bucket or the page type.
For countries, the three-letter ISO code.
Clicks from Google Search.
Times a page of the site was shown in Google Search.
How the row compares with the comparison period. Left out without a comparison.
Where this page sits in the full list.
object
Rows in this response.
Rows across all pages.
Pass as cursor to get the next page, with the same other parameters. Null on the last page.
Example
{ "site": "https://example.com/", "period": { "from": "2026-09-30", "to": "2026-10-27", "days": 28 }, "comparison": { "from": "2026-09-30", "to": "2026-10-27", "days": 28 }, "searchType": "web", "filters": [ "brand:non-branded" ], "totals": { "clicks": 1840, "impressions": 96210, "ctr": 1.9, "position": 14.2, "previous": { "clicks": 1840, "impressions": 96210, "ctr": 1.9, "position": 14.2 }, "change": { "clicks": 12.4, "impressions": 3.1, "ctrPoints": 0.2, "positionPlaces": 1.3 } }, "rows": [ { "name": "running shoes", "code": "usa", "clicks": 1840, "impressions": 96210, "ctr": 1.9, "position": 14.2, "change": { "clicks": -8.5, "impressions": 2, "positionPlaces": -0.6 } } ], "page": { "shown": 25, "total": 140, "nextCursor": "p.3k9x1z" }}A parameter or body field isn’t valid. error.param names it.
object
object
What went wrong, as a stable word your code can check.
What went wrong, in a sentence a person can act on.
The parameter or body field at fault, when there is one.
The values it accepts, when there is a fixed set.
The closest allowed value, when the one sent looks like a typo.
Quote it to support to find this request.
Example
{ "error": { "code": "invalid_input", "message": "range must be last_7d, last_14d, last_28d, last_3m, last_6m, last_12m, last_16m, this_month, last_month, last_quarter, year_to_date, or a window like 2026-08-01..2026-08-31.", "param": "range", "didYouMean": "last_28d", "requestId": "E-7K2Q-M4XD" }}The API key is missing, wrong, expired or revoked.
object
object
What went wrong, as a stable word your code can check.
What went wrong, in a sentence a person can act on.
The parameter or body field at fault, when there is one.
The values it accepts, when there is a fixed set.
The closest allowed value, when the one sent looks like a typo.
Quote it to support to find this request.
Example
{ "error": { "code": "invalid_input", "message": "range must be last_7d, last_14d, last_28d, last_3m, last_6m, last_12m, last_16m, this_month, last_month, last_quarter, year_to_date, or a window like 2026-08-01..2026-08-31.", "param": "range", "didYouMean": "last_28d", "requestId": "E-7K2Q-M4XD" }}Your team needs an Onsite plan, or has used this month’s credits (exports only).
object
object
What went wrong, as a stable word your code can check.
What went wrong, in a sentence a person can act on.
The parameter or body field at fault, when there is one.
The values it accepts, when there is a fixed set.
The closest allowed value, when the one sent looks like a typo.
Quote it to support to find this request.
Example
{ "error": { "code": "invalid_input", "message": "range must be last_7d, last_14d, last_28d, last_3m, last_6m, last_12m, last_16m, this_month, last_month, last_quarter, year_to_date, or a window like 2026-08-01..2026-08-31.", "param": "range", "didYouMean": "last_28d", "requestId": "E-7K2Q-M4XD" }}The key can’t do this: it is limited to other sites, it can only read, or its owner’s role doesn’t allow it.
object
object
What went wrong, as a stable word your code can check.
What went wrong, in a sentence a person can act on.
The parameter or body field at fault, when there is one.
The values it accepts, when there is a fixed set.
The closest allowed value, when the one sent looks like a typo.
Quote it to support to find this request.
Example
{ "error": { "code": "invalid_input", "message": "range must be last_7d, last_14d, last_28d, last_3m, last_6m, last_12m, last_16m, this_month, last_month, last_quarter, year_to_date, or a window like 2026-08-01..2026-08-31.", "param": "range", "didYouMean": "last_28d", "requestId": "E-7K2Q-M4XD" }}The site, or the thing asked for on it, doesn’t exist or this key can’t read it.
object
object
What went wrong, as a stable word your code can check.
What went wrong, in a sentence a person can act on.
The parameter or body field at fault, when there is one.
The values it accepts, when there is a fixed set.
The closest allowed value, when the one sent looks like a typo.
Quote it to support to find this request.
Example
{ "error": { "code": "invalid_input", "message": "range must be last_7d, last_14d, last_28d, last_3m, last_6m, last_12m, last_16m, this_month, last_month, last_quarter, year_to_date, or a window like 2026-08-01..2026-08-31.", "param": "range", "didYouMean": "last_28d", "requestId": "E-7K2Q-M4XD" }}Too many requests for this key. Wait for the Retry-After header’s seconds.
object
object
What went wrong, as a stable word your code can check.
What went wrong, in a sentence a person can act on.
The parameter or body field at fault, when there is one.
The values it accepts, when there is a fixed set.
The closest allowed value, when the one sent looks like a typo.
Quote it to support to find this request.
Example
{ "error": { "code": "invalid_input", "message": "range must be last_7d, last_14d, last_28d, last_3m, last_6m, last_12m, last_16m, this_month, last_month, last_quarter, year_to_date, or a window like 2026-08-01..2026-08-31.", "param": "range", "didYouMean": "last_28d", "requestId": "E-7K2Q-M4XD" }}Onsite is down for maintenance, or new data arrived while reading. Try again after the Retry-After header’s seconds.
object
object
What went wrong, as a stable word your code can check.
What went wrong, in a sentence a person can act on.
The parameter or body field at fault, when there is one.
The values it accepts, when there is a fixed set.
The closest allowed value, when the one sent looks like a typo.
Quote it to support to find this request.
Example
{ "error": { "code": "invalid_input", "message": "range must be last_7d, last_14d, last_28d, last_3m, last_6m, last_12m, last_16m, this_month, last_month, last_quarter, year_to_date, or a window like 2026-08-01..2026-08-31.", "param": "range", "didYouMean": "last_28d", "requestId": "E-7K2Q-M4XD" }}