Skip to content

Make your first API call

Start by listing your sites, then read the widgets on one site. These requests do not change your account.

Base URL

https://api.getsitecontrol.com/v1

In the Getsitecontrol admin, open API keys and create a key with view access to widgets. See Authentication & access. Keep the key in your local environment or secret manager as GSC_API_KEY.

curl --fail-with-body \
"https://api.getsitecontrol.com/v1/sites" \
-H "Authorization: Bearer $GSC_API_KEY" \
-H "GSC-Version: 2026-10-01"

A successful response contains an items array with the sites your key can access. If a site is missing, check the key’s access. Find the site you want and copy its id. Site-scoped operations use that value in the URL.

Here is an illustrative response with only the fields relevant to this step:

{
"items": [
{
"id": 123,
"name": "My store",
"url": "https://example.com"
}
],
"next_cursor": null
}

If next_cursor is not null, follow pagination to retrieve the remaining sites.

Replace 123 with the real site ID:

SITE_ID=123 # Replace with an id returned by GET /sites
curl --fail-with-body \
"https://api.getsitecontrol.com/v1/sites/$SITE_ID/widgets?limit=10" \
-H "Authorization: Bearer $GSC_API_KEY" \
-H "GSC-Version: 2026-10-01"

The response lists the widgets you can access. Use the List widgets reference to explore filters and response fields.

  • Send GSC-Version: 2026-10-01 to stay on the documented API version.
  • Treat IDs and cursors returned by the API as the source of truth.
  • Handle non-success HTTP responses before reading application data.
  • Record X-Request-Id when a request fails; it helps support investigate.