Run a read-only SQL query
POST /api/v1/analytics/sql
SELECT/WITH over the workspace's tables (mentions, projects, keywords, categories, keyword_groups, runs). Capped at 1,000 rows.
Any API key or OAuth token, or a signed-in member.
Request body
JSON, sent with Content-Type: application/json.
| Name | Type | Description |
|---|---|---|
sql required |
string | A single SELECT or WITH statement. |
limit |
integer 1–1000 |
Example
curl -X POST "https://sniffington.com/api/v1/analytics/sql" \
-H "Authorization: Bearer $SCOUT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"sql":"SELECT source, COUNT(*) AS n FROM mentions GROUP BY source"}'