Sport Data API
Ask the warehouse
Plain-English questions in, a real query and its rows out. Nothing invented.
POST /v1/playground/chat takes one question in plain English, plans a single read-only query over the
curated schemas, runs it, and answers from the rows it returned.
curl -s "$ASD_BASE_URL/v1/playground/chat" \
-H "Authorization: Bearer $ASD_API_KEY" \
-H "Content-Type: application/json" \
-d '{"question": "Who won the most WSL events last season?"}'Request
| Field | Type | Notes |
|---|---|---|
question | string | Plain English, up to 500 characters. You never send SQL. |
Response
Unlike every other endpoint, the success body is a single object (camelCase) and not the list envelope. Errors use the standard error envelope.
| Field | What it holds |
|---|---|
answer | The written answer, grounded in the returned rows |
sql | The exact read-only statement that ran |
explanation, assumptions | How the question was read, and anything assumed |
question | Your question, echoed back |
columns, rows | The result set (up to 200 rows), with rowCount and capped. Each row is an array in columns order, not an object. |
evidence, dataGaps | Short statements tying the answer to specific rows, and what the data could not cover |
sourceSchemas | The warehouse schemas consulted |
elapsedMs, pages, requestId, model | Diagnostics. elapsedMs is warehouse time; the whole call takes longer because the model plans and writes the answer. |
A real answer
Captured from the live API on 2026-10-08 for the question "Who won the most WSL events in 2025?" (the SQL is shortened, two of four rows and some list items are trimmed, and IDs are cut):
{
"requestId": "req_738e8912d6695c924b5e7ba9",
"question": "Who won the most WSL events in 2025?",
"sql": "SELECT * FROM (WITH wins AS (SELECT er.competitor_id, COUNT(DISTINCT er.event_id) AS event_wins FROM asd_wsl.event_results er … WHERE s.season_year = 2025 AND er.finish_position = 1 …) … ) AS chat_result LIMIT 201",
"explanation": "Counts distinct WSL events in the 2025 season where each competitor finished first in the event-level rollup (asd_wsl.event_results), then returns the competitor or competitors with the highest win count. Ties are all returned.",
"assumptions": [
"'In 2025' is interpreted as the WSL season with season_year = 2025, rather than events whose start_date falls in calendar year 2025.",
"Wins are counted across all divisions combined (for example, men's and women's tours), so an event can produce one winner per division."
],
"columns": ["competitor_id", "competitor_name", "event_wins"],
"rows": [
["cbe207e9fc2059cf…", "Francisca Veselko", 5],
["0de683157aff63f5…", "Gabriela Bryan", 5]
],
"rowCount": 4,
"capped": false,
"elapsedMs": 4712,
"pages": 1,
"answer": "Four competitors tied for the most WSL event wins in the 2025 season, each with 5 wins: Francisca Veselko, Gabriela Bryan, Ginger Caimi and Kai Ellice-Flint.",
"evidence": [
"4 rows returned and none were capped; all are tied at the maximum.",
"Francisca Veselko: 5 event wins."
],
"dataGaps": [
"Wins are pooled across all divisions, so these rows don't show which tour or division each win came from.",
"The rows don't show whether the 2025 season data is complete."
],
"sourceSchemas": ["asd_wsl"],
"model": "claude-opus-5-5"
}That call took about 22 seconds end to end, of which 4.7 seconds was the warehouse. Set a client timeout of at least 60 seconds. The response states its own assumptions; read them before you repeat an answer.
The real-data rule
A question that cannot become a safe query fails with 400 invalid_request naming the rule it broke. No row,
stat or league is ever invented. Zero rows are reported as zero rows, together with the SQL that produced them.
Costs 1 credit per question. A 502 upstream_unavailable means the model or the warehouse was unreachable;
504 upstream_timeout means the statement ran past the deadline.
Ask covers more sports than the REST endpoints
The spine endpoints serve the four product sports. Ask plans its query over the wider set of curated warehouse
schemas, so it can answer about sports that /v1/{sport}/events would refuse with 404 unknown_sport
(GET /v1/catalog/sports lists every schema the warehouse holds). Treat those answers as exploratory: only the
product sports are graded and supported through the REST API.
In the dashboard
The platform dashboard has a Playground that calls this endpoint for you and shows the SQL, the rows, the answer, the evidence and any data gaps side by side. It runs on the platform's own key, so questions asked there are free and do not appear in your usage. Calling the endpoint from your code uses your key and costs 1 credit per question.
Good first questions:
- Who has the most WSL event wins in the warehouse?
- Which league has the freshest completed event?
- Which upcoming competitions have a scheduled start time?