Execute Custom SQL Query

Run custom SQL queries for structured data retrieval. The response returns the query results in a JSON format.

📘

Running your Query in SQL Builder

If you wish to run your query using the SQL Builder interface rather than via API (e.g. for testing or data exploration), replace @startDate and @endDate (camelCase) with @start_date and @end_date (snake_case) in the SQL expression.

🚧

Best Practices

Select Specific Columns

Avoid using SELECT * in your queries. Our schema is dynamic, and using wildcard selection can lead to broken or inconsistent results as fields change. Always specify the exact columns you need.

Rate Limits

The API enforces two rate limits:

  • 100 requests per second
  • 600 requests per minute

If you exceed these quotas, the API will return a 429 Too Many Requests error.

🤔

Compare with Data Warehouse Export

Use Data Warehouse Export instead if you want to push data directly to BigQuery, Snowflake, AWS S3, or GCS.

Body Params
string
required

The shop domain for which you are requesting data (e.g., example.myshopify.com).

string
required

The SQL query string to execute. Include dynamic @startDate AND @endDate parameters in your query string, and provide specific start and end values in the request body via period.startDate and period.endDate.

string

The currency for data aggregation (e.g., USD, EUR). Defaults to the currency provided during user account registration.

period
object
required

The date range for the query period.

Responses

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json