INCLUDE_DATA
( to ) ? be : ! be;
sidebar left sidebar right

Alexa rank: A script to get the rank for any site (5,104 views)

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

You can find out the Alexa rank for any site by using this page. However, if you want to programatically get the Alexa rank, you can do it using this script.

Get 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,

http://data.alexa.com/data?cli=10&dat=snbamz&url=$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.

subscribe to feed

Tags: , , , , ,

"Alexa rank: A script to get the rank for any site" was published on April 22nd, 2008 and is listed in programming, python, web.

Comments on "Alexa rank: A script to get the rank for any site": 9 Comments

  1. Nate Nead wrote,

    it seems to me that the Alexa rank has nothing to do with search engine optimization, because there are a lot of sites with a worse page rank that have higher spots in the engines for our keywords, is this not true?

  2. prashanthellina wrote,

    That may be true. Alexa rank measures traffic to a site (as in number of visitors). Page rank is a measure of page “popularity” on the web. Both these measure different aspects of a page/site. Since Alexa rank does not imply higher PR, it may not be a factor in SEO.

  3. ajinkya wrote,

    can my blog get alexa ranking ?? i hav herd tat only websitz get ?

  4. marlo wrote,

    Hi, your script cannot reachable from public, it is down or something

  5. prashanthellina wrote,

    Mario, there was an issue with my site’s config. I have fixed it now. Thanks for pointing out the issue.

  6. Mark wrote,

    Hi,
    I found a bug in your script. If the domain contains a digit, the script will return that digit as the page rank.

    I have no idea why it is doing that, but I try my best to find out why. If I find a solution to this bug I will make sure to post it here.
    And I would appreciate if you looked into this.

    Thank you

  7. Mark wrote,

    For example:

    test1.c o m page rank: 1
    test3.c o m page rank: 3
    1and1.c o m page rank: 1
    888.c o m page rank 888

  8. Sector-Seven wrote,

    Hey,

    Thanks a lot for sharing the raw information about the URL to access and XML – very helpful.
    I have been searching for a while, and everybody is offering their own “widgets” for other people to put on their sites.
    I don’t suppose Compete or Google PR have similar interfaces?

  9. prashanthellina wrote,

    Sector-Seven, I have not explored Compete but I do remember reading somewhere that Google PR can be obtained in a similar fashion. I suspect that is how the Google Toolbar does it.

559115 views

Prashanth Ellina is powered by WordPress

No Complaints Shifter Series Theme by Buzzdroid.com
Computers blogarama - the blog directory Blog Flux Directory Blog Directory & Search engine Computer Blogs - Blog Catalog Blog Directory Computers blogs Bloggeries Blog Directory blog directory Computers Blog Blog Search, Blog Directory p Listed in LS Blogs the Blog Directory and Blog Search Engine Blog Review Blog search - categorized blog directory Link With Us - Web Directory Find Blogs in the Blog
Directory Blog Directory