Query data

Prev Next
Post
/query/data/json

Execute a query to retrieve data from a specified data source

Security
HTTP
Type bearer

Bearer token authentication. Include the token in the Authorization header: Authorization: Bearer <your-token>

Body parameters
object
api_key
string

API key when not using an authorization header

schedule_id
string

Schedule ID for this query request. If not provided, one will be generated from other query parameters

ds_id
string Required

Target data source ID

ds_accounts

List of data source accounts the query should target, or a filter for them

OneOf
string
string
array
array
string
object
object
ds_segments

List of data source segment IDs the query should target

OneOf
string
string
array
array
string
ds_user
string

Shorthand parameter to provide one value for ds_users

ds_users

List of data source login usernames to limit when searching for suitable authentication

OneOf
string
string
array
array
string
date_range_type
string

Type of date range the query should use

start_date
string

Fixed or relative start date for your query

end_date
string

Fixed or relative end date for your query

compare_type
string

Date range comparison type. Defaults to none

compare_show
string

When compare_type is custom, display type for comparison values

compare_start_date
string

When compare_type is custom, fixed or relative start date for comparison

compare_end_date
string

When compare_type is custom, fixed or relative end date for comparison

fields

Target data source fields the query should return

OneOf
string
string
array
array
string
array
array
object
settings
object

Settings that should be applied when performing the query

filter
string

Filter string that should be applied to the results

order_columns
string

Order instruction for fields that are split by column

order_rows

List of order fields and sort directions for result rows

OneOf
string
string
array
array
string
max_columns
integer

Maximum number of columns the query results should contain

max_rows
integer

Maximum number of rows the query results should contain

offset_start
integer

Starting row index for paginated response

offset_end
integer

Ending row index for paginated response

cache_minutes
integer

Maximum allowed age of query results cache in minutes

sync_timeout
integer

Number of seconds the API should wait for query to finish

Responses
200

Query executed successfully

Expand All
object
meta
object
request_id
string

API request ID

schedule_id
string

Custom or generated schedule ID for the query

status_code
string

Status code for the query

query
object
start_date
string

Query start date in YYYY-MM-DD format

end_date
string

Query end date in YYYY-MM-DD format

ds_accounts
Array of string

Data source account IDs used in the query

string
ds_segments
Array of string

Data source segment IDs used in the query

string
fields
Array of object
object
id
string

Field ID from the request

field_id
string

Field ID the API uses

field_name
string

Field name

field_type
string

Field type

field_split
string

Field split by type

data_type
string

Field data type

data_column
integer

Field value position in each data row

visible
boolean

Whether data for this field is visible

compare_type
string

Date range comparison type used

compare_show
string

Display type for comparison values

compare_start_date
string

Start date for comparison date range

compare_end_date
string

End date for comparison date range

settings
object

Settings used in query

cache_minutes
integer

Requested maximum age of cache in minutes

result
object
total_columns
integer

Total amount of columns

total_rows
integer

Total amount of rows in data

run_seconds
number (float)

Number of seconds it took for the query to run

data_sampled
boolean

If data source has provided sampled data

cache_used
boolean

If cached data was used

cache_time
string (date-time)

ISO 8601 datetime for the most recent cached data

paginate
object
prev
string

URL to previous offset

next
string

URL to next offset

data
Array of array

Query result rows

Array of string
string