What is the difference between an API key and OAuth?
An API key is a long-lived secret your server sends with every request to show which account is calling. OAuth is a consent flow: someone approves access once, and your app holds a token instead of a password. Social Fetch's REST API uses an API key in the x-api-key header, and its hosted MCP server uses OAuth by default, with the same API key as a fallback for clients that can't complete OAuth.
Glossary · Operations
What each one actually solves
An API key answers "which account is this?" It's one string that stays valid until you revoke it. That suits unattended server-to-server calls, and it's risky anywhere a browser can see it.
OAuth answers "did a person approve this?" A sign-in and consent screen produces a scoped, often short-lived token. It's built for cases where consent and the ability to revoke access matter.
When API keys fit
Use a key for anything that runs on its own: cron jobs, backend proxies, n8n or Pipedream nodes, batch scripts. Create a key in the Social Fetch dashboard, store it in an environment variable, and send it in the x-api-key header on every request. Credits are charged to that key's account.
Treat it like a password. Keep it out of frontends, mobile apps and public repos, and rotate it from the dashboard if it leaks.
When OAuth fits
Use OAuth for interactive agents such as Claude, Cursor and VS Code, where a person approves access once. Social Fetch's hosted MCP server at https://api.socialfetch.dev/mcp uses OAuth by default, so tool calls are billed to your signed-in account. If the client can't complete OAuth, send the same x-api-key you'd use for REST.
Platforms' own developer kits (Instagram Graph, TikTok Login, LinkedIn partner APIs) use OAuth to reach data that belongs to the account owner. That's separate from Social Fetch's MCP OAuth, which only signs you in to your Social Fetch account for public-data lookups.
A concrete example of the split
A nightly job pulling 500 TikTok follower counts reads its API key from an environment variable and calls the REST API or the @socialfetch/sdk package. A Claude Desktop agent that looks up creators on demand connects to the hosted MCP server and signs in with OAuth in the browser.
Over MCP, whoami, balance and Ask all run under the same signed-in account, whether you connected with OAuth or an API key.
How the industry generally splits this
Stripe uses secret keys for charges made by your server and OAuth for Connect merchants. Google Cloud uses service-account keys for backends and OAuth when end-user data is involved. The pattern is the same: keys for systems acting for themselves, OAuth when a person's consent has to be verifiable.
Common mistakes
Putting an API key where a browser can read it. Move the call to your server, or use OAuth through the hosted MCP server instead.
Expecting platform OAuth (TikTok, LinkedIn, Meta) to stand in for Social Fetch's MCP OAuth. They're separate systems, and you need the one that matches the API you're calling.
How Social Fetch splits them
The REST API, OpenAPI spec and TypeScript SDK use an API key in the x-api-key header. The hosted MCP server uses OAuth by default, or the same x-api-key if the client can't complete OAuth. See the MCP docs and the quickstart.
Questions. Short answers.
Should I use an API key or OAuth?
Use an API key for unattended calls to the Social Fetch REST API or SDK. Use OAuth for interactive MCP clients. If your MCP client can't complete OAuth, send your API key in the x-api-key header instead; the MCP docs show how.
Is OAuth required for Social Fetch?
No. The REST API and SDK use an API key in the x-api-key header. The MCP server uses OAuth by default and also accepts the API key.
Can I use an API key with MCP?
Yes, though OAuth is preferred. If your client can't complete OAuth, send x-api-key with the key read from an environment variable. The Social Fetch MCP docs show how.
Do I need OAuth to call Social Fetch REST?
No. Create a key on the API Keys page of the Social Fetch dashboard and send it in the x-api-key header.
Can I put my API key in Cursor MCP config?
OAuth is better. If Cursor never prompts you to sign in, set an x-api-key header that reads the key from an environment variable. The Social Fetch MCP docs show how.
Is platform OAuth (TikTok, LinkedIn, Meta) the same as Social Fetch OAuth?
No. Platform OAuth authorizes a member's account on that platform. Social Fetch's MCP OAuth signs you in to your Social Fetch account so it can bill your tool calls.
Where do I create an API key?
On the API Keys page of the Social Fetch app. The quickstart and credits docs walk you through it.
Why doesn't Social Fetch just use API keys for MCP too?
OAuth is the default so your key doesn't sit in a config file. If the client can't complete OAuth, you can still send x-api-key read from an environment variable. The Social Fetch MCP docs show how.
Keep reading. Related pages.
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