What is Alexa rank?
Alexa collects statistics about visits by internet users to websites through the Alexa Toolbar. Based on the collected data, Alexa computes site ranking. By examining the Alexa rank of a site, you can get a rough idea of how popular the site is. Many argue that Alexa rank is misleading but it has its uses.
The Alexa rank script
Using the script
After downloading the script, give it execute permission by doing this. You will need to have Python installed.
chmod +x get_alexa_rank.py
$ ./get_alexa_rank.py google.com popularity rank = 2 reach_rank = 1 $ ./get_alexa_rank.py wikipedia.com popularity rank = 7 reach_rank = 6 $ ./get_alexa_rank.py blog.prashanthellina.com popularity rank = 557287 reach_rank = 482289 $ ./get_alexa_rank.py www.inexistantsite.com popularity rank = -1 reach_rank = -1
How does the script work?
If you make a http request for the following url,
after replacing $URL with the url of the site for which you need the Alexa rank, the following XML response is sent out. I tried with “http://blog.prashanthellina.com”.
The script parses the XML response and extracts POPULARITY/@TEXT and REACH/@RANK.
If you are looking for a PHP script for doing the same, check this out.