Get the traffic volume in megabytes or as percentages from different countries. An optional parameter lets you get HTTPS traffic only or HTTP traffic only.
Header |
Description |
Required |
Authorization |
Authorization string for the request |
Yes |
Host |
URI for the QUANTIL SDK (i.e., api.quantil.com) |
Yes |
Date |
The date and time of the request. |
Yes |
Accept |
Indicates the accepted format (i.e., application/xml) |
Yes |
Parameter |
Description |
Required |
datefrom |
RFC3339 formatted date indicating the starting date. Example: 2013-01-01T22:30:00+08:00 |
Yes |
dateto |
RFC3339 formatted date indicating the ending date. Example: 2013-01-01T22:30:00+08:00 |
Yes |
type |
Can be either percent to get the percentage of volume from the country or logvalue to get the actual bytes for the country. If unspecified, the default is percent. |
Yes |
https |
If true, return traffic for domains using SSL. If false, return traffic for domains not using SSL. If not specified, return all traffic (SSL and non-SSL). |
No |
This request does not include an XML document in the request body.
GET /api/report/flow/countries HTTP/1.1
Authorization: <authorization string>
Host: api.quantil.com
Date: <date>
Accept: application/xml
Here is the structure of a request using the curl utility.
curl -i --url https://api.quantil.com/api/report/flow/countries?datefrom = {date from} & dateto = {date to} & type={percent or log value} & https = {https setting}
-X GET
-u {user}: {password}
-H 'Date: Fri, 26 Oct 2012 06:33:26 GMT'
-H 'Accept: application/xml'
This request will obtains the breakdown of volume by country returned as percentages.
curl -i --url 'https://api.quantil.com/api/report/flow/countries?datefrom=2014-08-01T00:00:00%2B09:00&dateto=2014-08-02T23:59:59%2B09:00&type=percent' -u test:aDz9BXnyittq7jyVQZjBls0OBZk4= -H 'Date: Thu, 07 Aug 2014 14:31:12 PDT' -H 'Accept: application/xml'
HTTP/1.1 200 OK
Date: <date>
Content-Type: application/xml; charset = utf-8
x-cnc-request-id: {id string auto generated by the QUANTIL server}
Element |
Description |
flow-report |
container for traffic information. It will contain zero or more <flow-country> child elements indicating volume at different times. |
flow-country |
a container which has one <country> element and either one <percent> element or a <value> element. The <percent> element is returned if the query parameter type is percent while <value> is returned if type is logvalue. |
country |
a country string (i.e., United States) indicating the location of the visitor. |
percent |
indicates percentage of traffic from the country. |
value |
indicates bytes transferred. |
The following example shows data at five minute intervals.
HTTP/1.1 200 OK
Date: Thu, 07 Aug 2014 23:16:32 GMT
Accept-Ranges: bytes
Server: WS-web-server
x-cnc-request-id: 1130615
ContentType: application/xml;charset=UTF-8
Content-Type: application/xml;charset=UTF-8
Content-Length: 2557
<flow-report>
<flow-country>
<country>Hong Kong</country>
<percent>3.02</percent>
</flow-country>
<flow-country>
<country>Taiwan</country>
<percent>3.28</percent>
</flow-country>
<flow-country>
<country>Greece</country>
<percent>4.01</percent>
</flow-country>
<flow-country>
<country>Spain</country>
<percent>3.4</percent>
</flow-country>
<flow-country>
<country>Italy</country>
<percent>4.13</percent>
</flow-country>
<flow-country>
<country>Switzerland</country>
<percent>3.95</percent>
</flow-country>
<flow-country>
<country>Great Britain</country>
<percent>4.18</percent>
</flow-country>
<flow-country>
<country>India</country>
<percent>3.73</percent>
</flow-country>
<flow-country>
<country>France</country>
<percent>6.03</percent>
</flow-country>
<flow-country>
<country>Malaysia</country>
<percent>4.15</percent>
</flow-country>
<flow-country>
<country>Denmark</country>
<percent>3.45</percent>
</flow-country>
<flow-country>
<country>South Africa</country>
<percent>2.08</percent>
</flow-country>
<flow-country>
<country>China</country>
<percent>3.56</percent>
</flow-country>
<flow-country>
<country>Finland</country>
<percent>4.15</percent>
</flow-country>
<flow-country>
<country>Turkey</country>
<percent>4.37</percent>
</flow-country>
<flow-country>
<country>Korea</country>
<percent>3.67</percent>
</flow-country>
<flow-country>
<country>USA</country>
<percent>3.31</percent>
</flow-country>
<flow-country>
<country>Mexico</country>
<percent>4.56</percent>
</flow-country>
<flow-country>
<country>Canada</country>
<percent>5.1</percent>
</flow-country>
<flow-country>
<country>Poland</country>
<percent>3.62</percent>
</flow-country>
<flow-country>
<country>Brazil</country>
<percent>3.05</percent>
</flow-country>
<flow-country>
<country>Singapore</country>
<percent>2.51</percent>
</flow-country>
<flow-country>
<country>Russia</country>
<percent>3.88</percent>
</flow-country>
<flow-country>
<country>Germany</country>
<percent>3.04</percent>
</flow-country>
<flow-country>
<country>Norway</country>
<percent>2.92</percent>
</flow-country>
<flow-country>
<country>Japan</country>
<percent>3.66</percent>
</flow-country>
<flow-country>
<country>Sweden</country>
<percent>3.19</percent>
</flow-country>
</flow-report>
Error |
Description |
HTTP status code |
InvalidDatePeriod |
The date specified is invalid. |
400 |
InvalidReportType |
The report type specified is invalid. |
400 |