Quickstart
Authenticate, verify your API key, make a real Social Fetch request in multiple languages, and understand what to inspect in the response
Start with your AI tool
Paste this prompt into Cursor, Claude Code, or any AI IDE. It will read the docs and integrate Social Fetch for you.
Start with your AI tool
Paste this prompt into Cursor, Claude Code, or any AI IDE. It will read the docs and integrate Social Fetch for you.
Using TypeScript?
Use this page to verify your key and understand the raw HTTP API first, then move to the TypeScript SDK if you want typed methods and Result handling.
Before you start
- Base URL:
https://api.socialfetch.dev - API key: create one in API Keys
- Auth header: send
x-api-keyon every request under/v1 - Security rule: keep the key server-side only; never ship it in browsers or mobile apps
1. Save your API key
If you are starting from JavaScript, put the key in an .env file first. The other tabs show equivalent shell-specific options.
SOCIALFETCH_API_KEY=sfk_...2. Make your first request
Make one real profile request first. It verifies that your auth works and also shows the standard data + meta response envelope you will see across the API.
Metered request
This platform lookup can charge credits. If you want a zero-credit auth smoke test instead, use GET /v1/whoami. Read Credits before running metered routes at scale.
const response = await fetch(
"https://api.socialfetch.dev/v1/tiktok/profiles/charlidamelio",
{
headers: {
"x-api-key": process.env.SOCIALFETCH_API_KEY,
},
}
);
const body = await response.json();
console.log(response.status, body);If this request returns 401, your auth setup is not correct yet. If it returns 200, your key is working and you can start interpreting data.
3. Read the response
A successful response wraps the endpoint payload in a standard envelope:
{
"data": {
"lookupStatus": "found",
"profile": { "...": "..." },
"metrics": { "...": "..." }
},
"meta": {
"requestId": "req_01example",
"creditsCharged": 1,
"version": "v1"
}
}Check these fields in order:
- HTTP status
200means the request succeeded at the HTTP level.- Non-
200means read the{ error }body instead.
meta.requestId- Log it on failures and include it in support requests.
meta.creditsCharged- On metered routes, this tells you exactly what was billed.
- Route-specific outcome fields
- For profile lookups, inspect fields like
data.lookupStatus. found,private, andnot_foundcan all still arrive with HTTP200.
- For profile lookups, inspect fields like
The most important rule: do not treat every HTTP 200 as “usable data is present.” For many Social Fetch routes, business-level outcomes live inside data.
4. Handle common first-run failures
401 unauthorized: the key is missing, invalid, or not being sent correctly. Re-check yourx-api-keyheader and environment variable wiring.402 insufficient_credits: your auth is fine, but the account does not have enough credits for that route. See Credits.503 temporarily_unavailable: the service or upstream source is temporarily unavailable. Retry with backoff rather than hammering the endpoint.- HTTP
200withlookupStatus: "not_found"orlookupStatus: "private": this is still a successful API response, just not a “found data” outcome.
For the full error envelope, retry guidance, and request ID semantics, read Errors.
Where to go next
API reference
Every documented endpoint, with params, schemas, and per-route behavior.
TypeScript SDK
Typed methods, `Result` handling, and `unwrap()` for TypeScript-first integrations.
Errors
HTTP errors, outcome semantics, request IDs, and retry guidance.
Credits
Which routes charge, how to interpret `creditsCharged`, and what `402` means.
Documentation
Start quickly with Social Fetch, browse platform coverage, and choose the best path for humans or coding agents
TypeScript SDK
Install and use the official TypeScript SDK for Social Fetch with a concrete method inventory, route mapping, unwrap guidance, and parity with documented public routes