Analytics API Access store performance metrics and statistics
Retrieve comprehensive analytics data including revenue, orders, visitors, and more.
Parameter Type Description periodstring Time period (default: 30d)
Period Description 24hLast 24 hours 7dLast 7 days 30dLast 30 days allAll time
{
"data" : {
"period" : "30d" ,
"revenue" : {
"total" : 15420.50 ,
"change_percent" : 12.5
},
"orders" : {
"total" : 342 ,
"completed" : 320 ,
"pending" : 15 ,
"average_value" : 45.12
},
"customers" : {
"unique" : 289
},
"products" : {
"total" : 24
},
"feedback" : {
"total" : 156 ,
"average_rating" : 4.7 ,
"positive_count" : 140
},
"visitors" : {
"count" : 12540 ,
"page_views" : 35820
}
}
}
curl -X GET "https://api.sellgate.cc/v1/analytics?period=30d" \
-H "Authorization: Bearer sg_live_your_api_key"
Field Type Description totalnumber Total revenue in the period change_percentnumber Percentage change from previous period
The change_percent compares the current period to the previous period of equal length. For example, with period=7d, it compares the last 7 days to the 7 days before that.
Field Type Description totalinteger Total orders in the period completedinteger Completed orders pendinginteger Pending + confirming orders average_valuenumber Average order value
Field Type Description uniqueinteger Unique customers (by email) in the period
Field Type Description totalinteger Total products in your store
Field Type Description totalinteger Total feedback received (all time) average_ratingnumber Average rating (1-5) positive_countinteger Reviews with rating >= 4
Field Type Description countinteger Total unique visitors in the period page_viewsinteger Total page views in the period
When viewing analytics, the change_percent in revenue is calculated by comparing to the previous equivalent period:
Current Period Compared To Last 24 hours Previous 24 hours Last 7 days Previous 7 days Last 30 days Previous 30 days All time N/A (shows 100% if revenue exists)