API reference
Start an export
curl -X POST "https://api.onsite.so/api/v1/sites/example.com/exports" \ -H "Authorization: Bearer $ONSITE_API_KEY" \ -H "Content-Type: application/json" \ -d '{"dimension":"pages","format":"csv","from":"2026-10-14","to":"2026-10-14","search_type":"web"}'Starts a CSV or Excel export of every row for a period, split by search, page, country, bucket or page type. It runs in the background: check it with Get an export, then download it. Each export uses team credits, as in the app. Needs a key that can make changes.
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.
Request Bodyrequired
Section titled “Request Bodyrequired”object
What each row is.
Example
pagesCSV, or an Excel workbook.
Example
csvFirst day of the period, YYYY-MM-DD.
Example
2026-10-14Last day of the period, YYYY-MM-DD.
Example
2026-10-14The Search Console search type. Default web.
Example
webResponses
Section titled “Responses”OK
object
The export’s ID. Check it with Get an export.
Example
{ "id": "5b0c7e9a-1d2f-4e3a-8b4c-6d5e7f8a9b0c"}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" }}