Content Acceleration,Dynamic Web Acceleration,Media Acceleration VoD,Media Acceleration Live Broadcast
Query the traffic bandwidth distribution of a domain across countries and regions. Users input a time range and domain list to view data by domain, country, or domestic vs. foreign. Results include total regional traffic, its percentage, and traffic and bandwidth per time segment, aiding in global website traffic analysis and management. Query data from 24 hours prior is recommended.
Single user trigger frequency: 30/5min
| Name | Description |
|---|---|
dateFromString | Starting time
1.The time format is yyyy-MM-ddTHH:mm:ss±HH:mm. Please note: ±HH:mm is the time zone offset, which can be adjusted according to your data needs, for example, +00:00 represents UTC time, +08:00 represents East 8th District, and -05:00 represents West 5th District. 2024-01-15T10:30:45+00:00 means UTC time January 15, 2024 10:30:45 AM;
2. Cannot be greater than the current time
3. Get up to the last six months (183 days) of data. |
dateToString | End Time:
1.The time format is yyyy-MM-ddTHH:mm:ss±HH:mm. Please note: ±HH:mm is the time zone offset, which can be adjusted according to your data needs, for example, +00:00 represents UTC time, +08:00 represents East 8th District, and -05:00 represents West 5th District. 2024-01-15T10:30:45+00:00 means UTC time January 15, 2024 10:30:45 AM;
2. The end time needs to be greater than the start time. If the end time is greater than the current time, the current time is taken.
3. dateFrom, dateTo are not passed, the default query for the past 24 hours; if there is only one untransmitted, throw an exception
4. Allow query maximum time interval: 7 days, that is, the difference between dateFrom and dateTo can’t exceed 7 days (can contact technical support adjustment, up to 31 days). |
granularityString | Data granularity:
1.Support 5m (5 minutes granularity),1d (1 day granularity)
2.Do not pass the default to 5m |
*domainList | Domains:
1.Domain is not uploaded: Query all domain names of the account (More than 20 domains will error, you can contact technical support for adjustment)
2.Domain is uploaded: Up to 20 domains are supported (you can contact technical support for adjustment) |
countryCodeList | Country code:
1. If not specified, all countries and regions will be queried by default
2. Support language request header Accept-Language, only supports zh-CN and en-US, the default is zh-CN. When Accept-Language is en-US, the country and region returned are all in English, otherwise they are returned in Chinese. Parameter Values |
groupByList | Grouping dimension:
1.Can pass in single or multiple values. The aggregatedOversea and country cannot be passed at the same time;
2.If there is an incoming, the detailed data will be displayed according to the dimension:
domain: Group display by domain name dimension;
country: Group display by country dimension;
aggregatedOversea: Group display according to domestic and overseas dimensions.
3.The result hierarchy is fixed in order, and the order of the parameters does not affect the order of the returned results. For example: 'groupBy': ['domain','country'] and 'groupBy': ['country','domain'] return the same result. |
| Name | Description |
|---|---|
resultList | Result |
domainString | Domain |
countryDataList | |
countryCodeString | Country code |
countryNameString | Country name |
totalTrafficString | Summary of traffic in national regions: Summary of traffic flow in a single country region during the query period, unit of measure MB, retain two decimals |
trafficPercentageString | National regional traffic ratio: the proportion (percentage) of traffic value in a single country region during the query period, retain two decimals |
dataSeriesList | |
timestampString | 1. When the data size of the query is 5m, the format is yyyy-MM-dd HH:mm; each time slice data value represents the data value in the previous time granularity range. The time slice starting at the beginning of the day is yyyy-MM-dd 00:05, and the last time slice is (yyyy-MM-dd+1) 00:00.
2. Returns the time slice contained in the start time and end time. |
trafficString | Traffic value:
Unit: MB, retain two decimals |
bandwidthString | Bandwidth value.
Unit: Mbps , retain two decimals |
| Error code(code) | Description(message) | HTTP status | Semantic |
|---|---|---|---|
| MissingBody | Request body has not specified | 400 | Request body has not specified |
| NotAcceptable | Accept as request header is not supported, as interface only supports json and xml formats, with json as the default format | 400 | Accept as request header is not supported, as interface only supports json and xml formats, with json as the default format |
| InvalidHTTPRequest | Incorrect format of request body | 400 | Incorrect format of request body |
| InvalidDatePeriod | datafrom or dateto not compliant to specifications | 400 | datafrom or dateto not compliant to specifications |
| DateSpanError | Period between datafrom and dateto is longer than 7 days | 400 | Period between datafrom and dateto is longer than 7 days |
| NumberLimitExceeded | Number of queried domains exceeds limits set to the account | 400 | Number of queried domains exceeds limits set to the account |
| PARAM_INVALID | Parameter of groupBy not compliant to specifications | 400 | Parameter of groupBy not compliant to specifications |
| InternalError | System has encountered an error | 500 | System has encountered an error |
| PARAM_INVALID | param: domain is null or invalid. | 400 | param: domain is null or invalid. |
| PARAM_INVALID | param: countryCode is null or invalid. | 400 | param: countryCode is null or invalid. |
| MissingBody | Request body has not specified | 400 | Request body has not specified |
| NotAcceptable | Accept as request header is not supported, as interface only supports json and xml formats, with json as the default format | 400 | Accept as request header is not supported, as interface only supports json and xml formats, with json as the default format |
| InvalidHTTPRequest | Incorrect format of request body | 400 | Incorrect format of request body |
| InvalidDatePeriod | datafrom or dateto not compliant to specifications | 400 | datafrom or dateto not compliant to specifications |
| DateSpanError | Period between datafrom and dateto is longer than 7 days | 400 | Period between datafrom and dateto is longer than 7 days |
| NumberLimitExceeded | Number of queried domains exceeds limits set to the account | 400 | Number of queried domains exceeds limits set to the account |
| PARAM_INVALID | Parameter of groupBy not compliant to specifications | 400 | Parameter of groupBy not compliant to specifications |
| InternalError | System has encountered an error | 500 | System has encountered an error |
| PARAM_INVALID | param: domain is null or invalid. | 400 | param: domain is null or invalid. |
| PARAM_INVALID | param: countryCode is null or invalid. | 400 | param: countryCode is null or invalid. |
#!/bin/bash
# Please remember to change the param (-H "X-Time-Zone") in this demo to the TimeZone you want in response
username='example_username'
apiKey='example_apiKey'
date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S GMT"`
password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey -binary | openssl enc -base64`
curl -i --url "https://api.atomile.com/api/report/traffic/domain-country" \
-X "POST" \
-H "X-Time-Zone:GMT+00:00" \
-H "Accept-Language: en-US" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/json" \
-d '{
"dateFrom": "2018-04-19T00:00:00+00:00",
"dateTo": "2018-04-20T00:00:00+00:00",
"domain": [
"www.test1.com",
"www.test2.com"
],
"granularity": "5m",
"countryCode": [
"cn",
"jp"
],
"groupBy": [
"domain",
"country"
]
}'{
"result":[
{
"domain":"www.test1.com",
"countryData":[
{
"countryCode":"jp",
"countryName":"Japan",
"totalTraffic":"2.00",
"trafficPercentage":"16.67%",
"dataSeries":[
{
"timestamp":"2018-04-19 00:10",
"traffic":"2.00",
"bandwidth":"1.00"
}
]
},
{
"countryCode":"cn",
"countryName":"China",
"totalTraffic":"10.00",
"trafficPercentage":"83.33%",
"dataSeries":[
{
"timestamp":"2018-04-19 00:05",
"traffic":"1.00",
"bandwidth":"1.00"
},
{
"timestamp":"2018-04-19 00:10",
"traffic":"2.00",
"bandwidth":"1.00"
}
]
}
]
},
{
"domain":"www,test2,com",
"countryData":[
{
"countryCode":"cn",
"countryName":"China",
"totalTraffic":"1.00",
"trafficPercentage":"100.00%",
"dataSeries":[
{
"timestamp":"2018-04-19 00:05",
"value":"1.00"
}
]
}
]
}
]
}