Skip to Content
socialdata

sql

POST
/v1/sql

Runs one SELECT over socialdata's data and returns up to 1,000 rows. Use it only when no other tool answers the question, such as an aggregate over many accounts.

Authorization

apiKey
headerx-api-key<token>

Request Body

application/json
  1. body
query*string

One read-only SELECT statement, up to 20,000 characters.

Length1 <= length <= 20000

Response Body

Success

application/json
  1. response
meta*

Facts about this call, in every answer.

columns*array<>

The columns of rows, in order.

rows*array<array<any>>

At most 1,000 rows, each an array in the order of columns, with 64-bit integers as strings.

is_truncated*boolean

true when the query returned more rows than the answer holds.

Example Request
curl -X POST 'https://api.socialdata.product.studio/v1/sql' \  -H 'Content-Type: application/json' \  -d '{  "query": "SELECT platform, handle, follower_count FROM accounts WHERE platform = '\''tiktok'\'' ORDER BY follower_count DESC LIMIT 10"}'
Example Response
{  "meta": {    "as_of": "2026-11-26T14:00:00Z",    "source": "store",    "credits_spent": 0,    "credits_left_today": 30,    "trace_id": "dd4ea85c713694073f9ab127c28f2318",    "warnings": [      {        "code": "first_observation",        "message": "The service saw this target for the first time in this call."      }    ]  },  "columns": [    {      "name": "handle",      "type": "String"    }  ],  "rows": [    [      "tiktok",      "acme_studio",      "1250000"    ]  ],  "is_truncated": false}