ShopifyQL Analytics API Returns 406 on Valid Request (Plus Store, read_analytics enabled)

ShopifyQL Analytics API Returns 406 on Valid Request (Plus Store, read_analytics enabled)

jnellers1
Shopify Partner
10 0 2

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:

 

  • Store: Shopify Plus (confirmed)
    API version: 2024-04
    Token: Valid, verified to include read_analytics scope


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:

  • The store is on Shopify Plus
  • The app has read_analytics scope
  • All other Admin API calls work correctly

 

We've contacted support and suspect the feature isn't provisioned yet — but would appreciate:

  • Confirmation from Shopify staff
  • Input from other Plus merchants who've used ShopifyQL Analytics successfully

Thanks in advance!

Replies 3 (3)

StevenT_A7
Explorer
161 13 17

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 !

 

 

 

 

Steven Taylor
302-260-8345
jnellers1
Shopify Partner
10 0 2

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

StevenT_A7
Explorer
161 13 17

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 ! 

Steven Taylor
302-260-8345