Query SQL Documentation

Methods

Execute SQL query against latest dataset version, via GET

GET /sql/{owner}/{id}

Execute SQL query against latest dataset version, via POST. This is good when you have a query string too long to pass via a URL.

POST /sql/{owner}/{id}

Parameters

Parameters:

Parameter Description Parameter Type Data Type
owner Dataset owner username. Included in data.world dataset URL path, after domain.
For example, jonloyens in https://data.world/jonloyens/an-intro-to-dataworld-dataset
path string
id Dataset id. Included in data.world dataset URL, after owner's username.
For example, an-intro-to-dataworld-dataset in https://data.world/jonloyens/an-intro-to-dataworld-dataset
path string
query SQL query.

Example value:
SELECT * FROM DataDotWorldBBallStats LIMIT 100
query string
parameters query string
maxQueryTimeMillis Timeout time. Default 120000 query integer

Response formats

  • application/json (default)
  • text/csv

Errors

HTTP Status Code Reason
400 Bad Request
404 Not found

Error Response Model:

{
  "code": 0,
  "message": "string",
  "details": "string"
}

Request URL:

https://query.data.world/sql/jonloyens/an-intro-to-dataworld-dataset?query=SELECT%20*%20FROM%20%60DataDotWorldBBallStats%60%20LIMIT%20100

cURL:

curl 'https://query.data.world/sql/jonloyens/an-intro-to-dataworld-dataset' \
  -H 'Authorization: Bearer <API TOKEN>'\
  -H 'Accept: text/csv'\
  --data-urlencode 'query=SELECT * FROM `DataDotWorldBBallStats` LIMIT 100'

Response Body:

Name,PointsPerGame,AssistsPerGame
Jon,20.4,1.3
Rob,15.5,8
Sharon,30.1,11.2
Alex,8.2,0.5
Rebecca,12.3,17
Ariane,18.1,3
Bryon,16,8.5
Matt,13,2.1

results matching ""

    No results matching ""