How should AI agents get social data?

AI agents should get social data from a documented API they can discover, sign in to safely and read clear outcomes from. They need the same public profiles, posts and transcripts as any integration, but they also need to branch on structured results, find real endpoints and authenticate without leaking keys. Social Fetch covers this with clear lookup outcomes, discovery files, an MCP server with OAuth and a typed REST API.

Glossary · Agents

What makes an API agent-friendly

Clear outcomes: every lookup on an HTTP 200 says whether the account was found, not found or private, so the agent doesn't have to guess from status codes or prose.

Discoverability: /llms.txt, /agents.txt, /llms-endpoints.txt, /openapi.json and skill.md tell an agent what exists. It should read them before guessing endpoints.

Every response shows the credits it used and a request ID, so costs are visible and support can trace any call.

How an agent connects, without leaking a key

Interactive agents such as Claude and Cursor connect to the hosted MCP server at https://api.socialfetch.dev/mcp and sign in with OAuth. If the client can't complete OAuth, send x-api-key with the key read from an environment variable.

Production backends and CI keep the API key in server environment variables and call the REST API or the @socialfetch/sdk package.

MCP tools are named {platform}_{resource}_{action}, and the catalog covers 87 platforms and about 1112 operations.

Discovery files and zero-cost routing

The docs_search and docs_read tools on MCP are free. nl_ask_post (or POST /v1/ask) turns plain English into the right endpoint for 0 credits, and the lookup it runs is billed as usual.

Use routing once to find the endpoint, then call that tool or endpoint directly for repeat calls.

A concrete agent workflow

The agent asks nl_ask_post a question, which routes to tiktok_profile_videos_list and returns the first results. It checks that the profile was found before using the data, then switches to the typed tool to run through a batch of handles. If a summary looks wrong, the logged request ID lets support trace it.

Common mistakes agents make

Inventing endpoints. Read /llms.txt or call docs_search first.

Checking only the HTTP status. A 200 with a not-found result is a finished answer with no data to act on.

Retrying not-found results, which are charged again. Only retry lookups that failed on our side or temporarily-unavailable responses.

Putting a plain-text API key in a shared MCP config. Use OAuth, or set an x-api-key header that reads the key from an environment variable.

Boundaries for agents

Agents get public content only. Private accounts and content behind a login are out of scope.

A production agent that scrapes HTML breaks every time a page layout changes. Documented endpoints keep billing, errors and request IDs in one place. You get 100 free credits when you sign up to test the whole flow.

Questions. Short answers.

How do I connect an AI agent to social media data?

For interactive clients, connect to Social Fetch's MCP server and sign in with OAuth, or send an API key in the x-api-key header if the client never prompts. For backend and batch work, use the REST API or SDK with your API key.

Can Claude or Cursor call a social media API directly?

Yes, through Social Fetch's hosted MCP server at https://api.socialfetch.dev/mcp. Sign in with OAuth once and the agent can call typed tools such as tiktok_profile_get.

How does an agent avoid inventing endpoints that don't exist?

It reads /llms.txt, /llms-endpoints.txt or /openapi.json, or calls the free docs_search and docs_read tools on Social Fetch's MCP server.

What is nl_ask_post and when should an agent use it?

It's Social Fetch's plain-English routing tool, and the routing costs 0 credits. Use it when the agent doesn't know which endpoint to call, then switch to the typed tool for repeat calls.

Why check lookupStatus instead of just the HTTP status code?

Because a 200 can carry a not-found or private result. That's a completed, billed answer, so the call didn't fail and there's no data to use.

Do agents get billed differently than human API calls?

No. Agents get the same responses and the same billing rules. docs_search, docs_read and Ask's routing step are free.

Is it safe to put an API key in an MCP config file?

OAuth is better. If you must use a key, set an x-api-key header that reads it from an environment variable, and never commit the key itself. The Social Fetch MCP docs show how.

Should a production agent scrape HTML instead of calling an API?

Generally no. HTML selectors break when a page layout changes, while an API keeps billing, errors and request IDs in one place.

Try it on real data.

100 free credits when you sign up, no card needed. Make your first request in the Playground.

No credit cardSign up in 30 seconds withGoogleGitHub