Statistics API
Overview
Section titled “Overview”Pull real-time campaign performance data, daily breakdowns, and custom date-range reports.
Authentication
Section titled “Authentication”All endpoints require either a JWT token or an API key (gf_...) in the Authorization header.
Endpoints
Section titled “Endpoints”| Method | Path | Scope | Description |
|---|---|---|---|
| GET | /api/v1/reports/dashboard | read:stats | Dashboard summary |
| GET | /api/v1/reports | read:stats | Custom reports with filters |
| GET | /api/v1/reports/charts | read:stats | Chart data for visualizations |
| GET | /api/v1/reports/export | read:stats | Export report as CSV |
Filters
Section titled “Filters”Reports support the following query parameters:
| Parameter | Type | Description |
|---|---|---|
from | ISO 8601 date | Start date |
to | ISO 8601 date | End date |
campaign_id | UUID | Filter by campaign |
source_id | UUID | Filter by source |
group_by | string | Grouping: day, campaign, source, geo |
Examples
Section titled “Examples”Dashboard Summary
Section titled “Dashboard Summary”curl "https://devcore.getghostflow.io/api/v1/reports/dashboard?from=2025-06-01&to=2025-06-30" \ -H "Authorization: Bearer gf_your_api_key"const params = new URLSearchParams({ from: '2025-06-01', to: '2025-06-30' });const response = await fetch( `https://devcore.getghostflow.io/api/v1/reports/dashboard?${params}`, { headers: { 'Authorization': `Bearer ${API_KEY}` } },);const dashboard = await response.json();import requests
resp = requests.get( "https://devcore.getghostflow.io/api/v1/reports/dashboard", headers={"Authorization": f"Bearer {api_key}"}, params={"from": "2025-06-01", "to": "2025-06-30"},)dashboard = resp.json()Export to CSV
Section titled “Export to CSV”curl "https://devcore.getghostflow.io/api/v1/reports/export?from=2025-06-01&to=2025-06-30&group_by=day" \ -H "Authorization: Bearer gf_your_api_key" \ -o report.csv