Linkscape API PHP Class

by Illuminati Karate Web Design - Raleigh, NC

Powered By Linkscape

About the Class

SEOMoz recently released a free API to their Linkscape tool. At the current time, it provides access to their mozRank metric, but will later include other link strength metrics. We've written a PHP class to make integrating with their API much simpler.

Note: Usage of the SEOMoz API is free, but requires registration and a private key. More information can be found at this address: http://seomoz.org/api

Usage Example

The following example will output the 'pretty' mozRank for www.nytimes.com

<?php
    
require('linkscape_api.php');
    
$access_id 'YOUR SEOMOZ ACCESS ID';
    
$secret_key 'YOUR SEOMOZ SECRET KEY';
    
$ls = new LinkscapeApi($access_id$secret_key);
    
$mozRank $ls->mozRank('www.nytimes.com');
    echo 
'mozRank: ' . ($mozRank $mozRank 0);
?>    

The same code, modified to pass TRUE to the mozRank function, will return the raw mozRank instead.

<?php
    
require('linkscape_api.php');
    
$access_id 'YOUR SEOMOZ ACCESS ID';
    
$secret_key 'YOUR SEOMOZ SECRET KEY';
    
$ls = new LinkscapeApi($access_id$secret_key);
    
$mozRank $ls->mozRank('www.nytimes.com'TRUE);
    echo 
'mozRank: ' . ($mozRank $mozRank 0);
?>    

Download

License & Attribution

The Linkscape API PHP Class is Copyright 2009 Illuminati Karate and released under the MIT license. You can use it in any project you like, including commercial projects. We'd really appreciate a link back to this page or our homepage if possible, but its not required.

Any data retrieved from the SEOMoz's Linkscape API must be attributed correctly. Guidelines for proper attribution for Linkscape data are available in their API Wiki.

Feedback & Improvements

If you have comments or improvements to offer please send an email to george[at]illuminatikarate[dot]com. Thanks for reading!