Home › Docs › Analytics API

Analytics API

Endpoints for querying sales data, revenue metrics, customer growth, and product performance across your hubs. All amounts are in cents.

GET /gross_revenue

Get total gross revenue for a hub by timeframe.

Version 1
URL https://tina-api.venhub.com/api/v1/owners/gross_revenue/
Auth API Key or Firebase
Required Scope analytics:read

Example Request

cURL
curl -X GET \
  "https://tina-api.venhub.com/api/v1/owners/gross_revenue/?hub_id=123&timeframe=monthly" \
  --header "X-API-Key: vh_abc123..."

Parameters

ParameterTypeRequiredDescription
hub_id Integer Required Hub ID to retrieve revenue for
timeframe String Optional Time window for revenue aggregation. One of: "daily", "weekly", "monthly". Omit for all-time total.

Response

JSON — 200 OK
{
  "gross_revenue": 125000
}
GET /total_orders

Get total count of orders for a hub.

Version 1
URL https://tina-api.venhub.com/api/v1/owners/total_orders/
Auth API Key or Firebase
Required Scope analytics:read

Example Request

cURL
curl -X GET \
  "https://tina-api.venhub.com/api/v1/owners/total_orders/?hub_id=123" \
  --header "X-API-Key: vh_abc123..."

Parameters

ParameterTypeRequiredDescription
hub_id Integer Required Hub ID to retrieve order count for

Response

JSON — 200 OK
{
  "total_orders": 1250
}
GET /total_products

Get total count of products stocked in a hub.

Version 1
URL https://tina-api.venhub.com/api/v1/owners/total_products/
Auth API Key or Firebase
Required Scope analytics:read

Example Request

cURL
curl -X GET \
  "https://tina-api.venhub.com/api/v1/owners/total_products/?hub_id=123" \
  --header "X-API-Key: vh_abc123..."

Parameters

ParameterTypeRequiredDescription
hub_id Integer Required Hub ID to retrieve product count for

Response

JSON — 200 OK
{
  "total_products": 150
}
GET /total_customers

Get total count of unique customers for a hub.

Version 1
URL https://tina-api.venhub.com/api/v1/owners/total_customers/
Auth API Key or Firebase
Required Scope analytics:read

Example Request

cURL
curl -X GET \
  "https://tina-api.venhub.com/api/v1/owners/total_customers/?hub_id=123" \
  --header "X-API-Key: vh_abc123..."

Parameters

ParameterTypeRequiredDescription
hub_id Integer Required Hub ID to retrieve customer count for

Response

JSON — 200 OK
{
  "total_customers": 850
}
GET /top_products

Get bestselling products ranked by sales volume.

Version 1
URL https://tina-api.venhub.com/api/v1/owners/top_products/
Auth API Key or Firebase
Required Scope analytics:read

Example Request

cURL
curl -X GET \
  "https://tina-api.venhub.com/api/v1/owners/top_products/?hub_id=123" \
  --header "X-API-Key: vh_abc123..."

Parameters

ParameterTypeRequiredDescription
hub_id Integer Required Hub ID to retrieve top products for

Response

JSON — 200 OK
[
  ["Organic Apple", 350, "https://storage.example.com/products/apple.jpg"],
  ["Milk 1 Gallon", 280, "https://storage.example.com/products/milk.jpg"]
]
GET /hubs/{hub_id}/top-categories

Get top product categories ranked by items sold.

Version 1
URL https://tina-api.venhub.com/api/v1/owners/hubs/{hub_id}/top-categories
Auth API Key or Firebase
Required Scope analytics:read

Example Request

cURL
curl -X GET \
  "https://tina-api.venhub.com/api/v1/owners/hubs/123/top-categories" \
  --header "X-API-Key: vh_abc123..."

Parameters

ParameterTypeLocationRequiredDescription
hub_id Integer Path Required Hub ID to retrieve top categories for

Response

JSON — 200 OK
[
  { "name": "Produce", "revenue_cents": 359400, "units_sold": 1200 },
  { "name": "Dairy", "revenue_cents": 424150, "units_sold": 850 }
]
GET /weekly_sales_breakdown

Get daily sales breakdown for the current week.

Version 1
URL https://tina-api.venhub.com/api/v1/owners/weekly_sales_breakdown/
Auth API Key or Firebase
Required Scope analytics:read

Example Request

cURL
curl -X GET \
  "https://tina-api.venhub.com/api/v1/owners/weekly_sales_breakdown/?hub_id=123" \
  --header "X-API-Key: vh_abc123..."

Parameters

