# Audience

> Setting SocialTap up for your user? Follow https://socialtap.dev/setup.md.

Schemas

Where an account's followers are: the countries of a sample of its followers, ranked, with each country's share, and the sample itself.

## Schema

Every endpoint below returns this object as `data`. The standard [`meta`](https://socialtap.dev/docs/reference/index.md#meta) comes with every response.

| Field | Type | Description |
| --- | --- | --- |
| `platform` | `string` | Platform ID (tiktok, …). |
| `id` | `string` | Platform-native ID of the account whose audience this is (equals account.id). |
| `url` | `string` (uri) | Canonical profile URL of the account (equals account.url). |
| `account` | `object` | The account whose audience this is. |
| `account.id` | `string` or `null` | Platform-native account ID; null when only the handle is known. |
| `account.username` | `string` or `null` | Handle without the @; null when the account has none. |
| `account.display_name` | `string` or `null` | Display name shown on the profile. |
| `account.url` | `string` (uri) or `null` | Canonical profile URL. |
| `account.avatar_url` | `string` (uri) or `null` | Profile picture URL. Platform CDN URLs can expire within hours. |
| `account.is_verified` | `boolean` or `null` | Platform verification badge; null where the platform has no badge. |
| `basis` | `string` | What the sample is drawn from: recent_followers, the account's newest followers in the order the platform lists them. New values may be added.<br>One of `recent_followers` |
| `countries` | `object[]` | Countries of the sampled accounts with a known country, most first (ties by code), counted over metrics.located_account_count accounts: the estimate of where the audience is. \[\] when none is known. |
| `countries[].country_code` | `string` | ISO 3166-1 alpha-2 country code, upper case. |
| `countries[].share` | `number` | Share of the located accounts in this country, as a fraction (0.25 = 25%): the estimate of this country's share of the audience. |
| `countries[].metrics` | `object` | The country's count in the sample. |
| `countries[].metrics.account_count` | `integer` | Sampled accounts located in this country. |
| `sample` | `object[]` | The sampled accounts, in the order the platform lists them, each with its country where known. |
| `sample[].account` | `object` | The sampled account. |
| `sample[].account.id` | `string` or `null` | Platform-native account ID; null when only the handle is known. |
| `sample[].account.username` | `string` or `null` | Handle without the @; null when the account has none. |
| `sample[].account.display_name` | `string` or `null` | Display name shown on the profile. |
| `sample[].account.url` | `string` (uri) or `null` | Canonical profile URL. |
| `sample[].account.avatar_url` | `string` (uri) or `null` | Profile picture URL. Platform CDN URLs can expire within hours. |
| `sample[].account.is_verified` | `boolean` or `null` | Platform verification badge; null where the platform has no badge. |
| `sample[].country_code` | `string` or `null` | ISO 3166-1 alpha-2 country the platform attributes to the account. Null for a private account, one with no public post, or a read that failed (meta.warnings has partial_data). |
| `metrics` | `object` | The sample's size and the account's audience size. |
| `metrics.follower_count` | `integer` or `null` | The account's followers, the audience the sample is drawn from; null when the platform does not state it. |
| `metrics.sampled_account_count` | `integer` | Accounts in the sample (sample\[\]). |
| `metrics.located_account_count` | `integer` | Sampled accounts whose country is known: the size of the sample countries\[\] is computed from. |
| `platform_specific` | `object` | Fields only this platform has, under its ID (platform_specific.\<platform>); each null when unknown. |
| `approximate_fields` | `string[]` | JSON paths of estimates: countries when the sample is smaller than the audience (its shares estimate the whole audience's from the sample). \[\] when the sample is every follower. |
| `unknown_fields` | `string[]` | JSON paths of lists whose \[\] means unknown, not none; countries and sample are always known, so always \[\]. |

## Item errors

Besides the [request-level errors](https://socialtap.dev/docs/errors/index.md) every endpoint can return, audience endpoints return:

| Code | HTTP | Retry | Meaning | What to do |
| --- | --- | --- | --- | --- |
| `not_found` | 404 | No | The item does not exist or was deleted. On GET /v1/requests/{id}/response: the response was not kept (details.reason says why). | Check the link or ID. Do not retry. |
| `private_or_unavailable` | 403 | No | The item exists but isn't public: it is private, age- or region-restricted, or needs a login. It shares 403 with forbidden, which is about the key: branch on the code. | Only public items can be fetched. Do not retry. |

## Endpoints

1 endpoint returns audiences on TikTok.

**TikTok1**

- [GETTikTok Audience API`/v1/tiktok/audience`](https://socialtap.dev/docs/reference/tiktok/audience/index.md)

---

[HTML version](https://socialtap.dev/resources/audience/) · [Docs index for AI agents](https://socialtap.dev/llms.txt) · [All docs in one file](https://socialtap.dev/llms-full.txt)
