---
name: socialdata
description: Search, look up, and track social media accounts and posts on Instagram, TikTok, YouTube, Threads, Facebook, X, LinkedIn, and Snapchat with the socialdata API or its MCP server. Use when a task needs the counts, captions, transcripts, growth, or history of social accounts and posts.
---

# socialdata

socialdata answers questions about social media accounts and posts. It keeps every measurement it takes, so it can show history and growth, not only the current numbers.

## Connect

- MCP: add the server `https://api.socialdata.product.studio/mcp` (Streamable HTTP). The client signs in through OAuth in a browser.
- HTTP: send `x-api-key: <your key>` to `https://api.socialdata.product.studio/v1/...`. JSON in, JSON out.

The MCP tools and the HTTP endpoints are the same ten tools, with the same inputs and answers.

## Rules

1. Name an account or a post with a link, `platform:@handle`, or an id (`platform:account:ID`, `platform:post:ID`). The history tools and `untrack` take only ids: get one from `lookup` or a search first.
2. Prefer `search_posts` and `search_accounts` to find items, and `lookup` for one item you can name. Only `lookup` and `track` can cost credits. Check `meta.credits_spent` and `meta.credits_left_today`.
3. Do not set `max_age_s` unless the task needs fresh numbers. Without it, `lookup` answers from data that socialdata already holds, for 0 credits.
4. Read the freshness fields before you compare numbers: `observed_at` says when counts were read, `synced_at` says when a search row was updated, and `meta.as_of` bounds the whole answer.
5. A null count means the platform does not show it. It is not 0.
6. Page with `next_cursor`: pass it as `cursor` until it is null.
7. On an error, read `code` and `retryable`. Wait `retry_after_s` after `rate_limited`. Call `lookup` after `not_stored`. Choose one of `candidates` after `ambiguous_handle`. Do not retry `not_found`, `private`, or `restricted`.
8. One API key may send 120 requests a minute.

## Common tasks

- Current numbers of one account or post: `lookup` with its link.
- Growth of an account over time: `lookup` (to get the id), then `account_history`.
- Top posts about a topic this week: `search_posts` with `q` and sort by `view_count_gained_7d`.
- Fastest-growing accounts in a watchlist: `search_accounts` with `watchlist` and sort by `follower_count_change_30d`.
- Follow accounts over time: `track` into a watchlist, then read with the search tools or `watchlist_items`.

## Tool notes

- lookup: an item that socialdata has never seen costs up to 2 credits. `max_age_s` makes it read the platform again when the stored data is older. A long YouTube video fails with `unsupported_media_type` after 1 credit.
- account_history, post_history: take an id. `from` and `to` default to the last 30 days. `grain: "hour"` allows at most 14 days. `post_history` returns at most the newest 1,000 measurements. `not_stored` means: call lookup first.
- search_posts, search_accounts: up to 100 results a page. `relevance` sorting needs `q`. A row whose value is unknown sorts last and never passes a filter. Results can be a few minutes behind lookup.
- track: a new watchlist name creates the watchlist. A post link tracks the post, not its author. A post is measured until 30 days after it was posted. Each ref has an outcome: added, already_in_watchlist, pending, or refused with `error_code`. Needs `can_track` from watchlists, else `forbidden`.
- untrack: the history stays readable. `is_still_polled` says whether another watchlist still lists the item.
- sql: one SELECT, at most 1,000 rows, 10 seconds, and 10,000,000 rows read. Filter on platform and platform_account_id.

## Tools

### lookup

`POST https://api.socialdata.product.studio/v1/lookup`

Returns the current counts, profile or caption, and growth of one account or post that you name by a link, a handle, or an id. Use it when you can name the item, and use search_posts or search_accounts to find items you cannot name.

### account_history

`GET https://api.socialdata.product.studio/v1/accounts/{account}/history`

Returns the followers, posts, likes, and views of one account per hour or per day, and its past handles, names, and biographies. Use it for growth over a date range, and lookup for the current numbers.

### post_history

`GET https://api.socialdata.product.studio/v1/posts/{post}/history`

Returns the views, likes, comments, shares, and saves of one post at each measurement, every version of its caption, and the post's ids, link, and availability. Use it to see how a post grew, and lookup for its current numbers.

### search_posts

`POST https://api.socialdata.product.studio/v1/posts/search`

Returns the posts that socialdata holds whose caption, hashtags, or video match your words, filtered and sorted by any count or gain. Use it to find or rank posts, and lookup for one post you can name.

### search_accounts

`POST https://api.socialdata.product.studio/v1/accounts/search`

Returns the accounts that socialdata holds whose handle, name, or biography match your words, filtered and sorted by any count or growth. Use it to find or rank accounts, and lookup for one account you can name.

### watchlists

`GET https://api.socialdata.product.studio/v1/watchlists`

Returns each watchlist with how many accounts and posts it holds, and whether your organization may track. Use it to find the names that the other watchlist tools take.

### watchlist_items

`GET https://api.socialdata.product.studio/v1/watchlists/{name}/items`

Returns each item with its id and the state of its updates, newest first. Use it to see what a watchlist holds, and the search tools with watchlist to rank its items.

### track

`POST https://api.socialdata.product.studio/v1/watchlists/{name}/items`

Adds 1 to 100 accounts or posts to a watchlist, and creates the watchlist when the name is new, so that socialdata measures them on a schedule. Each ref gets its own outcome in results.

### untrack

`DELETE https://api.socialdata.product.studio/v1/watchlists/{name}/items/{item}`

Removes one item by its id, and its history stays readable. Use watchlist_items to find the id.

### sql

`POST https://api.socialdata.product.studio/v1/sql`

Runs one SELECT over socialdata's data and returns up to 1,000 rows. Use it only when no other tool answers the question, such as an aggregate over many accounts.

## More

The full docs: `/llms-full.txt` on the docs site. Error codes: `/docs/errors`.
