Network metrics help investigate HTTP traffic, status codes, most accessed routes, latency, user agents, and source IPs. These endpoints are available for HTTP projects on plans that include metrics access.
Header Required Description x-api-keyYes Project API Key x-organization-idYes Active project organization
Endpoint Main use GET /project/:id/metrics/network/summaryAggregated view of requests, bytes, latency, and status classes GET /project/:id/metrics/network/status-codesGrouping by HTTP status code GET /project/:id/metrics/network/routesMost accessed routes and status codes by route GET /project/:id/metrics/network/user-agentsMost frequent user agents GET /project/:id/metrics/network/request-eventsIndividual request events GET /project/:id/metrics/network/source-ipsSource IPs with the highest volume
Parameter Type Description idstring Project ID (ObjectId)
Parameter Type Description range_secondsnumber Relative window. Accepted values: 300, 3600, 21600, 86400, 604800 fromstring Start date in ISO 8601 format tostring End date in ISO 8601 format status_codestring Specific HTTP status code, such as 500 status_classstring HTTP class: 2xx, 3xx, 4xx, or 5xx source_ipstring Source IP used to filter events pathstring HTTP path used to filter events pagenumber Pagination page. Default: 1 limitnumber Items per page. Default: 5, maximum: 50
Use range_seconds for simple dashboards. Use from and to when you need to compare a specific incident window.
GET /project/:id/metrics/network/summary
{
"status" : "success" ,
"message" : "get network analytics summary with success" ,
"data" : {
"project_id" : "507f1f77bcf86cd799439011" ,
"window" : {
"from" : "2026-05-23T13:00:00.000Z" ,
"to" : "2026-05-23T14:00:00.000Z" ,
"seconds" : 3600
},
"summary" : {
"requests" : 1200 ,
"bytes_received" : 420000 ,
"bytes_sent" : 1800000 ,
"avg_latency_ms" : 42 ,
"p95_latency_ms" : 120
},
"status_classes" : {
"2xx" : 1160 ,
"3xx" : 20 ,
"4xx" : 15 ,
"5xx" : 5
}
}
}
The status-codes, routes, user-agents, request-events, and source-ips endpoints return data and pagination.
{
"status" : "success" ,
"message" : "get network analytics status codes with success" ,
"data" : {
"data" : [
{
"status_code" : "200" ,
"requests" : 1160 ,
"user_agents" : {
"Mozilla/5.0" : 900 ,
"curl/8.0" : 260
},
"routes" : {
"GET /" : 800 ,
"GET /health" : 360
},
"bytes_received" : 390000 ,
"bytes_sent" : 1600000 ,
"avg_latency_ms" : 39 ,
"p95_latency_ms" : 110
}
],
"pagination" : {
"page" : 1 ,
"limit" : 5 ,
"total" : 1 ,
"total_pages" : 1
}
}
}
curl -X GET "https://api.zenifra.com/v1/project/507f1f77bcf86cd799439011/metrics/network/summary?range_seconds=3600" \
-H "x-api-key: your-api-key" \
-H "x-organization-id: your-organization-id"
curl -X GET "https://api.zenifra.com/v1/project/507f1f77bcf86cd799439011/metrics/network/routes?status_class=5xx&limit=10" \
-H "x-api-key: your-api-key" \
-H "x-organization-id: your-organization-id"
curl -X GET "https://api.zenifra.com/v1/project/507f1f77bcf86cd799439011/metrics/network/request-events?source_ip=203.0.113.10" \
-H "x-api-key: your-api-key" \
-H "x-organization-id: your-organization-id"
import requests
API_KEY = "your-api-key"
ORGANIZATION_ID = "your-organization-id"
PROJECT_ID = "507f1f77bcf86cd799439011"
headers = { "x-api-key" : API_KEY , "x-organization-id" : ORGANIZATION_ID }
summary = requests.get(
f "https://api.zenifra.com/v1/project/ {PROJECT_ID} /metrics/network/summary" ,
params = { "range_seconds" : 3600 },
headers = headers
).json()
print (summary)
Code Likely reason How to fix 400Project is not HTTP Use database metrics in Metrics and Logs 402Plan does not allow metrics access Upgrade to a plan with metrics enabled 403Invalid organization or permission Confirm x-organization-id and project access 404Project not found Check Project ID, API Key, and organization