Docs
View as Markdown

Quickstart

Three steps: get a key, make a call, read the result. You need nothing installed except a terminal or a language you already use.

1. Get your key#

Get a free key (1,000 credits, no card). Already have one? Paste it below to fill it into every snippet, or log in.

2. Make your first call#

This looks up github.profile: Fetch a GitHub user's public profile. It costs 1 credit. 1,000 free credits cover the open-platform endpoints. Hard-to-reach platforms (X, TikTok, Instagram, Reddit, and others marked on their page) need a verified email and a purchased pack.

curl "https://api.onekey.dev/v1/github/profile?username=torvalds" \
  -H "x-api-key: YOUR_API_KEY"

3. Read the result#

You get the standard response. Your data is in data, and what the call cost is in metadata.credits_charged.

json
{
  "success": true,
  "data": { "...": "unified fields for this endpoint" },
  "metadata": { "cached": false, "credits_charged": 1, "request_id": "7f3a9c2e5b1d4c8fa2e6d0b9c4f18e37" },
  "error": null
}

Always check success before you use data. On failure it is false, data is null, and error explains why. The same call twice in a row is served from cache and is free.

Check your key without spending credits#

GET /v1/account returns your balance and never costs credits:

shell
curl "https://api.onekey.dev/v1/account" \
  -H "x-api-key: YOUR_API_KEY"

Next#

  • Try other platforms in the catalog: change the two path words, keep your code.
  • Have a link instead? GET /v1/lookup?url=https://github.com/facebook/react resolves it to the right endpoint for you. See URL lookup.
  • Need several records, or one query on several platforms? See Batch and Multi-platform search.
  • Understand the response format.
  • See what can go wrong in Errors.