DataSocial

Search DataSocial

Guides, tables, questions and live endpoints

Guides

Data API

Run SQL from your own code: one HTTP call, an API key, JSON back.

Everything Search does is one HTTP call you can make yourself. Base URL: https://api.datasocial.ai

Get a key

Sign in, open the API keys tab and create a key. It looks like ds_live_… and is shown once, so copy it somewhere safe. Send it as a bearer token. Queries with a key are charged to your credits, exactly like Search.

Without a key the API still answers, with the free limits (1,000 rows, 10 seconds, 20 queries a minute per address).

Run a query

curl https://api.datasocial.ai/v1/data/sql \
  -H "Authorization: Bearer $DATASOCIAL_KEY" \
  -H 'content-type: application/json' \
  -d '{"sql": "SELECT username, followers FROM tiktok.creators WHERE country = '\''US'\'' ORDER BY followers DESC LIMIT 3"}'

The response

{
  "columns": [{ "name": "username", "type": "String" }, { "name": "followers", "type": "UInt32" }],
  "rows": [["khaby.lame", 162989705], ["charlidamelio", 160221160], ["tiktok", 95949280]],
  "row_cap": 1000,
  "capped": false,
  "rows_read": 5029786,
  "bytes_read": 65283020,
  "elapsed_ms": 187
}
  • rows are arrays in the order of columns. 64-bit integers (ids) arrive as strings.
  • capped is true when the result hit the row cap (row_cap).
  • With a key, credits says what the query cost and what is left: {"charged": 3, "balance": 997}.

Errors

A failed query answers with a status and {"error": "…"} in plain words. Errors are free.

StatusMeans
400The SQL has a mistake; the message says where.
401The key or session is missing, wrong or expired.
402Out of credits (code: "insufficient_credits").
403Not allowed: another database, a setting, a write, or a premium column.
429Too many queries at once or per minute. Wait a moment.

Endpoints

EndpointWhat it doesStatus
POST /v1/data/sqlRuns one read-only query on tiktok; body {"sql": "…"}.Open
GET /v1/tablesEvery table and column, with live row counts.Open
GET /v1/live/*Six live reads of TikTok, 2 credits each. See the Live API tab.Opening soon
POST /v1/askA question in plain English → {"sql", "table", "chart", "note"}, checked but not run; body {"question": "…"}. 30 credits.Open
POST /v1/ask/dashboardOne sentence → a dashboard plan: 4–6 tiles, each with its SQL (using the filter parameters), tile type and place, checked but not run; body {"prompt": "…"}. 30 credits per tile, 180 at most. Signed in only.Open
POST /v1/ask/tileOne tile changed by an instruction; body {"instruction": "make this weekly", "sql": "…", "chart": {…}, "filters": {…}}. 30 credits. Signed in only.Open

DataSocial: TikTok data you can ask questions of.