Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi all,
We’re currently trying to use the ShopifyQL Analytics API on a Shopify Plus store via a custom private app. Although the app has the read_analytics scope and the store is confirmed to be on Plus, every request to the /shopifyql/queries.json endpoint returns a 406 Not Acceptable response, with an empty body.
Context:
Tested query:
FROM sales
SHOW total_sales
GROUP BY day
LIMIT 1
Headers used:
Content-Type: application/json
Accept: application/json
X-Shopify-Access-Token: [valid token]
Reproduction: Google Apps Script Example
If anyone wants to replicate this, here's a minimal test script you can use in Google Sheets → Extensions → Apps
Script:
function testShopifyQL() {
const shop = "your-store.myshopify.com";
const accessToken = "your_access_token";
const apiVersion = "2024-04";
const query = FROM sales SHOW total_sales GROUP BY day LIMIT 1 ;
const url = https://${shop}/admin/api/${apiVersion}/shopifyql/queries.json;
const options = {
method: "post",
headers: {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Shopify-Access-Token": accessToken
},
payload: JSON.stringify({ query }),
muteHttpExceptions: true
};
const response = UrlFetchApp.fetch(url, options);
Logger.log("HTTP status: " + response.getResponseCode());
Logger.log("Raw response: " + response.getContentText());
}
Observed Behavior
Returns:
HTTP status: 406
Raw response: (empty)
The same token works fine for /orders.json and /access_scopes.json
We also confirmed the token scopes using this helper script:
function checkTokenScopes() {
const shop = "your-store.myshopify.com";
const accessToken = "your_access_token";
const url = https://${shop}/admin/oauth/access_scopes.json;
const options = {
method: "get",
headers: {
"X-Shopify-Access-Token": accessToken,
"Accept": "application/json"
},
muteHttpExceptions: true
};
const response = UrlFetchApp.fetch(url, options);
Logger.log("HTTP status: " + response.getResponseCode());
Logger.log("Response: " + response.getContentText());
}
Request for Help:
Does anyone know if ShopifyQL Analytics must be manually enabled per store, even if:
We've contacted support and suspect the feature isn't provisioned yet — but would appreciate:
Thanks in advance!
Hi @jnellers1 ,
Yes, ShopifyQL Analytics must be manually enabled per store, even if:
The store is on Shopify Plus
The app has the read_analytics scope
All other Admin API calls are working correctly
To use ShopifyQL Analytics, the ShopifyQL Notebooks app must be manually installed on each store , even if you're on Shopify Plus and have the correct read analytics scope. Only after installation can you access shopifyql.api for analytics queries.
Thanks !
Hi @StevenT_A7 , thanks for the info! I tried finding the ShopifyQL Notebooks app but it doesn't appear to exist any more:
https://apps.shopify.com/shopifyql-notebooks
Do you know if this is still the right solution or how I can get it?
Thanks
James
Hi @jnellers1 ,
Please accept my apologies for the previous solution provided.
Currently, although the ShopifyQL Notebooks application is not available, you can still access and utilize ShopifyQL through the Shopify Admin API, assuming you possess the requisite permissions and scopes. This will enable you to execute queries and retrieve analytics data programmatically.
Please refer to this link :- https://help.shopify.com/en/manual/reports-and-analytics/shopify-reports/report-types/shopifyql-edit...
Should your store be on Shopify Plus, I recommend verifying whether it includes access to any integrated analytics tools that employ ShopifyQL.
For the most up-to-date details regarding the availability of ShopifyQL Notebooks or any potential alternatives, please do not hesitate to contact Shopify Support.
Thanks !
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025