Menu
Alexa Top Sites
Developer Guide

Alexa Top Sites - Query Requests

A query request is simply an HTTP GET request that returns XML.

Sample Query Request

Here is a request for sites ranked 301 - 400 in Brazil:

http://ats.amazonaws.com/?
            Action=TopSites
            &Count=100
            &CountryCode=BR
            &ResponseGroup=Country
            &Start=301
            &Url=yahoo.com
        

Headers

Authorization: AWS4-HMAC-SHA256 Credential=<IAM_ACCESS_KEY>/20171114/us-west-1/AlexaTopSites/aws4_request, SignedHeaders=host;x-amz-date, Signature=<GENERATED_AUTH_V4_SIGNATURE>
Content-Type: application/xml
X-Amz-Date: 20171114T190104Z
Accept: application/xml
        

See Common Request Parameters and TopSites for descriptions of query parameters.

String to Sign

The Authorization header is used to authenticate the request. It is calculated as the hash of the request's "string to sign" as described in Calculating Signatures. For the sample request above, the string to sign is:

AWS4-HMAC-SHA256\n
20171114T211514Z\n
20171114/us-west-1/AlexaTopSites/aws4_request\n
6afec28445bd3daa3a9a7956a2d7e2f0ea0430b61dc880df4e33271c147235a3
      

where \n represents a newline.