/cdn/get_statistics
GET https://api.sitehost.nz/1.0/cdn/get_statistics.json
Gets CDN Statistics. WARNING - The CDN endpoint was deprecated in February 2023 due to changes by our former CDN partner. Existing CDNs will still continue to work and can be managed, but new CDNs cannot be setup..
Query Parameters
Parameter | Type | Required | Description |
client_id | integer | Yes | The ID for the client.Example: 1 |
domain | string | Yes | The domain to get statistics for.Example: example.com |
Code Samples
JavaScript PHP Rails Pythonvar xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", "https://api.sitehost.nz/1.0/cdn/get_statistics.json?apikey=your_key_here&client_id=1&domain=example.com", false);
xmlHttp.send();
var response = xmlHttp.responseText;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.sitehost.nz/1.0/cdn/get_statistics.json?apikey=your_key_here&client_id=1&domain=example.com");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
require 'net/http'
require 'uri'
uri = URI.parse("https://api.sitehost.nz/1.0/cdn/get_statistics.json?apikey=your_key_here&client_id=1&domain=example.com")
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri)
response = http.request(request)
import requests
uri = 'https://api.sitehost.nz/1.0/cdn/get_statistics.json?apikey=your_key_here&client_id=1&domain=example.com'
response = requests.get(uri)
Response
200:application/json
{
"return": {
"timeZero": 1458094581000,
"timeEnd": 1460686581000,
"count": 1,
"has_more": false,
"objs": [
{
"cachedServerTime": 1460686581000,
"cachedExpryTime": 1460687181000,
"trafficBreakdown": {
"pageviews": {
"regular": 0,
"threat": 0,
"crawler": 0
},
"uniques": {
"regular": 0,
"threat": 0,
"crawler": 0
}
},
"bandwidthServed": {
"cloudflare": 0,
"user": 0
},
"requestsServed": {
"cloudflare": 0,
"user": 0
},
"pro_zone": false,
"pageLoadTime": null,
"currentServerTime": 1460686581000,
"interval": 20,
"zoneCDate": 1460677682000,
"userSecuritySetting": "Medium",
"dev_mode": 0,
"ipv46": 0,
"ob": 1,
"cache_lvl": "agg",
"outboundLinks": "disabled"
}
]
},
"msg": "Successful",
"status": true,
"time": 635.36
}
"return": {
"timeZero": 1458094581000,
"timeEnd": 1460686581000,
"count": 1,
"has_more": false,
"objs": [
{
"cachedServerTime": 1460686581000,
"cachedExpryTime": 1460687181000,
"trafficBreakdown": {
"pageviews": {
"regular": 0,
"threat": 0,
"crawler": 0
},
"uniques": {
"regular": 0,
"threat": 0,
"crawler": 0
}
},
"bandwidthServed": {
"cloudflare": 0,
"user": 0
},
"requestsServed": {
"cloudflare": 0,
"user": 0
},
"pro_zone": false,
"pageLoadTime": null,
"currentServerTime": 1460686581000,
"interval": 20,
"zoneCDate": 1460677682000,
"userSecuritySetting": "Medium",
"dev_mode": 0,
"ipv46": 0,
"ob": 1,
"cache_lvl": "agg",
"outboundLinks": "disabled"
}
]
},
"msg": "Successful",
"status": true,
"time": 635.36
}