Get Sales Data Programmatically

Topic summary

Goal: Fetch Shopify sales data (e.g., top products sold in the last 1–3 months) hourly and store it in Algolia to drive product sorting.

Approach consensus:

  • Create a private Shopify app and use the Admin APIs—primarily the Orders API—to pull raw order data and compute sales metrics yourself.
  • The Reports API only returns report definitions; it doesn’t expose underlying report data. ShopifyQL in reports isn’t directly executable via the API.

Alternatives/scale:

  • GraphQL bulk queries can export large datasets (JSONL), but expect rate limits and multi-call workflows.
  • One implementation uses AWS (scheduled jobs) to refresh via Shopify API, optionally streaming through Kinesis, then pushing to Algolia.

Implementation notes:

  • Node packages exist to streamline Shopify API access.
  • You won’t get all required metrics in a single call; combine endpoints and perform aggregations.

Latest updates:

  • Recommendation reaffirmed to start with the Orders API and documentation.
  • A third-party app (Report Toaster) and service assistance were offered for automation.

Status: Ongoing. Exact API mix and any ShopifyQL execution method remain unanswered; action is to build around Orders API or consider bulk GraphQL with rate-limit handling.

Summarized with AI on February 4. AI used: gpt-5.

Hi @Mandelbrotian ,

Which API to exactly hit in your case that can give us this sales data

We tried with Shopify Reports API but that gives us the Report information but not the actual data inside of the report

We do get a shopify ql attribute there. Can you let us know how we can execute that query to get the information?

Or is there other API exposed by Shopify that gives us this information in JSON or some other format?