Getting started
Benchmark returns public social data for a profile, a post, or a link.
You send a target. A target is a URL, a handle, or a platform ID. If Benchmark has the data, you get it right away. If it does not, you ask Benchmark to collect it.
-
Get an API key
Sign in at benchmark.app. Open API keys in the sidebar and create a key. Each key belongs to one workspace.
-
Set your base URL and key
Replace
YOUR_API_KEYwith your key. Keys start withsk_.Terminal window export BENCHMARK_API_BASE_URL="https://api.benchmark.app"export BENCHMARK_API_KEY="YOUR_API_KEY" -
Read stored data
Ask for Basic profile data. Every read is a
POSTwith atarget.Terminal window curl -sS "$BENCHMARK_API_BASE_URL/v1/profiles/basic" \-H "authorization: Bearer $BENCHMARK_API_KEY" \-H "content-type: application/json" \-d '{ "target": { "reference": "https://www.youtube.com/@mkbhd" } }'If Benchmark has the data, you get it back right away.
-
Ask for data that is missing
A read can return
404 NOT_FOUNDwithcanRequestData: true. That means Benchmark does not have the data yet, but it can collect it. Call the matching refresh route:Terminal window curl -sS "$BENCHMARK_API_BASE_URL/v1/profiles/basic/refresh" \-H "authorization: Bearer $BENCHMARK_API_KEY" \-H "content-type: application/json" \-d '{ "target": { "reference": "https://www.youtube.com/@mkbhd" } }' -
Poll the collection
A refresh returns a collection. A collection is a job that you check until its
statusiscompleteorfailed. ReplaceCOLLECTION_IDwith theidfrom the refresh response.Terminal window curl -sS "$BENCHMARK_API_BASE_URL/v1/collections/COLLECTION_ID" \-H "authorization: Bearer $BENCHMARK_API_KEY"
Next
- Authentication: how API keys work.
- API endpoints: the full route list.
- Data model: Basic, Enriched, coverage, and collections.