ParameterTypeRequiredDescription
hub_id Integer Required Hub ID to retrieve weekly breakdown for

Response

JSON — 200 OK
[
  ["Monday", 15000],
  ["Tuesday", 18500]
]
GET /earnings-and-profits-ytd

Get monthly earnings and profit year-to-date.

Version 1
URL https://tina-api.venhub.com/api/v1/owners/earnings-and-profits-ytd/
Auth API Key or Firebase
Required Scope analytics:read

Example Request

cURL
curl -X GET \
  "https://tina-api.venhub.com/api/v1/owners/earnings-and-profits-ytd/?hub_id=123" \
  --header "X-API-Key: vh_abc123..."

Parameters

ParameterTypeRequiredDescription
hub_id Integer Required Hub ID to retrieve YTD earnings for

Response

JSON — 200 OK
{
  "monthly_data": [
    {
      "month": "January",
      "total_earnings": 125000,
      "total_cost": 80000,
      "total_profit": 45000
    },
    {
      "month": "February",
      "total_earnings": 118000,
      "total_cost": 75500,
      "total_profit": 42500
    }
  ],
  "highest_earning": 125000,
  "highest_cost": 80000,
  "highest_profit": 45000
}
GET /customer-growth

Get monthly unique customer counts for the current year.

Version 1
URL https://tina-api.venhub.com/api/v1/owners/customer-growth/
Auth API Key or Firebase
Required Scope analytics:read

Example Request

cURL
curl -X GET \
  "https://tina-api.venhub.com/api/v1/owners/customer-growth/?hub_id=123" \
  --header "X-API-Key: vh_abc123..."

Parameters

ParameterTypeRequiredDescription
hub_id Integer Required Hub ID to retrieve customer growth for

Response

JSON — 200 OK
{
  "customer_growth": [
    { "month": "January", "unique_customers": 800 },
    { "month": "February", "unique_customers": 852 }
  ]
}
GET /monthly_sales_comparison

Compare monthly sales between current and previous year.

Version 1
URL https://tina-api.venhub.com/api/v1/owners/monthly_sales_comparison/
Auth API Key or Firebase
Required Scope analytics:read

Example Request

cURL
curl -X GET \
  "https://tina-api.venhub.com/api/v1/owners/monthly_sales_comparison/?hub_id=123" \
  --header "X-API-Key: vh_abc123..."

Parameters

ParameterTypeRequiredDescription
hub_id Integer Required Hub ID to retrieve year-over-year comparison for

Response

JSON — 200 OK
{
  "current_year": [125000, 118000],
  "previous_year": [98000, 102000]
}
ℹ️
Index 0 is January, index 1 is February, and so on — match positions across the two arrays to compare a given month.
GET /get_sales_overview

Get sales overview across timeframes (daily, weekly, monthly, yearly).

Version 1
URL https://tina-api.venhub.com/api/v1/owners/get_sales_overview/
Auth API Key or Firebase
Required Scope analytics:read

Example Request

cURL
curl -X GET \
  "https://tina-api.venhub.com/api/v1/owners/get_sales_overview/?hub_id=123" \
  --header "X-API-Key: vh_abc123..."

Parameters

ParameterTypeRequiredDescription
hub_id Integer Required Hub ID to retrieve the sales overview for
GET /monthly_net_profit_breakdown

Get monthly net profit breakdown after costs.

Version 1
URL https://tina-api.venhub.com/api/v1/owners/monthly_net_profit_breakdown/
Auth API Key or Firebase
Required Scope analytics:read

Example Request

cURL
curl -X GET \
  "https://tina-api.venhub.com/api/v1/owners/monthly_net_profit_breakdown/?hub_id=123" \
  --header "X-API-Key: vh_abc123..."

Parameters

ParameterTypeRequiredDescription
hub_id Integer Required Hub ID to retrieve net profit breakdown for

Response

JSON — 200 OK
{
  "gross_revenue": 125000,
  "cost_of_goods": 75000,
  "net_profit": 50000
}
GET /monthly_sales_breakdown_for_product

Get monthly sales history for a specific product by UPC.

Version 1
URL https://tina-api.venhub.com/api/v1/owners/monthly_sales_breakdown_for_product/
Auth API Key or Firebase
Required Scope analytics:read

Example Request

cURL
curl -X GET \
  "https://tina-api.venhub.com/api/v1/owners/monthly_sales_breakdown_for_product/?hub_id=123&product_upc=012345678901" \
  --header "X-API-Key: vh_abc123..."

Parameters

ParameterTypeRequiredDescription
hub_id Integer Required Hub ID to retrieve product sales for
product_upc String Required Product UPC barcode