The Analytics API provides programmatic access to the same financial metrics shown in the Sellfern Analytics dashboard, including revenue, COGS, margins, and order counts. Use it to build reporting automation, feed data into external BI tools, or power agent-driven summaries. All analytics endpoints require theDocumentation Index
Fetch the complete documentation index at: https://docs.sellfern.com/llms.txt
Use this file to discover all available pages before exploring further.
analytics:read scope when called with an API token.
GET /api/v2/analytics/summary
Get an aggregated revenue and profit summary for a time period. This endpoint returns a fixed-shape response that is easy for scripts and agents to parse reliably. Required scope:analytics:read
Query parameters
A preset time period. Accepted values:
last_7_days, last_30_days, mtd (month-to-date), ytd (year-to-date).Start of a custom date range (ISO 8601, e.g.
2026-01-01). Use start_date and end_date together as an alternative to period.End of a custom date range (ISO 8601, e.g.
2026-01-31).Filter results to a specific store by its numeric ID.
IANA timezone string used to interpret date boundaries (e.g.
America/New_York).Example
Response fields
The period label returned (matches the
period parameter, or custom for date-range requests).The start date of the reporting window (ISO 8601).
The end date of the reporting window (ISO 8601).
Total gross revenue for the period.
Number of orders included in the period.
Total cost of goods sold for the period.
Gross profit (revenue minus COGS).
Gross margin as a percentage (gross_profit / revenue × 100).
The summary endpoint reflects product COGS only. Operating expenses such as Etsy fees, advertising spend, and other overhead tracked separately in the Sellfern UI are not included in
cogs or gross_profit unless they have been assigned as order-level costs.GET /api/v2/analytics/by-store
Get analytics broken down by individual store. Returns a flat array where each entry represents one store’s metrics for the requested period. Required scope:analytics:read
Query parameters
A preset time period. Accepted values:
last_7_days, last_30_days, mtd, ytd.IANA timezone string used to interpret date boundaries (e.g.
America/Chicago).