shopify_shopifyql
Run ShopifyQL analytics queries on Shopify store data to extract metrics such as sales, orders, sessions, and customer insights.
Instructions
Run a ShopifyQL analytics query against a Shopify store.
ShopifyQL is Shopify's SQL-like reporting language. Requires read_reports
scope. Consumes the same cost bucket as GraphQL.
Syntax: FROM SHOW [, ...] [BY ] [GROUP BY ] [WHERE ] [SINCE -Nd UNTIL today] [ORDER BY [ASC|DESC]] [LIMIT N]
Datasets: sales, orders, products, customers, inventory, sessions. Time tokens: -Nd / -Nw / -Nm / -Nq / -Ny, or named (today, yesterday, this_week, last_week, this_month, last_month, last_year).
Examples:
FROM sales SHOW total_sales GROUP BY day SINCE -7d UNTIL today ORDER BY day ASCFROM sales SHOW total_sales BY product_title ORDER BY total_sales DESC LIMIT 10 SINCE -30dFROM sales SHOW returning_customer_rate GROUP BY month SINCE -6mFROM sales SHOW net_sales SINCE -1q UNTIL todayFROM sessions SHOW sessions, conversion_rate GROUP BY referrer_source SINCE -14d
Returns tableData.columns, tableData.rows, and parseErrors.
When parsing fails, tableData is null and parseErrors contains
a list of human-readable error strings (e.g. "Column 'total_sale' not found").
Args: query: ShopifyQL query string. shop: Store alias or domain. Required when multiple stores are configured. api_version: Override API version (default "2026-04").
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| shop | No | ||
| query | Yes | ||
| api_version | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |