PHPackages                             seostats/seostats - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. seostats/seostats

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

seostats/seostats
=================

SEOstats is a powerful open source PHP library to request a bunch of SEO relevant metrics for any website.

2.5.2(12y ago)1.5k285.1k↓44.4%370[42 issues](https://github.com/eyecatchup/SEOstats/issues)[9 PRs](https://github.com/eyecatchup/SEOstats/pulls)3MITPHPPHP &gt;=5.2.3

Since Aug 17Pushed 3y ago136 watchersCompare

[ Source](https://github.com/eyecatchup/SEOstats)[ Packagist](https://packagist.org/packages/seostats/seostats)[ Docs](http://github.com/eyecatchup/SEOstats)[ RSS](/packages/seostats-seostats/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)DependenciesVersions (7)Used By (3)

SEOstats: SEO metrics library for PHP
=====================================

[](#seostats-seo-metrics-library-for-php)

[![License](https://camo.githubusercontent.com/233f3da44166e200fbafdcd75ba6cfbd8b8a80c9919b5d6c6fa321bd0210910e/68747470733a2f2f706f7365722e707567782e6f72672f73656f73746174732f73656f73746174732f6c6963656e7365 "SEOstats is licensed under the M.I.T.")](https://github.com/eyecatchup/SEOstats) [![Scrutinizer Code Quality Rating](https://camo.githubusercontent.com/d5651ab44c4e1ec8d4a9c689630f2f065a36598918e4dcb46d2e884efc6ee4c5/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f657965636174636875702f53454f73746174732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572 "Scrutinizer Code Quality Rating: Very Good!")](https://scrutinizer-ci.com/g/eyecatchup/SEOstats/ "'Very good' code quality, says Scrutinizer C.I.") [![Build Status](https://camo.githubusercontent.com/9f6478e0274a6fdf3417630209588f5a14ec59a975574a86b339551e56d84482/68747470733a2f2f7472617669732d63692e6f72672f657965636174636875702f53454f73746174732e7376673f6272616e63683d6d6173746572 "Travis C.I. Build Status")](https://travis-ci.org/eyecatchup/SEOstats) [![Scrutinizer Test Coverage Report](https://camo.githubusercontent.com/988e9b233d98153000d1f385298c4d36479bc53b0d43d47d49892ea263de144d/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f657965636174636875702f53454f73746174732f6261646765732f636f7665726167652e706e673f623d6d6173746572 "Scrutinizer Test Coverage Report")](https://scrutinizer-ci.com/g/eyecatchup/SEOstats/code-structure/master?elementType=class&orderField=test_coverage&order=desc&changesExpanded=0 "Test coverage report by Scrutinizer C.I.") [![Latest Stable Version](https://camo.githubusercontent.com/6ded183df3d39a4b3c28dd1026f2399f307bbbae57d0f5d76302acae9da43408/68747470733a2f2f706f7365722e707567782e6f72672f73656f73746174732f73656f73746174732f762f737461626c65 "Latest Stable Version")](https://packagist.org/packages/seostats/seostats) [![Latest Unstable Version](https://camo.githubusercontent.com/02ecdc3d01a03476bf5c988b7611e34d052809fb2a01f9fa4738403adad4bf70/68747470733a2f2f706f7365722e707567782e6f72672f73656f73746174732f73656f73746174732f762f756e737461626c65 "Latest Unstable Version")](https://packagist.org/packages/seostats/seostats) [![Monthly Downloads](https://camo.githubusercontent.com/058ac5938e66bb501e0d17ec57cbe98df1011637759dfce527406d6b6c1a3ab2/68747470733a2f2f706f7365722e707567782e6f72672f73656f73746174732f73656f73746174732f642f6d6f6e74686c79 "That many people downloaded SEOstats from Github or Packagist this month.")](https://packagist.org/packages/seostats/seostats)

SEOstats is *the* open source PHP library to get SEO-relevant website metrics.

SEOstats is used to gather metrics such as detailed searchindex &amp; backlink data, keyword &amp; traffic statistics, website trends, page authority, social visibility, Google Pagerank, Alexa Trafficrank and more.

It offers over 50 different methods to fetch data from sources like Alexa, Google, Mozscape (by Moz - f.k.a. Seomoz), SEMRush, Open-Site-Explorer, Sistrix, Facebook or Twitter.

A variety of *(private as well as enterprise)* SEO tools have been built using SEOstats.

Dependencies
------------

[](#dependencies)

SEOstats requires PHP version 5.3 or greater and the PHP5-CURL and PHP5-JSON extensions.

Installation
------------

[](#installation)

The recommended way to install SEOstats is [through composer](http://getcomposer.org). To install SEOstats, just create the following `composer.json` file

```
{
    "require": {
        "seostats/seostats": "dev-master"
    }
}

```

and run the `php composer.phar install` (Windows: `composer install`) command in path of the `composer.json`.

#### Step-by-step example:

[](#step-by-step-example)

If you haven't installed composer yet, here's the easiest way to do so:

```
# Download the composer installer and execute it with PHP:
user@host:~/> curl -sS https://getcomposer.org/installer | php

# Copy composer.phar to where your local executables live:
user@host:~/> mv /path/given/by/composer-installer/composer.phar /usr/local/bin/composer.phar

# Alternatively: For ease of use, you can add an alias to your bash profile:
# (Note, you need to re-login your terminal for the change to take effect.)
user@host:~/> echo 'alias composer="php /usr/local/bin/composer.phar"' >> ~/.profile

```

---

If you have installed composer, follow these steps to install SEOstats: ``` # Create a new directory and cd into it: user@host:~/&gt; mkdir /path/to/seostats &amp;&amp; cd /path/to/seostats Create the composer.json for SEOstats:
======================================

[](#create-the-composerjson-for-seostats)

user@host:/path/to/seostats&gt; echo '{"require":{"seostats/seostats":"dev-master"}}' &gt; composer.json

Run the install command:
========================

[](#run-the-install-command)

user@host:/path/to/seostats&gt; composer install Loading composer repositories with package information Installing dependencies (including require-dev)

- Installing seostats/seostats (dev-master 4c192e4) Cloning 4c192e43256c95741cf85d23ea2a0d59a77b7a9a

Writing lock file Generating autoload files

You're done. For a quick start, you can now
===========================================

[](#youre-done-for-a-quick-start-you-can-now)

copy the example files to the install directory:
================================================

[](#copy-the-example-files-to-the-install-directory)

user@host:/path/to/seostats&gt; cp ./vendor/seostats/seostats/example/\*.php ./

Your SEOstats install directory should look like this now:
==========================================================

[](#your-seostats-install-directory-should-look-like-this-now)

user@host:/path/to/seostats&gt; ls -1 composer.json composer.lock get-alexa-graphs.php get-alexa-metrics.php get-google-pagerank.php get-google-pagespeed-analysis.php get-google-serps.php get-opensiteexplorer-metrics.php get-semrush-graphs.php get-semrush-metrics.php get-sistrix-visibilityindex.php get-social-metrics.php vendor

```

#### Use SEOstats without composer

If composer is no option for you, you can still just download the [`SEOstats.zip`](https://github.com/eyecatchup/SEOstats/archive/master.zip) file of the current master branch (version 2.5.2) and extract it. However, currently [there is an issues with autoloading](https://github.com/eyecatchup/SEOstats/issues/49) and you need to follow the instructions in the comments in the example files in order to use SEOstats (or download zip for the development version of SEOstats (2.5.3) [here](https://github.com/eyecatchup/SEOstats/archive/dev-253.zip)).

## Usage

### TOC

* Configuration
* Brief Example of Use
* Alexa Methods
 * Alexa Traffic Metrics
 * Alexa Traffic Graphs
* Google Methods
 * Toolbar Pagerank
 * Pagespeed Service
 * Websearch Index
 * SERP Details
* Mozscape Methods
* Open Site Explorer Methods
* SEMRush Methods
 * Domain Reports
 * Graphs
* Sistrix Methods
 * Visibility Index
* Social Media Methods

### Configuration
There're two configuration files to note:

`./SEOstats/Config/ApiKeys.php`
Client API Keys (currently only required for Mozscape, Google's Pagespeed Service and Sistrix).

`./SEOstats/Config/DefaultSettings.php`
Some default settings for querying data (mainly locale related stuff).

### Brief Example of Use
To use the SEOstats methods, you must include one of the Autoloader classes first (For composer installs: `./vendor/autoload.php`; for zip download: `./SEOstats/bootstrap.php`).

Now, you can create a new SEOstats instance an bind any URL to the instance for further use with any child class.

```php
