Count Backlinks from Unique Domains Using Yahoo Inbound Links API

If you’ve just started using the Yahoo Site Explorer Inbound Links API and want to know how far you can take it, keep reading. This three-part series will show you how to build an application that can help you track your links.

In two introductory article series on the Yahoo Site Explorer Inbound Links API, you learned the very basic steps involved in connecting to the Yahoo Inbound Links API using the PHP server side scripting language to get important link- related data.

Those were very basic concepts which you need to know to build more complex applications. In this series, you will learn how to build a web application using Yahoo Site Explorer’s inbound links API to count back links/inbound links from unique domains. The first part will discuss the design and concept of the implementation. The second and third parts will discuss the PHP script and application in detail.

These are very important tools for search engine optimization and web marketing. In a study conducted by SEOMoz, “diversity of link sources” (links from many unique root domains) is considered to be one of the top five primary ranking factors Google considered in 2009.


Because of this trend, it is important for web marketing analysts and SEO professionals to at least examine the back link profile of their domains and see how many links are coming from unique domains. This information can be used as input to formulate strategies pertaining to link popularity improvement.

{mospagebreak title=Requirements}

This web application is written in PHP and should run in an Apache/Linux/MySQL web environment (MySQL database is not needed for this implementation, although it can be integrated). Paid hosting enables important PHP functions which are needed to run this application, for example file_get_contents. You need to consult with your hosting provider to find out if there are limitations on the PHP functions you can use, such as the example function provided earlier.

Remember that if you are in a limited hosting environment — as you would be with free web hosting, for example — there is no way you can run this type of application. Web hosting companies offering free hosting services typically disable these PHP functions (used for grabbing data from outside the domain, like API) to control spam and abuse.

However, you can run the application perfectly inside your own XAMPP local host (to be used just for your own consumption). If you use either Windows or Linux, you can install XAMPP (it is bundled with Apache, MySQL and PHP) which you can use to run this application. If you are interested in using XAMPP, you can read the tutorial at the link, as well as this one

Other than that, assuming you have read the two introductory articles on the Yahoo Inbound Links API (provided in the first section), you should have your own Yahoo Application ID which is needed for this application.

It is also important that if you plan to use Yahoo inbound links API, you agree to their terms of use.

{mospagebreak title=Implementation Concept}

Before we dive into the details of programming, we should first formulate the concepts that will govern the implementation. The following is the native flow of the Yahoo Inbound Links API using PHP:

The PHP web application will be the first one to establish communication to the Yahoo API, and then the Yahoo API will examine the application ID. If it is valid, it will output the requested Yahoo API data back to the user.

Since you need to count back links coming from unique domains pointing to a specific targeted domain, you need to have “Domain URL” as the most important user input, which should preferably be the canonical home page URL. Yahoo Site Explorer API does not take the www and non-www versions as the same. This means that if the query to the API is , this result will be entirely different if only the non-www version is used:

For example, it is entirely possible for Yahoo Links API to return 583 back links for the www version of the entire site, but no links (zero) for the non-www version.

In SEO, you should be interested in the overall number of back links (coming from unique domains) pointing to the entire domain, not only the home page URL. The higher the number of links to the entire domain, the more authoritative the domain will be. However since it is possible for Yahoo Links API to return the number of links pointing to the entire domain or only to a specific page, these can be added as an option in the web form.

Bear in mind that “back link obsession” is not recommended; this data should only serve as a guide in formulating general strategies. You should not worry about each little detail.

{mospagebreak title=Implementation Flow}

The complete and detailed implementation flow for this application should look like this:

The web form is first presented to the user. They will enter the root domain URL, for example: . After that, the user will decide if he or she is interested in the number of back links pointing to the entire domain (home page + inner pages) or only to the specific root domain URL (home page only).

When the form is submitted, PHP will process the user inputs and then establish a connection to the Yahoo API. Details of the request will be sent, for example the Application ID, Requested Domain URL, and additional options (entire domain or to specific URL).

If the application ID is valid, the Yahoo API will send the request back to the server. PHP will receive the request, and then analyze the data by filtering for unique domains. For example, if PHP receive the series of back link URLs seen below:

PHP should filter the back link data to count unique domains. In the above example, there are only five back links coming from unique domains.

{mospagebreak title=PHP approximates the overall unique back links count}

Bear in mind that Yahoo Site Explorer Links API can only provide 100 back link samples at a maximum. They can provide the total number of back links pointing to the domain but this is NOT unique data. You will still need to do some statistical approximation of the overall UNIQUE back link count.

Below is the formula for the unique back link count:

Unique Back link count = (Number of Unique Back links in 100 Yahoo API samples/100) x Total number of back links pointing to the domain (not unique data)

For example, if there are 20,674 back links pointing to the entire domain, and in the sampling analysis of Yahoo Inbound Links API data there are 32 back links from unique domains out of 100 back link samples, the estimated/overall back link count should be:

Unique Back link count = (32/100) x 20,674 = 6,616 unique back links pointing to the entire domain.

Since this is an estimate, this is not guaranteed to be entirely accurate. Use this result only as a rough guide.

{mospagebreak title=PHP-Powered Web Form}

One of the suggested user-friendly web forms uses AJAX PHP validation (details here). We will use this one as an example. As discussed earlier, the form should accept the following user inputs:

1. Root domain URL (starting with http:// and NOT ending with a trailing slash). For example: is NOT acceptable is NOT acceptable – ACCEPTABLE

2. The choice of whether to analyze back links pointing to the entire domain or just to the home page.

3. A captcha for user validation.

The screenshot below shows what the HTML form will look like:

In part two, we will discuss the PHP script/source code in detail.

[gp-comments width="770" linklove="off" ]

chat sex hikayeleri Ensest hikaye