To use Alexa Top Sites, you first need to have an AWS account and IAM user credentials. If you do not have an AWS account, please register for one. If you do already have an AWS account but not IAM user credentials, you will need to go through steps 1 through 6 below.
- Login to the AWS IAM Management Console to create an IAM user. (If you already have an IAM user for this purpose, you can skip to step 3.)
- Follow the steps for how to setup an IAM user. Make sure that you give the IAM user the “Programmatic access” access type.
- Create a policy that allows the IAM user to make requests to the Alexa Top Sites web service and assign the policy to the user. See the IAM User Guide for details. See below for a sample policy.
- NOTE: There is a known issue where a warning message appears indicating this is an "Unrecognized service". You may safely disregard that warning and proceed.
- NOTE: There is a known issue where a warning message appears indicating this is an "Unrecognized service". You may safely disregard that warning and proceed.
- You will need the IAM user’s Access Key ID and Secret Access Key to start making requests to the service. Store these in a secure location.
- Start by making a test request using your access keys and one of the sample programs.
- Refer to our technical documentation for information on how to query the Alexa Top Sites API.
Here is an example of a simple policy that allows an IAM user to query the Alexa Top Sites service. You can find out more about IAM policies here.
NOTE: There is a known issue where a warning message appears indicating this is an "Unrecognized service". You may safely disregard that warning and proceed.
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"AlexaTopSites:GET"
],
"Effect": "Allow",
"Resource": "*"
}
]
}
Sample code in various programming languages that makes a query request to the Alexa Top Sites web service, and get back the top 100 results for a particular country. The list of available countries is returned when you use the ListCountries response group. The list includes US, CN, DE. If no CountryCode is specified, a global list is returned.