dataKiosk_createQuery

Submit a Data Kiosk GraphQL query; returns queryId at once.

readAmazon Seller (SP-API)sp.dataKiosk_2023-11-15

Poll dataKiosk_getQuery until processingStatus is DONE — it returns the result itself (data.result.documentContent); dataKiosk_getDocument only reads a FATAL query's errorDocumentId. When the DONE query reports data.result.pagination.nextToken, resubmit the SAME query string with it as paginationToken for the next page. Requires SP write access. Amazon SP-API · createQuery · POST /dataKiosk/2023-11-15/queries

Call it

In an AI client (MCP)

tools/call
{
  "name": "dataKiosk_createQuery",
  "arguments": {
    "store": "myStore-US",
    "query": "<query>"
  }
}

From code (Tool API)

curl -X POST https://api.sellersheetai.com/api/v1/tools/dataKiosk_createQuery \
  -H "Authorization: Bearer $SELLERSHEET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"store":"myStore-US","query":"<query>"}'
Early access — the Tool API is open on request, contact us.

Arguments

NameTypeDescription
storerequiredstringthe store ref `<store>-<CC>` (name-country, e.g. 'myStore-US') — one of get_user_context's store_refs, verbatim.
queryrequiredstringthe GraphQL query string, ≤8,000 chars. Pick a versioned root type, then a dataset field under it — analytics_salesAndTraffic_2024_04_24 (salesAndTrafficByDate, salesAndTrafficByAsin, salesAndTrafficTrends), analytics_economics_2024_03_15 (economics, economicsPreview, economicsSimulation), analytics_vendorAnalytics_2024_09_30 (manufacturingView, sourcingView); the 2023_11_15 sales root is deprecated. Example, daily sales for one month — 'query { analytics_salesAndTraffic_2024_04_24 { salesAndTrafficByDate(aggregateBy: DAY, startDate: "2026-07-01", endDate: "2026-07-31", marketplaceIds: ["A2VIGQ35RCS4UG"]) { startDate endDate sales { orderedProductSales { amount currencyCode } unitsOrdered } traffic { sessions pageViews } } } }'. startDate is at most two years back. The GraphQL query to submit. A query must be at most 8000 characters after unnecessary whitespace is removed.
paginationTokenstringthe DONE query's data.result.pagination.nextToken (from dataKiosk_getQuery); omit for the first page. A token to fetch a certain page of query results when there are multiple pages of query results available. The value of this token must be fetched from the pagination.nextToken field of the Query object, and the query field for this object must also be set to the query field of the same Query object. A Query object can be retrieved from either the getQueries or getQuery operation. In the absence of this token value, the first page of query results will be requested.

Result

Every tool answers {notification, data, human_action}; data carries:

  • data.queryId — poll it with dataKiosk_getQuery.
  • data.marketplaceId — the store's marketplace id — the value the query must name.

Gotchas

  • The marketplace is named INSIDE the query and the spelling differs per dataset field (a wrong one ends FATAL) — a list argument marketplaceIds: [String!]! on salesAndTrafficByDate, salesAndTrafficByAsin, economics and economicsPreview; a singular marketplaceId: String! on economicsSimulation; per filter inside filters: [MarketplaceAsinFilter!]! on salesAndTrafficTrends (no marketplaceIds argument); none at all on manufacturingView and sourcingView (args exactly aggregateBy, currencyCode, endDate, startDate). Aggregation is spelled differently per field — salesAndTrafficByDate aggregateBy DateGranularity! (DAY | WEEK | MONTH); salesAndTrafficByAsin aggregateBy AsinGranularity! (CHILD | PARENT | SKU); salesAndTrafficTrends takes asinAggregation (CHILD only) AND dateAggregation and has no aggregateBy; manufacturingView and sourcingView aggregateBy DateGranularity!; economics aggregateBy is an optional input OBJECT {date: DateGranularity, productId: ProductIdentifierGranularity} defaulting to DAY and MSKU (aggregateBy: DAY is a type error); economicsPreview likewise, its date enum EconomicsPreviewDateGranularity (RANGE only); economicsSimulation has none. Rate limit ~one submission a minute (0.0167 req/s, burst 15) — pace a pagination loop. The query and its documents are kept for the SHORTEST @resultRetention among the requested fields (commonly 30 days): download before then.

On this page

Actions

View as Markdown

Ask an assistant

Ask ChatGPTAsk Claude