<!-- https://developers.silktide.com/v1/presence/brands/get-brands | Presence / Brands -->

# List the brands Presence tracks, yours and your competitors'

`GET /v1/results/accounts/presence/brands/table`

Lists the brands you track: your own, and the competitors they are compared with. With `marketId` it lists one market's brands, as that market sees them: a brand can be yours in one market and a competitor in another.

`mentionedIn` and the other counts are of all time, and take no dates. For how often a brand is named over some dates, [Get prompts](https://developers.silktide.com/v1/presence/setup/get-prompts.md) has a percentage per prompt, and [List answers](https://developers.silktide.com/v1/presence/answers/get-responses.md) takes `brands`.

Your own brands come first, then primary, secondary and watched ones, whatever `sort` says. `search` matches the name and the web address.

## Request

### Query parameters

- `workspaceId` (integer, required, at least 1): Where the account's markets live. [Get the workspace](https://developers.silktide.com/v1/presence/setup/get-workspace.md) answers with it.
- `marketId` (integer, optional, at least 1): Only this market: the number after `/presence/` in the market's address in Silktide. Left out, every market the API key's user can see.
- `columns` (string, optional): The columns to return, comma-separated, such as `url,pageViews`. Left out, the table's default columns. Send a string even in a JSON body: an array is ignored.
- `sort` (string, optional): The column to sort by, then `:a` for ascending or `:d` for descending, such as `pageViews:d`. Left out, the table's own order.
- `search` (string, optional): Only rows matching this text. What it searches depends on the table, most often the URL or title.
- `page` (integer, optional, at least 1): The page of rows to return, from `1`. Defaults to `1`.
- `rowsPerPage` (integer, optional, at least 1): How many rows a page holds. Defaults to `100`.
- `criteria` (string, optional): Filters on the table's columns, as `column:value`, joined with `;`. `status` takes `active` (the default) or `deleted`, such as `status:deleted`.

## Response

Status `200`.

- `result` (object, required): The answer.
  - `page` (integer, required, at least 1): The page returned. Not always the page asked for, when that was out of range.
  - `minPage` (integer, required, at least 1): The first page. Always `1`.
  - `maxPage` (integer, required): The last page at this `rowsPerPage`. With no rows, `0` or `1` depending on the table.
  - `numRows` (integer, required): How many rows there are across every page.
  - `rowsPerPage` (integer, required, at least 1): How many rows a page holds.
  - `rows` (list of objects, required): The rows on this page.
    - `brandId` (integer, required, at least 1): The brand.
    - `name` (string, required): The brand's name.
    - `names` (string, required, can be null): Every name it is recognized by, comma-separated. Null when it has none yet.
    - `url` (string, required): Its main web address. Empty when none is set.
    - `owned` (boolean, required): Whether it is one of your own brands.
    - `classification` (string, required): `owned` for your own brands, or how closely a competitor is followed: `primary`, `secondary` or `watched`. One of: `owned`, `primary`, `secondary`, `watched`.
    - `tier` (string, required): How closely the brand is followed. With `marketId`, its tier in that market, and empty for your own brands there. One of: `primary`, `secondary`, `watched`.
    - `mentionedIn` (integer, required): Answers that name it, of all time.
    - `updated` (integer, required): When the brand was last changed.
    - `created` (integer, optional): When the brand was added. Only when `columns` names it.
    - `assistants` (integer, optional): How many assistants have named it. Only when `columns` names it.
    - `prompts` (integer, optional): How many prompts' answers have named it. Only when `columns` names it.
    - `lastSeen` (integer, optional, can be null): When it was last named. Null when it never has been. Only when `columns` names it.
- `selector` (string, required): The query that answered, as its path: `/v1/results/scores`.
- `duration` (number, required): Seconds Silktide took to answer.

## Errors

| Status | Type | When |
| --- | --- | --- |
| 200 | `EditionNotAvailable` | The account does not have Silktide 5. Its `status` is `403`. The body is an error despite the status. |
| 200 | `Runtime` | No `workspaceId` was sent. Its `status` is `500`, and its message does not say why. The body is an error despite the status. |
| 200 | `AccessDenied` | No such workspace or market exists in the account, or the API key's user cannot see it. Its `status` is `403`. The body is an error despite the status. |
| 401 | `NotLoggedIn` | No API key was sent, or it is not a key for this region. |
| 429 | `TooManyRequests` | Too many requests to this path in five seconds. Retry after the number of seconds in the `Retry-After` header, which `properties.retryAfter` repeats. |
| 503 | - | Silktide is busy. Retry after the number of seconds in the `Retry-After` header. |

## Access

- Permission: Can see this market
- Plan feature: none
- Edition: Silktide 5 only
- Cost: free
- Stability: stable, since 1.2.0

## Example: Every tracked brand, with when it was last named

```bash
curl "https://api.eu.silktide.com/v1/results/accounts/presence/brands/table?workspaceId=1&columns=name%2Cnames%2Ctier%2CmentionedIn%2ClastSeen" \
  -H "Authorization: silktide token=$SILKTIDE_API_KEY"
```

Response:

```json
{
  "result": {
    "page": 1,
    "minPage": 1,
    "maxPage": 1,
    "numRows": 2,
    "rowsPerPage": 100,
    "rows": [
      {
        "brandId": 4,
        "name": "Fake Wine Barrel",
        "names": "Fake Wine Barrel,FWB",
        "url": "https://fakewinebarrel.com",
        "owned": true,
        "classification": "owned",
        "tier": "primary",
        "mentionedIn": 4703,
        "updated": 1793610000,
        "lastSeen": 1793610000
      },
      {
        "brandId": 5,
        "name": "Oakmoor Cooperage",
        "names": "Oakmoor,Oakmoor Cooperage",
        "url": "https://oakmoor.example",
        "owned": false,
        "classification": "primary",
        "tier": "primary",
        "mentionedIn": 3876,
        "updated": 1793610000,
        "lastSeen": 1793610000
      }
    ]
  },
  "selector": "/v1/results/accounts/presence/brands/table",
  "duration": 1.2
}
```
