Skip to main content
POST
/
api
/
v1
/
data_sources
/
{data_source_id}
/
query
Execute a SQL query against a data source
curl --request POST \
  --url https://app.datafold.com/api/v1/data_sources/{data_source_id}/query \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "query": "<string>"
}
'
{
  "rows": [
    {}
  ],
  "columns": [
    {
      "name": "<string>",
      "db_type": "<string>",
      "description": "<string>",
      "is_nullable": true,
      "number": 123,
      "type": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

Use the 'Authorization' header with the format 'Key '

Path Parameters

data_source_id
integer
required

Body

application/json
query
string
required

SQL query to execute

Response

Successful Response

rows
Rows · object[]
required
columns
ApiQueryColumn · object[] | null