Traffic Summary Card
Returns current-period totals, equivalent previous-period totals, and percentage deviations for all core traffic metrics.
curl -X POST "https://api.5centscdn.com/v2/analytics/traffic/summary/card" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"r": "2026-01-01 00:00:00 - 2026-01-31 23:59:59",
"resource_type": "push",
"resource_hashes": [
"abc12hash",
"def34hash",
"ghi56hash"
],
"granularity": "24h"
}'
import requests
import json
url = "https://api.5centscdn.com/v2/analytics/traffic/summary/card"
headers = {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY"
}
data = {
"r": "2026-01-01 00:00:00 - 2026-01-31 23:59:59",
"resource_type": "push",
"resource_hashes": [
"abc12hash",
"def34hash",
"ghi56hash"
],
"granularity": "24h"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.5centscdn.com/v2/analytics/traffic/summary/card", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY"
},
body: JSON.stringify({
"r": "2026-01-01 00:00:00 - 2026-01-31 23:59:59",
"resource_type": "push",
"resource_hashes": [
"abc12hash",
"def34hash",
"ghi56hash"
],
"granularity": "24h"
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"r": "2026-01-01 00:00:00 - 2026-01-31 23:59:59",
"resource_type": "push",
"resource_hashes": [
"abc12hash",
"def34hash",
"ghi56hash"
],
"granularity": "24h"
}`)
req, err := http.NewRequest("POST", "https://api.5centscdn.com/v2/analytics/traffic/summary/card", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-API-Key", "YOUR_API_KEY")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.5centscdn.com/v2/analytics/traffic/summary/card')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['X-API-Key'] = 'YOUR_API_KEY'
request.body = '{
"r": "2026-01-01 00:00:00 - 2026-01-31 23:59:59",
"resource_type": "push",
"resource_hashes": [
"abc12hash",
"def34hash",
"ghi56hash"
],
"granularity": "24h"
}'
response = http.request(request)
puts response.body
{
"current": {
"traffic": {
"bytes": 1262343731219,
"formatted": "1.26 TB",
"percent": "+35.67%"
},
"traffic_cached": {
"bytes": 1262343731219,
"formatted": "1.26 TB",
"percent": "+35.67%"
},
"hits": {
"count": 1172166,
"formatted": "1.172M",
"percent": "+51.24%"
},
"requests": {
"count": 1172166,
"formatted": "1.172M",
"percent": "+51.24%"
},
"unique_visitors": {
"count": 1172166,
"formatted": "1.172M",
"percent": "+51.24%"
},
"caching_efficiency": {
"percent": 0.71,
"formatted": "+71%"
},
"traffic_efficiency": {
"percent": 0.71,
"formatted": "+71%"
}
},
"previous": {
"traffic": {
"bytes": 1262343731219,
"formatted": "1.26 TB",
"percent": "+35.67%"
},
"traffic_cached": {
"bytes": 1262343731219,
"formatted": "1.26 TB",
"percent": "+35.67%"
},
"hits": {
"count": 1172166,
"formatted": "1.172M",
"percent": "+51.24%"
},
"requests": {
"count": 1172166,
"formatted": "1.172M",
"percent": "+51.24%"
},
"unique_visitors": {
"count": 1172166,
"formatted": "1.172M",
"percent": "+51.24%"
},
"caching_efficiency": {
"percent": 0.71,
"formatted": "+71%"
},
"traffic_efficiency": {
"percent": 0.71,
"formatted": "+71%"
}
},
"deviation": {
"traffic": {
"bytes": 1262343731219,
"formatted": "1.26 TB",
"percent": "+35.67%"
},
"traffic_cached": {
"bytes": 1262343731219,
"formatted": "1.26 TB",
"percent": "+35.67%"
},
"hits": {
"count": 1172166,
"formatted": "1.172M",
"percent": "+51.24%"
},
"requests": {
"count": 1172166,
"formatted": "1.172M",
"percent": "+51.24%"
},
"unique_visitors": {
"count": 1172166,
"formatted": "1.172M",
"percent": "+51.24%"
},
"caching_efficiency": {
"percent": 0.71,
"formatted": "+71%"
},
"traffic_efficiency": {
"percent": 0.71,
"formatted": "+71%"
}
}
}
/analytics/traffic/summary/card
Target server for requests. Edit to use your own host.
API key (sent in header)
The media type of the request body
Date range in "YYYY-MM-DD HH:mm:ss - YYYY-MM-DD HH:mm:ss" format (UTC).
Resource category to filter by. Use all to include all resources (omit resource_hashes when using all).
Array of resource hashes to filter by (from /analytics/traffic/resources). Required when resource_type is push, pull, or livestream. Omit when resource_type is all.
Defines the time interval for data aggregation. Defaults to "24h".
Request Preview
Response
Response will appear here after sending the request
Authentication
API Key for authentication. Provide your API key in the header.
Body
Date range in "YYYY-MM-DD HH:mm:ss - YYYY-MM-DD HH:mm:ss" format (UTC).
2026-01-01 00:00:00 - 2026-01-31 23:59:59Resource category to filter by. Use all to include all resources (omit resource_hashes when using all).
pushpullalllivestreamArray of resource hashes to filter by (from /analytics/traffic/resources). Required when resource_type is push, pull, or livestream. Omit when resource_type is all.
["abc12hash","def34hash","ghi56hash"]Defines the time interval for data aggregation. Defaults to "24h".
1m5m15m30m1h3h6h12h24hResponses
Aggregate traffic metrics for a period or resource, including bandwidth, request counts, unique visitors, and efficiency ratios.
A bandwidth metric consisting of raw bytes and a human-readable string, with an optional percentage of total.
Raw byte count for this traffic metric.
Human-readable bandwidth value (e.g. "1.26 TB").
Share of the response-level total for this dimension value. Only present in breakdown and line data items.
A bandwidth metric consisting of raw bytes and a human-readable string, with an optional percentage of total.
Raw byte count for this traffic metric.
Human-readable bandwidth value (e.g. "1.26 TB").
Share of the response-level total for this dimension value. Only present in breakdown and line data items.
A count metric consisting of a raw integer count and a human-readable string, with an optional percentage of total.
Raw integer count for this metric.
Human-readable count value (e.g. "1.172M").
Share of the response-level total. Only present in breakdown and line data items.
A count metric consisting of a raw integer count and a human-readable string, with an optional percentage of total.
Raw integer count for this metric.
Human-readable count value (e.g. "1.172M").
Share of the response-level total. Only present in breakdown and line data items.
A count metric consisting of a raw integer count and a human-readable string, with an optional percentage of total.
Raw integer count for this metric.
Human-readable count value (e.g. "1.172M").
Share of the response-level total. Only present in breakdown and line data items.
A cache-efficiency or traffic-efficiency ratio expressed as a decimal and a formatted percentage.
Efficiency ratio as a decimal between 0 and 1.
Human-readable formatted percentage value.
A cache-efficiency or traffic-efficiency ratio expressed as a decimal and a formatted percentage.
Efficiency ratio as a decimal between 0 and 1.
Human-readable formatted percentage value.
Aggregate traffic metrics for a period or resource, including bandwidth, request counts, unique visitors, and efficiency ratios.
A bandwidth metric consisting of raw bytes and a human-readable string, with an optional percentage of total.
Raw byte count for this traffic metric.
Human-readable bandwidth value (e.g. "1.26 TB").
Share of the response-level total for this dimension value. Only present in breakdown and line data items.
A bandwidth metric consisting of raw bytes and a human-readable string, with an optional percentage of total.
Raw byte count for this traffic metric.
Human-readable bandwidth value (e.g. "1.26 TB").
Share of the response-level total for this dimension value. Only present in breakdown and line data items.
A count metric consisting of a raw integer count and a human-readable string, with an optional percentage of total.
Raw integer count for this metric.
Human-readable count value (e.g. "1.172M").
Share of the response-level total. Only present in breakdown and line data items.
A count metric consisting of a raw integer count and a human-readable string, with an optional percentage of total.
Raw integer count for this metric.
Human-readable count value (e.g. "1.172M").
Share of the response-level total. Only present in breakdown and line data items.
A count metric consisting of a raw integer count and a human-readable string, with an optional percentage of total.
Raw integer count for this metric.
Human-readable count value (e.g. "1.172M").
Share of the response-level total. Only present in breakdown and line data items.
A cache-efficiency or traffic-efficiency ratio expressed as a decimal and a formatted percentage.
Efficiency ratio as a decimal between 0 and 1.
Human-readable formatted percentage value.
A cache-efficiency or traffic-efficiency ratio expressed as a decimal and a formatted percentage.
Efficiency ratio as a decimal between 0 and 1.
Human-readable formatted percentage value.
Aggregate traffic metrics for a period or resource, including bandwidth, request counts, unique visitors, and efficiency ratios.
A bandwidth metric consisting of raw bytes and a human-readable string, with an optional percentage of total.
Raw byte count for this traffic metric.
Human-readable bandwidth value (e.g. "1.26 TB").
Share of the response-level total for this dimension value. Only present in breakdown and line data items.
A bandwidth metric consisting of raw bytes and a human-readable string, with an optional percentage of total.
Raw byte count for this traffic metric.
Human-readable bandwidth value (e.g. "1.26 TB").
Share of the response-level total for this dimension value. Only present in breakdown and line data items.
A count metric consisting of a raw integer count and a human-readable string, with an optional percentage of total.
Raw integer count for this metric.
Human-readable count value (e.g. "1.172M").
Share of the response-level total. Only present in breakdown and line data items.
A count metric consisting of a raw integer count and a human-readable string, with an optional percentage of total.
Raw integer count for this metric.
Human-readable count value (e.g. "1.172M").
Share of the response-level total. Only present in breakdown and line data items.
A count metric consisting of a raw integer count and a human-readable string, with an optional percentage of total.
Raw integer count for this metric.
Human-readable count value (e.g. "1.172M").
Share of the response-level total. Only present in breakdown and line data items.
A cache-efficiency or traffic-efficiency ratio expressed as a decimal and a formatted percentage.
Efficiency ratio as a decimal between 0 and 1.
Human-readable formatted percentage value.
A cache-efficiency or traffic-efficiency ratio expressed as a decimal and a formatted percentage.
Efficiency ratio as a decimal between 0 and 1.
Human-readable formatted percentage value.