Skip to content
Open Onsite

Get started

Onsite API

Read your Onsite numbers from your own scripts, dashboards and tools, and make everyday changes like tracking keywords or resolving alerts.

The Onsite API gives your code the same numbers you see in Onsite: Search Console clicks and searches, insights, rank tracking, indexing, alerts and Google Analytics. Ask for the same site, period and filters as in the app and you get the same answer.

It covers what you do in Onsite most days. You can read every report, track and untrack keywords, resolve or reopen alerts, add chart notes and start exports.

Every endpoint lives under one address. All requests use HTTPS and answer in JSON.

https://api.onsite.so/api/v1
  1. Create a key

    In Onsite, open Settings › API keys, select Create key, give it a name and copy it. Onsite shows the key once.

  2. Save it where your code can read it

    Keep the key out of your code and out of version control. An environment variable works well:

    Terminal window
    export ONSITE_API_KEY="oapi_..."
  3. List your sites

    Terminal window
    curl "https://api.onsite.so/api/v1/sites" \
    -H "Authorization: Bearer $ONSITE_API_KEY"
  4. Read a site's performance

    Use any site from the list, by its domain or its ID:

    Terminal window
    curl "https://api.onsite.so/api/v1/sites/example.com/performance?range=last_28d" \
    -H "Authorization: Bearer $ONSITE_API_KEY"

The sites request answers with the sites your key can read, and where the page sits in the full list:

{
"sites": [
{
"id": "0f8e6c2a-4a8f-4d7e-9b1e-5c3d2a1b0e9f",
"site": "https://example.com/",
"address": "example-com",
"property": "sc-domain:example.com",
"group": "owned",
"status": "active",
"connected": { "analytics": true, "bing": false }
}
],
"page": { "shown": 1, "total": 1, "nextCursor": null }
}

If you get an error instead, its message says what to change. Errors lists every kind.

  • Sites. Every endpoint that reads one site takes it in the path. Use its domain (example.com), its address in Onsite (example-com), its Search Console property or its ID, as List sites shows them.
  • Periods. Reports take a range, such as last_28d or 2026-08-01..2026-08-31, and most take compare. They match the date picker in Onsite.
  • Lists. Long lists come a page at a time. Pagination shows how to get the rest.
  • Changes. Requests that change something use POST, PATCH or DELETE, and only work with a key that has Can make changes turned on.
  • Field names are the same in every response: clicks, impressions, ctr (in percent) and position.