Get distribution analytics
Returns time-series traffic, request, latency, status, and cache metrics.
GET
/
cloud-cdn
/
distributions
/
analytics
Get distribution analytics
curl --request GET \
--url https://api.aptranet.com/cloud-cdn/distributions/analytics \
--header 'Aptranet-Secret: <api-key>' \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aptranet.com/cloud-cdn/distributions/analytics"
headers = {
"Authorization": "Bearer <token>",
"Aptranet-Secret": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: 'Bearer <token>', 'Aptranet-Secret': '<api-key>'}
};
fetch('https://api.aptranet.com/cloud-cdn/distributions/analytics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.aptranet.com/cloud-cdn/distributions/analytics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Aptranet-Secret", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}[
{
"datetime": "2023-11-07T05:31:56Z",
"traffic": {
"total_bytes": 123,
"upstream_bytes": 123,
"sent_bytes": 123,
"shield_bytes": 123
},
"requests": {
"total_requests": 123,
"responses_2xx": 123,
"responses_3xx": 123,
"responses_4xx": 123,
"responses_5xx": 123,
"cached_responses": 123,
"uncached_responses": 123,
"upstream_response_time": 123,
"request_time": 123
},
"cache": {
"requests_hit_rate": 123,
"traffic_hit_rate": 123
}
}
]{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}Authorizations
Access key beginning with APTRANET_.
Current secret paired with the access key.
Query Parameters
Distribution identifier.
Required range:
x >= 1Get distribution analytics
curl --request GET \
--url https://api.aptranet.com/cloud-cdn/distributions/analytics \
--header 'Aptranet-Secret: <api-key>' \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aptranet.com/cloud-cdn/distributions/analytics"
headers = {
"Authorization": "Bearer <token>",
"Aptranet-Secret": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: 'Bearer <token>', 'Aptranet-Secret': '<api-key>'}
};
fetch('https://api.aptranet.com/cloud-cdn/distributions/analytics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.aptranet.com/cloud-cdn/distributions/analytics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Aptranet-Secret", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}[
{
"datetime": "2023-11-07T05:31:56Z",
"traffic": {
"total_bytes": 123,
"upstream_bytes": 123,
"sent_bytes": 123,
"shield_bytes": 123
},
"requests": {
"total_requests": 123,
"responses_2xx": 123,
"responses_3xx": 123,
"responses_4xx": 123,
"responses_5xx": 123,
"cached_responses": 123,
"uncached_responses": 123,
"upstream_response_time": 123,
"request_time": 123
},
"cache": {
"requests_hit_rate": 123,
"traffic_hit_rate": 123
}
}
]{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}