> **For coding agents and LLMs:** This is one Social Fetch marketing page (markdown export). For API orientation start with [`/llms.txt`](https://www.socialfetch.dev/llms.txt); for auth and crawl rules use [`/agents.txt`](https://www.socialfetch.dev/agents.txt); for every operation use [`/llms-endpoints.txt`](https://www.socialfetch.dev/llms-endpoints.txt).

## This page

- **On-site (HTML):** <https://www.socialfetch.dev/glossary/social-data-for-ai-agents>
- **Markdown (.mdx) URL:** <https://www.socialfetch.dev/glossary/social-data-for-ai-agents.mdx>

---

# How should AI agents get social data?

Agents need the same public social data as any integration — profiles, posts, transcripts — but must branch programmatically on structured outcomes, discover real routes, and authenticate without leaking keys. Social Fetch supports that via lookupStatus, discovery files, OAuth MCP, and typed REST.

## What makes an API agent-friendly

data.lookupStatus on HTTP 200 — branchable found/not_found/private instead of inferring from status code and prose.

Discoverability: /llms.txt, /agents.txt, /llms-endpoints.txt, /openapi.json, skill.md — read before guessing endpoints.

meta.creditsCharged and meta.requestId on every response for cost visibility and support.

## How an agent connects, without leaking a key

Interactive agents (Claude, Cursor): hosted MCP at https://api.socialfetch.dev/mcp with OAuth. If the client cannot complete OAuth, send x-api-key from an env var.

Production backends/CI: sfk_… in server env, REST or @socialfetch/sdk.

MCP tools: {platform}_{resource}_{action} — catalog covers 25 platforms, ~264 operations.

## Discovery files and zero-cost routing

docs_search and docs_read on MCP are free. nl_ask_post / POST /v1/ask routes plain English at 0 credits; nested lookup bills normally.

Use routing once to find the operation, then call the typed tool/route for repeats.

## A concrete agent workflow

nl_ask_post → routedOperation tiktok_profile_videos_list + first result. Check lookupStatus before using data. Switch to typed tool for batch handles. Log meta.requestId for wrong summaries.

## Common mistakes agents make

Inventing endpoints — read /llms.txt or docs_search first.

Checking HTTP status only — 200 + not_found is completed, not missing data to act on.

Retrying not_found — bills again. Retry lookup_failed/503 only.

Plaintext API key in shared MCP config — use OAuth, or interpolate x-api-key from an env var.

## Boundaries: what agents shouldn't do with this

Public content only — no private accounts or login-gated data.

Production agents scraping HTML inherit every layout change. Documented endpoints keep metering, errors, and requestId in one place. 100 free credits on signup for end-to-end tests.

## FAQ

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

MCP + OAuth for interactive clients (or x-api-key if the client never prompts). sfk_… key + REST/SDK for backend/batch.

### Can Claude or Cursor call a social media API directly?

Yes via hosted MCP at https://api.socialfetch.dev/mcp — OAuth once, typed tools like tiktok_profile_get.

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

Read /llms.txt, /llms-endpoints.txt, /openapi.json, or call free docs_search/docs_read on MCP.

### What is nl_ask_post and when should an agent use it?

Natural-language routing — 0 credits for routing. Use when the typed route is unknown; switch to typed tool for repeats.

### Why check lookupStatus instead of just the HTTP status code?

200 with not_found/private is a completed billed answer — not transport failure or success with data.

### Do agents get billed differently than human API calls?

No — same envelope and rules. docs_search, docs_read, and Ask routing are free.

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

Prefer OAuth. If you must use a key, interpolate x-api-key from an env var — do not commit sfk_…. See /docs/integrations/mcp.

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

Generally no — HTML selectors break on layout changes. API keeps metering, errors, and requestId centralized.

## Related

- [MCP docs](https://www.socialfetch.dev/docs/integrations/mcp)
- [MCP for social data](https://www.socialfetch.dev/glossary/mcp-for-social-data)
- [Ask natural-language API](https://www.socialfetch.dev/glossary/ask-natural-language-api)
- [Lookup status](https://www.socialfetch.dev/glossary/lookup-status)
- [API key vs OAuth](https://www.socialfetch.dev/glossary/api-key-vs-oauth)
- [Ask](https://www.socialfetch.dev/ask)
- [agents.txt](https://www.socialfetch.dev/agents.txt)
- [Pricing](https://www.socialfetch.dev/pricing)
