SellGate API

Analytics API

Access store performance metrics and statistics

Analytics API

Retrieve comprehensive analytics data including revenue, orders, visitors, and more.

Get Analytics

GET /v1/analytics

Query Parameters

ParameterTypeDescription
periodstringTime period (default: 30d)

Available Periods

PeriodDescription
24hLast 24 hours
7dLast 7 days
30dLast 30 days
allAll time

Response

{
  "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
    }
  }
}

Example Request

curl -X GET "https://api.sellgate.cc/v1/analytics?period=30d" \
  -H "Authorization: Bearer sg_live_your_api_key"

Revenue Metrics

FieldTypeDescription
totalnumberTotal revenue in the period
change_percentnumberPercentage 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.


Order Metrics

FieldTypeDescription
totalintegerTotal orders in the period
completedintegerCompleted orders
pendingintegerPending + confirming orders
average_valuenumberAverage order value

Customer Metrics

FieldTypeDescription
uniqueintegerUnique customers (by email) in the period

Product Metrics

FieldTypeDescription
totalintegerTotal products in your store

Feedback Metrics

FieldTypeDescription
totalintegerTotal feedback received (all time)
average_ratingnumberAverage rating (1-5)
positive_countintegerReviews with rating >= 4

Visitor Metrics

FieldTypeDescription
countintegerTotal unique visitors in the period
page_viewsintegerTotal page views in the period

Period Comparison

When viewing analytics, the change_percent in revenue is calculated by comparing to the previous equivalent period:

Current PeriodCompared To
Last 24 hoursPrevious 24 hours
Last 7 daysPrevious 7 days
Last 30 daysPrevious 30 days
All timeN/A (shows 100% if revenue exists)

On this page