PHPackages                             altname/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. altname/seostats

ActiveLibrary

altname/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)036MITPHPPHP &gt;=5.2.3

Since Aug 17Pushed 12y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (4)Used By (0)

[![Flattr SEOstats](https://camo.githubusercontent.com/7e3f46a36526479d701ef7f90a0f8c3ac2fbab3087446e2a9fceed75cd1ab802/687474703a2f2f6170692e666c617474722e636f6d2f627574746f6e2f666c617474722d62616467652d6c617267652e706e67)](https://flattr.com/submit/auto?user_id=eyecatchup&url=https://github.com/eyecatchup/SEOstats&title=SEOstats&language=en&tags=github&category=software)

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

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

SEOstats is a powerful open source PHP library to request a bunch of SEO relevant metrics such as detailed backlink analyses, keyword and traffic statistics, website trends, page authority, the Google Pagerank, the Alexa Trafficrank and much more.

SEOstats offers over 50 different methods and gathers data from Alexa, Google, Mozscape (by Moz - f.k.a. Seomoz), SEMRush, Open-Site-Explorer, Sistrix, Facebook, Twitter &amp; many more.

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 required for Mozscape and Google's Pagespeed Service only).

`./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
