ALEXA ranking checker tool using PHP - PHP project with source code

Alexa is a traffic ranking website that offers a service to estimate the traffic of a website. This tool allows you to check your site's Alexa ranking. It's one of the popular tools to find how your site's doing in terms of web traffic. 

So guys in this post we are going to create an awesome Alexa ranking checker tool with an awesome look.

Alexa is providing API to do this but it is a paid service. So we found another way to fetch Alexa ranking using XML and it is free of cost. 


Where can I use this script?

  1. SEO tool: If you are trying to create an SEO tool, you definitely add this script to ascertain the traffic of the site. 
  2. Blog admin panel: you can add this script while creating a blog admin panel to check the progress of the site. 
  3. Alexa ranking checker: you can also create an Alexa ranking checker tool with this script. 

Can I use it on my website?

Yes, you can use this php code. There is not any restrictions restriction to using this code on your website. But you must follow the policies of Alexa- the site that provides this feature. 

Files and folders 

In this project, You only need to create two files index.php and style.css in a folder you can name it whatever you like. 

Download Full

If you find any problem with this script please try this code by downloading it.


<!DOCTYPE html>
<html lang="en">

    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Alexa rank checker tool</title>

    <!-- linking CSS  -->
    <link rel="stylesheet" href="style.css">


    <center style="color:white; padding-top:20px; font-weight:900; font-size:large;"><h1>Alexa ranking checker tool</h1></center>
    <div class="mainwrapper">
        <form action="#" method="get">
            <input type="text" name="weburl" id="weburl" placeholder="">
            <input type="submit" name="submit" value="Submit">

        <div class="output">
            if (isset($_GET['submit'])) {
                $url = $_GET['weburl'];
                $xml = simplexml_load_file('' . $url);
                $rank = isset($xml->SD[1]->POPULARITY) ? $xml->SD[1]->POPULARITY->attributes()->TEXT : 0;
                $web = (string)$xml->SD[0]->attributes()->HOST;
                echo "<h3>$web <br/>  has Alexa Rank</h3><h2 style='color:blue;'> $rank </h2>";




* {
    margin: 0%;
    padding: 0%;
    box-sizing: border-box;

body {
    background-image: linear-gradient(to left, red, rgb(217, 255, 0));
    width: 100%;
    height: 100%;

.mainwrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 10px;
    padding: 10px;

.mainwrapper input {
    outline: none;
    padding: 5px;
    font-size: 18px;
    font-weight: 600;

.output {
    width: 500px;
    text-align: center;
    background-color: white;
    border-radius: 20px;
    padding: 10px;
    margin: 20px;


I hope this post going to be helpful for you. You can ask your doubts in the comment section. Share this post with your family and friends.


Post a Comment