The SocialHolmes API
Public social data from Instagram, TikTok, YouTube, Snapchat and LinkedIn, through one request shape. Every run is asynchronous: you get a run id straight away, and the results the moment it finishes. From $0.50 per 1,000 results ($2.50 on LinkedIn), and nothing for a run that finds nothing.
Quickstart#
From a fresh key to real results in five steps. We'll pull the latest posts from one Instagram profile.
Free. Your first 1,000 credits are free (200 results on LinkedIn) — more than enough to finish this guide on every platform.
1 · Get a key
Create one on the API keys page. It's shown once — copy it somewhere safe, then keep it out of your code with an environment variable.
export SOCIALHOLMES_BASE_URL="https://api.socialholmes.com"
export SOCIALHOLMES_KEY="sh_••••••••••••"
2 · Make your first request
Ask for instagram/posts with a username and a limit. Pick your language:
curl -X POST $SOCIALHOLMES_BASE_URL/api/public/v1/scrape/instagram/posts \
-H "Authorization: Bearer $SOCIALHOLMES_KEY" \
-H "Content-Type: application/json" \
-d '{ "parameters": { "username": "cristiano" }, "limit": 120 }'
import os, requests
API = os.environ["SOCIALHOLMES_BASE_URL"] + "/api/public/v1"
HEADERS = { "Authorization": "Bearer " + os.environ["SOCIALHOLMES_KEY"] }
run = requests.post(
API + "/scrape/instagram/posts",
headers=HEADERS,
json={ "parameters": { "username": "cristiano" }, "limit": 120 },
).json()
print(run["id"], run["status"])
const API = process.env.SOCIALHOLMES_BASE_URL + "/api/public/v1";
const res = await fetch(API + "/scrape/instagram/posts", {
method: "POST",
headers: {
Authorization: "Bearer " + process.env.SOCIALHOLMES_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({ parameters: { username: "cristiano" }, limit: 120 }),
});
const run = await res.json();
console.log(run.id, run.status);
3 · Read the 202
The answer comes back at once: the run itself, accepted, quoted and queued. Keep its id.
202 Accepted (simplified)
{
"id": "run_8d20e5f1",
"status": "queued",
"platform": "instagram",
"endpoint": "posts",
"target": "cristiano",
"requested": 120,
"created_at": "2026-11-01T14:02:11Z"
}
The quote is held, not charged. A limit of 120 holds $0.06. You'll be billed only for what arrives, and the rest goes straight back to your balance.
4 · Poll the run
Ask for the run every few seconds until its status is terminal: succeeded, empty, failed or cancelled.
curl $SOCIALHOLMES_BASE_URL/api/public/v1/runs/run_8d20e5f1 \
-H "Authorization: Bearer $SOCIALHOLMES_KEY"
While it runs:
{
"id": "run_8d20e5f1",
"status": "running",
"platform": "instagram",
"endpoint": "posts",
"target": "cristiano",
"requested": 120,
"started_at": "2026-11-01T14:02:15Z"
}
When it's done:
{
"id": "run_8d20e5f1",
"status": "succeeded",
"platform": "instagram",
"endpoint": "posts",
"target": "cristiano",
"requested": 120,
"result_count": 112,
"finished_at": "2026-11-01T14:03:40Z"
}
112 results × $0.0005 = $0.056 billed; the other $0.004 of the hold is released.
5 · Fetch the results
Read the finished run's results. For comment endpoints, GET /runs/:id/comments returns them already parsed, replies included.
curl $SOCIALHOLMES_BASE_URL/api/public/v1/runs/run_8d20e5f1/results \
-H "Authorization: Bearer $SOCIALHOLMES_KEY"
Response (simplified, illustrative values):
{
"results": [
{ "type": "post", "shortcode": "C8xQ2rLs9aB", "like_count": 4210, "comment_count": 186 },
{ "type": "post", "shortcode": "C8vN1pKa2xQ", "like_count": 3388, "comment_count": 97 }
]
}
Base URL#
Every path below is relative to this base. All requests and responses are JSON.
https://api.socialholmes.com/api/public/v1
Authentication#
Send your key as a bearer token on every request. Keys start with sh_, are shown once when you create them, and are stored only as a hash. Create and revoke keys on the API keys page.
curl https://api.socialholmes.com/api/public/v1/account \
-H "Authorization: Bearer $SOCIALHOLMES_KEY"
The request shape#
One call starts a run on any platform: name the platform and endpoint in the path, pass the endpoint's parameters, and say how many results you want with limit. Switching platforms means changing the path, not your integration.
Optional body fields: comment_limit and reply_limit cap comment threads, and webhook_url notifies one URL when this run finishes. The answer is the run itself — keep its id and poll GET /runs/:id.
Add project_id to file the run (and, once it finishes, the creator it was about) in one of your projects. An id that is not yours is rejected with 422.
POST /scrape/tiktok/comments
{ "parameters": { "video_id": "7212345678901234567" }, "limit": 500 }
202 Accepted (simplified)
{
"id": "run_4c19e2d7",
"status": "queued",
"platform": "tiktok",
"endpoint": "comments",
"target": "7212345678901234567",
"requested": 500,
"created_at": "2026-11-01T14:02:11Z"
}
How a run works#
| 1 · submit | You get 202 and the run, with its id. The cost is quoted and held. |
|---|---|
| queued | Waiting to start. Up to 3 of your runs go at once. |
| running | In progress. Results are on the way. |
| succeeded | Finished. Billed per result, never above the quote. |
A run can also end empty, failed or cancelled — none of those cost anything. Find out it's done by polling GET /runs/:id, or let a webhook tell you. Every status is explained in Errors & statuses.
Platforms#
Every route#
| Method | Path | What it does |
|---|---|---|
| GET | /platforms | Every live platform and its endpoints |
| GET | /platforms/:id | One platform's endpoints and parameters |
| GET | /account | Your account and limits |
| GET | /account/balance | What you can spend right now |
| GET | /account/transactions | Top-ups, holds, charges and releases |
| POST | /scrape/:platform/:endpoint | Start a run — returns 202 and the run |
| GET | /runs | Your runs, newest first (filter by status) |
| GET | /runs/:id | One run's status, counts and failure reason |
| GET | /runs/:id/results | The results of a finished run |
| GET | /runs/:id/comments | Comments and replies, already parsed |
| POST | /runs/:id/cancel | Cancel a run that hasn't finished |
| GET | /webhooks | Your webhook endpoints |
| POST | /webhooks | Add an endpoint |
| DELETE | /webhooks/:id | Remove an endpoint |
| GET | /webhooks/:id/deliveries | What we sent to an endpoint, and how it answered |
Limits & errors#
Every error has the same shape, so you can handle them in one place.
{
"error": {
"code": "rate_limited",
"message": "Too many requests. Try again shortly."
}
}
Webhooks#
Stop polling. Register an endpoint and we'll POST a signed event to it the moment a run is final — with everything you need to fetch the results in one call.
Events
There are exactly four, one per terminal status. A webhook only fires when a run is finished — there is no "started" event.
| Event | Sent when | Billed |
|---|---|---|
run.succeeded | The run finished with results | Per result, never above the quote |
run.empty | It finished, but there was nothing to collect | $0 |
run.failed | It couldn't finish — read reason and message | $0 |
run.cancelled | You cancelled it before it finished | $0 |
The payload
Every event carries the run as data.run — the same object GET /runs/:id returns. Results aren't inlined (they can be large); fetch them with GET /runs/:id/results.
POST https://your-app.example/hooks/socialholmes
{
"id": "evt_3f9a1c2b7d4e5f60a1b2c3d4e5f6a7b8",
"type": "run.succeeded",
"created_at": "2026-11-01T14:05:12Z",
"data": {
"run": {
"id": "run_4c19e2d7",
"status": "succeeded",
"platform": "tiktok",
"endpoint": "comments",
"target": "7212345678901234567",
"requested": 500,
"result_count": 463,
"finished_at": "2026-11-01T14:05:10Z"
}
}
}
Verify the signature
Each delivery is signed with your endpoint's secret. The header holds a Unix timestamp t and v1, the hex HMAC-SHA256 of t + "." + raw body. Compare in constant time, and reject old timestamps to stop replays.
X-SocialHolmes-Signature: t=1793516000,v1=6a1f0c…e94b
import crypto from "node:crypto";
export function verify(rawBody, header, secret) {
const parts = Object.fromEntries(header.split(",").map((p) => p.split("=")));
const expected = crypto
.createHmac("sha256", secret)
.update(parts.t + "." + rawBody)
.digest("hex");
const fresh = Math.abs(Date.now() / 1000 - Number(parts.t)) < 300;
return fresh && expected.length === parts.v1.length &&
crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1));
}
import hashlib, hmac, time
def verify(raw_body: bytes, header: str, secret: str) -> bool:
parts = dict(p.split("=", 1) for p in header.split(","))
signed = parts["t"].encode() + b"." + raw_body
expected = hmac.new(secret.encode(), signed, hashlib.sha256).hexdigest()
fresh = abs(time.time() - int(parts["t"])) < 300
return fresh and hmac.compare_digest(expected, parts["v1"])
Verify the raw body. Compute the signature over the exact bytes you received, before any JSON parsing or re-encoding.
Retries & limits
On the Webhooks page you can see every delivery and how your server answered, resend one, rotate a secret, and turn an endpoint off or on.
Manage webhooks with the API
| Method | Path | What it does |
|---|---|---|
| GET | /webhooks | List your endpoints |
| POST | /webhooks | Add one — answers 201 |
| DELETE | /webhooks/:id | Remove one — answers 204 |
| GET | /webhooks/:id/deliveries | Recent deliveries and responses |
Add an endpoint:
curl -X POST https://api.socialholmes.com/api/public/v1/webhooks \
-H "Authorization: Bearer $SOCIALHOLMES_KEY" \
-H "Content-Type: application/json" \
-d '{ "url": "https://your-app.example/hooks/socialholmes", "events": ["run.succeeded", "run.empty"] }'
201 Created
{
"id": "[webhook id]",
"url": "https://your-app.example/hooks/socialholmes",
"events": ["run.succeeded", "run.empty"],
"enabled": true,
"last_delivered_at": null,
"disabled_reason": null
}
Leave out events to receive all four. Need a one-off? Pass webhook_url in a scrape request to notify that URL for that run only.
Good habits
- Answer fast. Return a 2xx straight away and fetch results in a background job, so a slow download never looks like a failed delivery.
- Expect repeats. A retry can arrive after you've handled an event. De-duplicate on the event id or the
run.id. - Keep polling as a backstop. If your endpoint was down for longer than the retry window,
GET /runs/:idstill has the answer.
Errors & statuses#
Two kinds of "something went wrong": a request we refused (you get an HTTP error straight away) and a run that started but couldn't finish (you get a status and a reason). Neither costs you anything.
Run statuses
| Status | Meaning | Final? | Billed |
|---|---|---|---|
queued | Accepted and waiting to start | No | Quote held, nothing charged |
running | In progress — results are on the way | No | Quote held, nothing charged |
succeeded | Finished with results | Yes | Results × price per result, capped at the quote |
empty | Finished, but there was nothing to collect | Yes | $0 |
failed | Couldn't finish — see reason | Yes | $0 |
cancelled | You cancelled it before it finished | Yes | $0 |
Failure reasons
A run that ended failed, empty or cancelled carries one of these codes in reason, with the sentence below in message — exactly as the API returns it. Running and succeeded runs have neither field.
| Reason | Message | What to do |
|---|---|---|
capacity retry | "This is taking longer than usual. Try again in a few minutes." | Submit the run again in a little while. |
not_completed retry | "This run could not be completed. Try again shortly." | Retry. If it keeps happening on the same target, contact support with the run id. |
timeout retry | "The run reached its time limit before it finished." | Retry, or ask for a smaller limit and split the work across runs. |
page_unavailable retry | "The page could not be loaded." | Check the target opens publicly, then retry later. |
target_not_found fix | "The requested target does not exist, or is not publicly visible." | Check the username, handle or id — it may be misspelled, deleted or hidden. |
private_account final | "This account is private, so its content cannot be read." | Nothing to retry. The profile record still comes back with is_private, so you can sort these from deleted accounts. |
access_blocked retry | "The platform did not return this page. It may require a login, or it presented a challenge." | Retry later. Content that needs a login to view is not available. |
no_data final | "The run finished without collecting anything. The page may have failed to load, required a login, presented a challenge, or served no matching API responses." | Seen on empty runs. Check the target actually has content of that kind; retry if you expected some. |
company_not_found fix | "LinkedIn has no company page at /company/<slug>/. Check the company slug (current_company or from_company): it's the part after linkedin.com/company/." | Fix the slug and run again. |
no_matching_results final | "LinkedIn found no matches for this search and these filters. Try fewer filters or a different location." | Seen on empty searches. Remove a filter or widen the location. |
no_comments final | "This post has no comments. You were not charged." | Nothing to fix: the post has no comments. |
cancelled final | "This run was cancelled." | You (or your integration) cancelled it. Start a new run if you still need the data. |
internal retry | "The run failed for an unexpected reason. Quote the run id to support if it happens again." | Retry once; if it repeats, send us the run id. |
Request errors
When we refuse a request, no run is created and nothing is held. Every error has the same shape; branch on error.code, not on the message.
422 Unprocessable Content
{
"error": {
"code": "missing_parameters",
"message": "Missing required parameter(s): username."
}
}
| HTTP | Code | When |
|---|---|---|
| 400 | malformed_json | The body isn't valid JSON |
| 401 | unauthorized | No key, or the key is wrong or revoked |
| 402 | payment_required | Your balance doesn't cover the run's quote — top up |
| 403 | account_suspended | The account can't start runs — contact support |
| 403 | endpoint_not_granted | That endpoint isn't enabled on your account |
| 404 | unknown_platform | The platform in the path isn't one we serve |
| 404 | unknown_endpoint | That platform has no endpoint by that name |
| 404 | not_found | No such run or webhook on your account |
| 409 | already_finished | You tried to cancel a run that has already finished |
| 422 | missing_parameters | A required parameter for that endpoint is missing |
| 422 | invalid_parameters | A handle, ID or tag contains a space. |
| 422 | invalid_limit | limit isn't a valid whole number for that endpoint |
| 422 | invalid_request | The run couldn't be created as asked — the message says why |
| 422 | invalid_project | `project_id` is not a project in your account |
| 422 | invalid_webhook_url | The webhook URL you sent can't be used |
| 429 | rate_limited | More than 2,000 requests in a minute — slow down and retry |
| 429 | concurrency_limit | All your run slots (3 by default) are busy — submit again when one finishes |
| 503 | endpoint_unavailable | That endpoint is temporarily unavailable — try again later |
Retry safely. 429 and 503 are worth retrying with a short back-off. 4xx errors other than 429 won't change on retry — fix the request first.
Billing & pricing#
One price per platform, billed per result delivered. Every run is quoted before it starts and can never cost more than that quote.
How a run is billed
- 1 · quote. When you submit, we price the most the run could return:
limit × $0.0005($0.0025 on LinkedIn). - 2 · hold. That amount is set aside from your balance while the run works.
- 3 · settle. When it finishes you're charged
results × $0.0005($0.0025 on LinkedIn) — never above the quote. - 4 · release. Whatever wasn't used goes straight back to your balance.
Try it: one run, start to finish
- Quoted & held
- $0.250
- Billed
- $0.232
- Released back
- $0.018
463 results × $0.0005 = $0.232 billed; $0.018 goes back to your balance.
What you never pay for
- Empty runs
- Failed or cancelled runs
- Anything above the quote
- Refused requests (no run is created)
- Polling, webhooks or a monthly fee
Check your balance from the API
GET /account/balance returns your balance, the part currently held by unfinished runs, and what's available to start new ones. GET /account adds your rate and limits.
curl https://api.socialholmes.com/api/public/v1/account/balance \
-H "Authorization: Bearer $SOCIALHOLMES_KEY"
200 OK
{
"credits": {
"balance": "[balance]",
"held": "[held by running quotes]",
"available": "[available]"
}
}
GET /account — the rate part (simplified)
"rate": { "usd_per_thousand_results": 0.5 },
"limits": { "concurrent_runs": 3, "runs_in_flight": 1 }
Transactions
GET /account/transactions lists every movement on your balance, newest first: top-ups, bonuses, run charges (with the run_id they belong to), refunds and adjustments. Page with limit and offset.
200 OK (simplified)
{
"transactions": [
{ "kind": "charge", "amount": "[amount]", "run_id": "run_4c19e2d7", "created_at": "2026-11-01T14:05:10Z" },
{ "kind": "bonus", "amount": "[amount]", "description": "5% top-up bonus", "created_at": "2026-10-30T09:12:00Z" },
{ "kind": "topup", "amount": "[amount]", "description": "Top-up via PayPal", "created_at": "2026-10-30T09:12:00Z" }
],
"page": { "limit": 25, "offset": 0, "returned": 3 }
}
Top-ups
Add to your balance whenever you like, paid through PayPal. Bigger top-ups carry a bonus.
| Pay | Bonus | You get |
|---|---|---|
| $9 | — | 18,000 results |
| $29 | — | 58,000 results |
| $49 | — | 98,000 results |
| $99 | +5% | 207,900 results |
| $199 | +10% | 437,800 results |
Top-ups come in these five packs only. There is no custom amount.
Running a lot every month?
For large monthly volume we agree a custom price. Tell us what you need.