Skip to Content
socialdata

Give an agent socialdata

Connect an agent, give it rules, and the tool sequences for common tasks.

An agent can reach socialdata in three ways. Use one or more of them:

WayUse it when
The MCP serverThe agent runs in an MCP client, such as Claude Code, Cursor, or Codex
The agent skillThe agent reads skills. The skill tells it when and how to use socialdata
/llms-full.txtThe agent reads docs as text. Each page is also at its URL plus .md, and /llms.txt lists them

Rules for the agent

Copy these rules into the instructions of your agent, such as AGENTS.md or CLAUDE.md:

## socialdata

- Name an account or a post with a link, `platform:@handle`, or an id
  (`platform:account:ID`, `platform:post:ID`). `account_history`, `post_history`,
  and `untrack` take only ids: get one from `lookup` or a search first.
- To find items, use `search_posts` and `search_accounts`. They cost 0 credits.
  Use `lookup` for one item that you can name.
- Only `lookup` and `track` can cost credits. Check `meta.credits_spent` and
  `meta.credits_left_today` in each answer.
- Do not set `max_age_s` unless the task needs fresh numbers.
- Before you compare numbers, read `observed_at`. A null count is unknown, not 0.
- Page with `next_cursor`: pass it as `cursor` until it is null.
- On an error, read `code` and `retryable`. Do not retry `not_found`,
  `private`, or `restricted`.

Common tasks

TaskTools, in order
The current numbers of one account or postlookup with its link
The growth of an accountlookup to get the id, then account_history
How a post grew after it was postedlookup to get the id, then post_history
The top posts about a topic this weeksearch_posts with q and sort: [{"field": "view_count_gained_7d"}]
The posts of one accountsearch_posts with account
The fastest-growing accounts in a watchlistsearch_accounts with watchlist and sort: [{"field": "follower_count_change_30d"}]
Follow accounts or posts over timetrack into a watchlist, then watchlist_items or the search tools with watchlist
Stop following an itemwatchlist_items to get its id, then untrack
A question that no other tool answerssql

Notes per tool

  • 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 and post_history. They take an id, never a handle or a link. An item that socialdata has never seen fails with not_stored: call lookup first.
  • search_posts and search_accounts. Up to 100 results a page. relevance sorting needs q, and a row whose value is unknown sorts last and never passes a filter. Results can be a few minutes behind lookup, and synced_at gives the time of each row.
  • track. Read results: each ref gets its own outcome. Track accounts and posts explains them.
  • sql. One SELECT, at most 1,000 rows, 10 seconds, and 10,000,000 rows read. Filter on platform and platform_account_id to stay inside the limits.

Freshness

socialdata measures tracked accounts and posts on a schedule. A post is measured about every 4 hours in its first 3 days, about every 12 hours until it is 14 days old, then about once a day. A tracked post is measured until 30 days after it was posted. socialdata measures a tracked account as often as it posts, or at the fixed interval_s (at least 900 seconds) that you give track.

An agent that needs a number from the last hour calls lookup with max_age_s: 3600. That call can cost credits. Read an answer explains the freshness fields.

History

account_history returns 30 days by default. With grain: "hour", the range can be at most 14 days. With grain: "day", it can be at most 3,660 days. post_history returns at most the 1,000 newest measurements of a post.

Limits and errors

  • One API key can send 120 requests a minute.
  • Your organization has a daily credit limit. Credits and limits says what costs credits.
  • Errors lists each code and what an agent does about it.

On this page