← All glossary terms

What is the difference between an API key and OAuth?

An API key is a secret your server sends on every request to prove which account is calling. OAuth is a browser (or device) consent flow that issues a short-lived token for a user or client session. Social Fetch REST and SDK calls use an API key (x-api-key: sfk_…). Hosted MCP signs in with OAuth so agents never put a key in config.

When API keys fit

API keys suit server-to-server jobs: cron enrichment, backend proxies, n8n/Pipedream nodes, and scripts. You create a key in the app dashboard (keys start with sfk_), store it in env, and send it as x-api-key. Credits charge to that account.

Treat the key like a password. Do not embed it in a public frontend or ship it in MCP config files.

When OAuth fits

OAuth fits when a human (or IDE) must approve access once and the client stores a token. Social Fetch MCP uses OAuth 2.1: Cursor, Claude, or VS Code opens a browser, you approve, and tools bill credits to your signed-in account.

Official platform kits (Instagram Graph, TikTok Login, LinkedIn partner APIs) also use OAuth so members authorize your app for owner-scoped data or writes. That is a different problem from public-data enrichment with a vendor API key.

How Social Fetch splits them

REST, OpenAPI, and the TypeScript SDK: API key. Hosted MCP: OAuth (optional x402 for anonymous paid tools). Whoami, balance, and NL Ask on MCP still require OAuth. See /docs/integrations/mcp and /docs/quickstart.

FAQ

Do I need OAuth to call Social Fetch REST?

No. Send x-api-key with a sfk_… key from the API Keys dashboard. OAuth is for MCP and similar interactive clients.

Can I put my API key in Cursor MCP config?

Prefer hosted MCP with OAuth so the key never sits in a config file. If you use REST from a script, keep the key in environment variables on the server.

Is platform OAuth the same as Social Fetch OAuth?

No. Platform OAuth authorizes TikTok/Meta/LinkedIn member access. Social Fetch MCP OAuth authorizes your Social Fetch account for tool calls.

Where do I create a key?

In the Social Fetch app under API Keys. Docs: /docs/quickstart and /docs/credits.