API reference
Analytics
Get an analytics summary
/api/v1/analytics/summary
Revenue, orders, product views, conversion (orders per view), and new customers over the last `days`, each with the window before it and the relative change (0.12 is +12%). Revenue leaves out refunded orders.
- Scope
- MCP tool
- analytics_summary
- Changes data
- No
Parameters
| Name | Type | Description |
|---|---|---|
daysquery · optional | integer | Window in days, 1-365 |
Request
curl "https://3commerce.com/api/v1/analytics/summary" \
-H "Authorization: Bearer 3c_live_…"Response
{
"days": 30,
"revenue": {
"value": 4630,
"previous": 3985,
"change": 0.1619
},
"orders": {
"value": 41,
"previous": 36,
"change": 0.1389
},
"views": {
"value": 2860,
"previous": 2410,
"change": 0.1867
},
"conversion": {
"value": 0.0143,
"previous": 0.0149,
"change": -0.0403
},
"new_customers": {
"value": 18,
"previous": 0,
"change": null
}
}Get revenue over time
/api/v1/analytics/revenue
Revenue and order count per day or per week over the last `days`, oldest first, with every bucket present even when empty. Revenue leaves out refunded orders. Times are UTC.
- Scope
- MCP tool
- analytics_revenue
- Changes data
- No
Parameters
| Name | Type | Description |
|---|---|---|
daysquery · optional | integer | Window in days, 1-365 |
intervalquery · optional | enum | Bucket size. Defaults to `day` up to 30 days and `week` beyond |
Request
curl "https://3commerce.com/api/v1/analytics/revenue" \
-H "Authorization: Bearer 3c_live_…"Response
{
"days": 7,
"interval": "day",
"data": [
{
"date": "2026-11-19",
"revenue": 212,
"orders": 2
},
{
"date": "2026-11-20",
"revenue": 0,
"orders": 0
}
]
}Get traffic by source and device
/api/v1/analytics/traffic
Product page views over the last `days`, broken down by source (such as `direct`, `instagram`, `search`) and by device, each with its share of the total from 0 to 1.
- Scope
- MCP tool
- analytics_traffic
- Changes data
- No
Parameters
| Name | Type | Description |
|---|---|---|
daysquery · optional | integer | Window in days, 1-365 |
Request
curl "https://3commerce.com/api/v1/analytics/traffic" \
-H "Authorization: Bearer 3c_live_…"Response
{
"days": 30,
"total_views": 2860,
"by_source": [
{
"source": "instagram",
"views": 1210,
"share": 0.4231
},
{
"source": "direct",
"views": 860,
"share": 0.3007
}
],
"by_device": [
{
"device": "mobile",
"views": 1990,
"share": 0.6958
},
{
"device": "desktop",
"views": 870,
"share": 0.3042
}
]
}Get top products
/api/v1/analytics/top-products
The products that earned the most over the last `days`, with units sold and revenue, highest revenue first. Refunded orders do not count.
- Scope
- MCP tool
- analytics_top_products
- Changes data
- No
Parameters
| Name | Type | Description |
|---|---|---|
daysquery · optional | integer | Window in days, 1-365 |
limitquery · optional | integer | How many products, 1-50 |
Request
curl "https://3commerce.com/api/v1/analytics/top-products" \
-H "Authorization: Bearer 3c_live_…"Response
{
"days": 30,
"data": [
{
"id": "5a3b9c1d-6e2f-4a8b-b0c4-2d7e9f1a3b65",
"slug": "merino-crew-sweater",
"title": "Merino crew sweater",
"image": "https://images.example.com/merino-crew.jpg",
"units": 14,
"revenue": 1372
}
]
}Get the conversion funnel
/api/v1/analytics/funnel
How many sessions reached each step over the last `days`: viewed a product, added to the cart, started checkout, purchased. The same figures as the dashboard’s Analytics page.
- Scope
- MCP tool
- analytics_funnel
- Changes data
- No
Parameters
| Name | Type | Description |
|---|---|---|
daysquery · optional | integer | Window in days, 1-365 |
Request
curl "https://3commerce.com/api/v1/analytics/funnel" \
-H "Authorization: Bearer 3c_live_…"Response
{
"days": 30,
"from": "2026-10-29",
"to": "2026-11-27",
"steps": [
{
"event": "view_item",
"label": "Viewed a product",
"sessions": 1840
},
{
"event": "add_to_cart",
"label": "Added to cart",
"sessions": 212
},
{
"event": "begin_checkout",
"label": "Started checkout",
"sessions": 88
},
{
"event": "purchase",
"label": "Purchased",
"sessions": 41
}
]
}Get session sources
/api/v1/analytics/sources
Sessions over the last `days` by where they came from, such as `instagram` or `google`, most first. A session with no attributed source is `direct`.
- Scope
- MCP tool
- analytics_sources
- Changes data
- No
Parameters
| Name | Type | Description |
|---|---|---|
daysquery · optional | integer | Window in days, 1-365 |
Request
curl "https://3commerce.com/api/v1/analytics/sources" \
-H "Authorization: Bearer 3c_live_…"Response
{
"days": 30,
"from": "2026-10-29",
"to": "2026-11-27",
"sources": [
{
"label": "instagram",
"value": 920
},
{
"label": "direct",
"value": 610
}
]
}