Skip to Content
socialdata

Errors

Each error code, its HTTP status, and what a caller does about it.

An error body has these fields:

FieldMeaning
codeThe error code, from the table below
messageWhat went wrong, for a person or an agent to read
retryabletrue when the same call can succeed later
trace_idThe id of the call. Quote it when you report a problem
credits_spentThe credits that the call spent before it failed

Some codes add fields. Over MCP, the tool result has isError: true, and its structured content is the same body.

Codes

CodeStatusExtra fieldsWhat to do
invalid_ref400Fix the ref. Name an account or a post gives the forms
unsupported_platform400Send a ref of one of the eight platforms
unsupported_media_type400media_typeDo not retry. The post is a long video, and socialdata covers short-form video only
invalid_argument400fieldFix the argument that field names. message says what is wrong
sql_rejected400Send one SELECT statement, with no SETTINGS clause
sql_too_large400Make the query read fewer rows or less data, or use less memory
unauthorized401Send the API key of an organization in x-api-key
forbidden403Use an organization that may track. Over MCP, authorize again and choose an organization
not_found404targetDo not retry. The platform says that the account or the post does not exist
not_stored404targetCall lookup first. For a watchlist, check its name
private404targetDo not retry. The account or the post is private
restricted404targetDo not retry. The platform restricts the account or the post
sql_timeout408Make the query cheaper, then retry
ambiguous_handle409candidatesChoose one of candidates and send its id
rate_limited429retry_after_sWait retry_after_s seconds, then retry
budget_exceeded429limit, resets_atWait until resets_at. Credits and limits explains limit
not_implemented501Do not retry. The operation is not built yet
upstream_failed502Retry when retryable is true. The platform or the data provider failed, or its answer could not be read
search_unavailable503Retry later. Only search_posts and search_accounts use the search index

The reference page of each tool lists the codes that the tool can answer.

Retry

Retry only when retryable is true:

  • After rate_limited, wait retry_after_s seconds.
  • After budget_exceeded, wait until resets_at.
  • After upstream_failed, search_unavailable, or sql_timeout, wait a few seconds and retry once or twice.

A failed call never costs more than credits_spent says.

On this page