Skip to main content
This page takes you from an API key to two successful calls: listing the organisations your key can reach, then reading a rollup of every own brand in one of them.

Before you start

You need an API key. If you do not have one, see Get a key. Export the key as an environment variable. Every sample in these docs reads it from SURFAIS_API_KEY.
The samples use cURL, Python 3 with requests, and Node.js 18 or later, which has fetch built in. Run them from a server or your own machine — the API does not accept calls from a browser.
1

List the organisations your key can reach

Call GET /orgs.
With an organisation key, the response holds exactly one organisation:
Response
  • data holds the payload. Here it is a list, so pagination comes with it.
  • pagination appears on every list. has_more: false with next_cursor: null means this is the last page. When has_more is true, pass next_cursor back as ?cursor= to read the next page — see Pagination.
  • link_scope: "owner" means you are using an organisation key. A partner key returns one item per linked organisation, with link_scope set to read_only or read_write, and external_ref set to your own id for that organisation if you have stored one.
  • tier is the identifier of the organisation’s plan, in lower case (scale here). Treat it as an open string rather than a fixed list.
Copy the organisation’s id. Every endpoint that reads or changes an organisation’s data sits under /orgs/{orgId}.
2

Get a one-call rollup of every own brand

Call GET /orgs/{orgId}/brands/summary. It returns one item per own brand, leaving out archived brands.
Response
  • latest and previous are the brand’s two most recent score points. score is the AIS Score out of 100 on that date. latest is null until the brand has been scored, and previous is null until there is an earlier point. A brand with no scores yet reports null, never 0.
  • delta is latest.score minus previous.score, to one decimal place. It is null when either score is missing. It is also null when the two scores are not comparable, because they were produced by different scoring models (score_version) or measured over different sets of AI models (panel_version). delta_reason then names the case. Do not subtract the scores yourself across a version change — see Data model.
  • avg_sentiment is the mean sentiment of the brand’s mentions on the latest date, from 0 to 100. sov is the brand’s share of voice on that date, as a percentage: its mentions divided by its own plus its tracked competitors’ mentions. sov is null when nothing was mentioned.
  • last_scan_at is when the brand’s latest scan was finalised. changed_at is a change token: it moves whenever something this endpoint reports can have changed — a scan being finalised or removed, the brand or one of its competitors being edited, or the organisation’s scan schedule changing. Poll changed_at, not last_scan_at, to decide when to read again.
There is no organisation-wide score. If you need one, aggregate the brands yourself.
3

Check your limits

Every successful response tells you where your key stands against its per-minute rate limit, and carries an id for the request.Print them for your key:
Limits are set per key, so read them from these headers rather than hard-coding a number. Over the limit, the API answers 429 rate_limited with a Retry-After header: wait that many seconds, then retry. A key can also carry a monthly quota, which answers 429 quota_exceeded once it is used up. See Rate limits.Rate limits count requests. Your plan’s tracking caps — active prompts, own brands and countries — are separate: read them, with current usage, from usage on GET /orgs/{orgId}.

If a call fails

Every error uses one envelope. Switch on error.code, never on message.
Errors lists every code.

Next steps

  • Authentication — organisation and partner keys, scopes, and the write rule.
  • Pagination — walk a list to the end, and how date windows work.
  • Provision a property — create an own brand with its competitors. Needs write access.
  • Sync a brand’s prompts — send the prompt set you want and let the API work out the changes. Needs write access.
  • Request a scan — start an on-demand scan and wait for the results. Needs write access.
  • Export results — pull results and mentions into your own store.
  • Webhooks — for platform partners: signed events when a scan completes.