API

Query your mentions programmatically using the BrandSonar REST API.

Creating an API key

Go to Settings → API and click Create key. Give it an optional name (e.g. “Production” or “CI/CD”) and click Create key.

The full key is shown only once, so copy it and store it somewhere safe. If you lose it, revoke the old key and create a new one.

You can create as many keys as you need. Each key is scoped to the organisation it was created in.

Authentication

Every request must include your API key as a Bearer token in the Authorization header:

Authorization: Bearer bs_your_key_here

Endpoints

GET /api/v1/mentions/:brand_id

Returns a paginated list of processed mentions for a brand.

Query parameters

ParameterTypeDescription
platformstringFilter by platform. One of twitter, reddit, youtube, hackernews, or bluesky.
min_score0–100Minimum relevance score. Defaults to 65.
limit1–100Number of results per page. Defaults to 50.
offsetnumberNumber of results to skip for pagination. Defaults to 0.

Example request

curl "https://app.brandsonar.com/api/v1/mentions/YOUR_BRAND_ID?limit=10" \
  -H "Authorization: Bearer bs_your_key_here"

Example response

{
  "data": [
    {
      "id": "01965a3b-...",
      "brandId": "01960c7e-...",
      "platform": "twitter",
      "sourceUrl": "https://x.com/user/status/...",
      "title": null,
      "content": "Just tried @acme and it's amazing...",
      "authorName": "Jane Doe",
      "authorUsername": "janedoe",
      "sentiment": "positive",
      "relevanceScore": 88,
      "publishedAt": "2026-03-15T14:30:00.000Z",
      "createdAt": "2026-03-15T15:01:12.000Z"
    }
  ],
  "total": 342,
  "limit": 10,
  "offset": 0,
  "hasMore": true
}

Response fields

FieldTypeDescription
iduuidUnique mention ID.
brandIduuidThe brand this mention belongs to.
platformenumOne of twitter, reddit, youtube, hackernews, or bluesky.
sourceUrlstring | nullLink to the original post.
titlestring | nullTitle or headline (available for some platforms).
contentstring | nullFull text of the mention.
authorNamestring | nullAuthor's display name.
authorUsernamestring | nullAuthor's handle or username.
sentimentstring | nullOne of positive, negative, or neutral.
relevanceScorenumberAI-determined relevance score from 0 to 100.
publishedAtISO 8601When the mention was originally published.
createdAtISO 8601When BrandSonar imported the mention.

Pagination

The response includes total, limit, offset, and hasMore. To fetch the next page, increment offset by limit:

GET /api/v1/mentions/:brand_id?limit=50&offset=50

Errors

The API returns standard HTTP status codes. Error responses include a JSON body with an error message:

StatusMeaning
400Invalid query parameter (e.g. unrecognised platform value).
401Missing or invalid API key.
404Brand not found (wrong brand_id or not in your organisation).