Get the analytics summary
const url = 'https://apibase.ecomweb.app/api/v1/stores/example/analytics/summary?period=day&start_date=2025-01-01&end_date=2025-01-31';const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://apibase.ecomweb.app/api/v1/stores/example/analytics/summary?period=day&start_date=2025-01-01&end_date=2025-01-31' \ --header 'x-api-key: <x-api-key>'Returns key metrics, growth rates, top products, payment methods, geographic distribution and a time series. Pass start_date and end_date together for a custom range, both inclusive and at most 5 years long, and not in the future; growth is then measured against the window of equal length immediately before it. With neither, the period parameter decides the window.
Required scopes: read:analytics
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The store’s ref, as returned by GET /stores.
Query Parameters
Section titled “Query Parameters”Reporting window when no custom range is given: day covers the last 30 days, week the last 12 weeks, month the last 12 months and year the last 5 years. Growth compares it with the window of equal length before it.
Example
2025-01-01Start of a custom range. A YYYY-MM-DD calendar date is read as the first instant of that day in the store timezone; a full timestamp is taken as given.
Example
2025-01-31End of a custom range, inclusive. A YYYY-MM-DD calendar date is read as the LAST instant of that day in the store timezone, so the same date at both ends covers that whole day.
Responses
Section titled “Responses”object
Customers on the store’s customer list who ordered in the period, as a percentage of all customers in the store. NOT a conversion rate: no session data is collected, so a true conversion rate is not computable.
Misnamed alias of customer_activity_rate. Prefer that field.
The best-selling products of the period, at most 10.
object
Image URL of the product, or null.
Product ID, as a string.
Product name.
Revenue from the product in the period, in the store currency.
Orders that contain the product.
Sum of line quantities in the period. total_orders counts orders.
Average revenue per order that contains the product.
Revenue split by payment method.
object
Payment method, as recorded on the orders.
Orders paid with the method.
Revenue from those orders, in the store currency.
Share of the period’s revenue, as a percentage from 0 to 100.
Revenue split by shipping city, at most 15 cities.
object
Shipping city, or Unknown for orders without one.
Orders shipped to the city.
Revenue from those orders, in the store currency.
Share of the period’s revenue, as a percentage from 0 to 100.
Orders, revenue and customers over time. It always covers the window of period, even when a custom range is given.
object
Start of the bucket: YYYY-MM-DD for day, IYYY-IW (ISO year and week) for week, YYYY-MM for month and YYYY for year.
Revenue of the bucket, in the store currency.
Orders placed in the bucket.
Distinct customers who ordered in the bucket.
Revenue in the period, in the store currency. Cancelled, refunded and voided orders are excluded.
Orders in the period.
Distinct customers who ordered in the period, guest checkouts included.
Active products in the store right now, whatever the period.
Change in revenue against the previous window, as a percentage. 100 when the previous window had none and this one has some.
Change in orders against the previous window, as a percentage.
Change in customers against the previous window, as a percentage.
Average revenue per order in the period.
Example generated
{ "customer_activity_rate": 1, "conversion_rate": 1, "top_selling_products": [ { "image_url": "example", "id": "example", "name": "example", "total_revenue": 1, "total_orders": 1, "units_sold": 1, "avg_order_value": 1 } ], "payment_methods": [ { "method": "example", "count": 1, "total_revenue": 1, "percentage": 1 } ], "geographic_distribution": [ { "city": "example", "total_orders": 1, "total_revenue": 1, "percentage": 1 } ], "time_series_data": [ { "date": "example", "revenue": 1, "orders": 1, "customers": 1 } ], "total_revenue": 1, "total_orders": 1, "total_customers": 1, "total_products": 1, "revenue_growth": 1, "orders_growth": 1, "customers_growth": 1, "avg_order_value": 1}The request is malformed or failed validation.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}The key is missing, invalid, revoked or expired.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}The key may not do this: a missing scope, a readonly key, a publishable key on a Store API route, or a disallowed origin.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}