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)
{
"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
| Name | Type | Description |
|---|---|---|
storerequired | string | the store ref `<store>-<CC>` (name-country, e.g. 'myStore-US') — one of get_user_context's store_refs, verbatim. |
queryrequired | string | the 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. |
paginationToken | string | the DONE query's data.result.pagination.nextToken (from dataKiosk_getQuery); omit for the first page. |
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.