Analytics API
Access detailed analytics data programmatically for custom reporting and integrations.
Get Overview Metrics
GET /v1/analytics/overview
curl -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
24h
Last 24 hours
Last 7 days
30d
Last 30 days
90d
Last 90 days
Time Series Data
GET /v1/analytics/timeseries
curl -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
conversations Total conversations started
messages Messages exchanged
leads Leads captured
handoffs Human handoff requests
response_time Average response time (ms)
satisfaction Satisfaction score (1-5)
Breakdown by Dimension
GET /v1/analytics/breakdown
curl -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
source Page URL where conversation started
bot Bot that handled the conversation
country Visitor's country (ISO code)
device Device type (desktop, mobile, tablet)
browser Browser family (Chrome, Safari, etc.)
campaign UTM campaign parameter
Funnel Analysis
GET /v1/analytics/funnel
curl -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/export
curl -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 |
|---|