Analytics API
Access detailed analytics data programmatically for custom reporting and integrations.
Get Overview Metrics
GET
/v1/analytics/overviewcurl -X GET "https://api.chatmefy.com/v1/analytics/overview?period=30d" \
-H "Authorization: Bearer YOUR_API_KEY"
# Response
{
"data": {
"period": {
"start": "2024-01-01T00:00:00Z",
"end": "2024-01-31T23:59:59Z"
},
"conversations": {
"total": 12450,
"completed": 10890,
"handoff": 1560,
"trend": "+12.5%"
},
"messages": {
"total": 87240,
"avg_per_conversation": 7.0,
"trend": "+8.2%"
},
"leads": {
"total": 3420,
"qualified": 1890,
"conversion_rate": 27.5,
"trend": "+15.3%"
},
"satisfaction": {
"score": 4.6,
"responses": 2340,
"trend": "+0.2"
},
"response_time": {
"avg_ms": 1250,
"p95_ms": 2800,
"trend": "-5.1%"
}
}
}Period Options
24hLast 24 hours
7dLast 7 days
30dLast 30 days
90dLast 90 days
Time Series Data
GET
/v1/analytics/timeseriescurl -X GET "https://api.chatmefy.com/v1/analytics/timeseries?\
metric=conversations&\
period=7d&\
granularity=day" \
-H "Authorization: Bearer YOUR_API_KEY"
# Response
{
"data": {
"metric": "conversations",
"granularity": "day",
"points": [
{ "timestamp": "2024-01-08T00:00:00Z", "value": 412 },
{ "timestamp": "2024-01-09T00:00:00Z", "value": 458 },
{ "timestamp": "2024-01-10T00:00:00Z", "value": 389 },
{ "timestamp": "2024-01-11T00:00:00Z", "value": 521 },
{ "timestamp": "2024-01-12T00:00:00Z", "value": 445 },
{ "timestamp": "2024-01-13T00:00:00Z", "value": 312 },
{ "timestamp": "2024-01-14T00:00:00Z", "value": 287 }
]
}
}Available Metrics
conversationsTotal conversations startedmessagesMessages exchangedleadsLeads capturedhandoffsHuman handoff requestsresponse_timeAverage response time (ms)satisfactionSatisfaction score (1-5)Breakdown by Dimension
GET
/v1/analytics/breakdowncurl -X GET "https://api.chatmefy.com/v1/analytics/breakdown?\
metric=leads&\
dimension=source&\
period=30d" \
-H "Authorization: Bearer YOUR_API_KEY"
# Response
{
"data": {
"metric": "leads",
"dimension": "source",
"breakdown": [
{ "value": "/pricing", "count": 845, "percentage": 24.7 },
{ "value": "/features", "count": 612, "percentage": 17.9 },
{ "value": "/homepage", "count": 534, "percentage": 15.6 },
{ "value": "/demo", "count": 489, "percentage": 14.3 },
{ "value": "other", "count": 940, "percentage": 27.5 }
]
}
}Dimension Options
sourcePage URL where conversation startedbotBot that handled the conversationcountryVisitor's country (ISO code)deviceDevice type (desktop, mobile, tablet)browserBrowser family (Chrome, Safari, etc.)campaignUTM campaign parameterFunnel Analysis
GET
/v1/analytics/funnelcurl -X GET "https://api.chatmefy.com/v1/analytics/funnel?\
steps=widget_opened,message_sent,lead_captured,demo_scheduled&\
period=30d" \
-H "Authorization: Bearer YOUR_API_KEY"
# Response
{
"data": {
"steps": [
{ "event": "widget_opened", "count": 15420, "rate": 100 },
{ "event": "message_sent", "count": 8934, "rate": 57.9 },
{ "event": "lead_captured", "count": 3420, "rate": 22.2 },
{ "event": "demo_scheduled", "count": 892, "rate": 5.8 }
],
"overall_conversion": 5.8
}
}Export Data
Export analytics data in CSV format for external analysis:
POST
/v1/analytics/exportcurl -X POST "https://api.chatmefy.com/v1/analytics/export" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "conversations",
"period": "30d",
"format": "csv",
"email": "team@company.com"
}'
# Response
{
"data": {
"export_id": "exp_abc123",
"status": "processing",
"estimated_time": "2 minutes",
"download_url": null
}
}Large exports are processed asynchronously. You'll receive an email with the download link.
Rate Limits
| Endpoint | Rate Limit | Notes |
|---|---|---|
| GET /analytics/* | 100/min | Standard analytics queries |
| POST /analytics/export | 10/hour | Export requests |
| GET /analytics/realtime | 60/min | Real-time data stream |