API
API reference
https://useground.devexport GROUND_API_KEY=gk_…
# 1. Create a dataset
curl https://useground.dev/api/dataset-graphs \
-H "Authorization: Bearer $GROUND_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: invoices-1" \
-d '{ "request": "Customers, subscriptions and monthly invoices" }'
# → { "id": "8d0f…", "jobId": "…", "status": "queued", … }
# 2. Check the build: repeat until job.status is succeeded
curl https://useground.dev/api/dataset-graphs/$ID -H "Authorization: Bearer $GROUND_API_KEY"
# 3. Download every table (one file, or a zip for several)
curl -L -o dataset.zip https://useground.dev/api/dataset-graphs/$ID/download -H "Authorization: Bearer $GROUND_API_KEY"Authentication#
Create a key in Account settings → API keys and send it as a bearer token. Keys act as you; they can't manage keys or your account. API keys need a plan that includes API access.
curl https://useground.dev/api/dataset-graphs/$ID \
-H "Authorization: Bearer gk_…"Idempotency#
Send an Idempotency-Key header (1–200 characters) when you create a dataset. Retrying with the same key and body returns the original result without another charge; reusing a key with a different body is refused.
Errors#
Errors are JSON { "error": "…" } with a status:
| 400 | Invalid input |
| 401 | Missing or revoked key |
| 402 | Usage limit reached |
| 403 | Not allowed on your plan |
| 404 | Not found, or not yours |
| 409 | Out of date, or not ready yet |
Create a dataset#
POST/api/dataset-graphs#
Send a request with an optional row count. Ground builds the tables in the background under your plan's usage limit.
requeststringrequired- What you need, in plain words.
rowsinteger- How many rows the main table should have. Leave it out to let Ground choose.
{ "request": "Customers, subscriptions and monthly invoices", "rows": 5000 }{ "id": "8d0f…", "version": "…", "jobId": "…", "status": "queued" }GET/api/dataset-graphs/{id}#
The dataset's current version, its tables and the state of its build. Poll it until the build finishes.
POST/api/dataset-graphs/{id}/confirm#
Give the go-ahead to a build that is waiting for confirmation.
Download#
GET/api/dataset-graphs/{id}/download#
Download one table as its file or several as a ZIP. Add ?version={version}&format=csv to download a specific saved version as CSV, or omit version for the current one. Use format=json to return download metadata.
GET/api/dataset-graphs/{id}/download/{table}#
One table.