SEOMoz LinkScape API Functions Library

It is not every day that we get to release code around here, so I am especially pleased about this post. For those of you who don’t know, SEOMoz released their LinkScape Site Intelligence API which gives you programmatic access to their giant link information database. Some of the features are free (the mozRank API) and some are not.

The following code library allows you to easily interact with the API.

Main Functions:

Function Description
generateCredentials() uses the global variables of accessid and secret to generate a valid credential query string.
apiStatus() accesses the Status API
getTransformation() grabs the B and M values from the Status Call
transformMozRank() converts Raw mozRank to Pretty mozRank
calculateBitFlag() converts an array of plain-text fields into the appropriate Bit Flag
parseBitFlag() converts a link bit flag into plain-text values
topLinks() accepts numerous parameters, makes call to Top-Links and returns array of values
topPages() accepts numerous parameters, makes call to Top-Pages and returns array of values
urlMetrics() accepts numerous parameters including multiple URLs, makes call to URL-Metrics and returns array of values

Helper Functions

Function Description
getSingleMatch() finds a single needle in the haystack
getMultiMatch() finds multiple needles in the haystack
custom_hmac() SHA1 hash alternative for non PHP 5 users

Helper Class

File Description
class.json.php converts json to php object.

Downloads

File Format
Functions Library [TXT]
Examples [TXT]
JSON Class [TXT]
No tags for this post.

14 Comments

  1. Seattle SEO
    Dec 28, 2009

    Just another example of why everyone loves SEOmoz. There is no question that their tools are among the best in the biz.

  2. Dan Morin
    Mar 6, 2010

    Any documentation on the apiStatus function? What do the $b and $m vars represent?

  3. admin
    Mar 8, 2010

    I am not sure if there is any documentation, but B and M are the coefficient and slope, I assume. Once you know the raw mozrank, you can pop it into the equation and, voila, you have the transformed, pretty mozRank

  4. Bob Steel
    Jun 22, 2010

    Really helpful documentation. I find SEOMoz data more useful than Google page rank in terms of actual value of a page.

  5. Peter Bloom
    Feb 28, 2011

    Hi I’m a newbie. I tried the examples given in downloads but only the last one (the one who uses urlMetrics function) returns values. Why is that ?

  6. Peter Bloom
    Feb 28, 2011

    Hi I’m a newbie on seomoz. I tried the examples given in downloads but only the last one (the one who uses urlMetrics function) returns values. Why is that ?

  7. Hamburg SEO
    Jul 19, 2011

    Hi,

    i want test this library I am a SEOMoz Pro Member, so i can use the Free Api Call with my keys. But i am not a php-expert, though i have do websites with php.

    My questions:
    Where i install at the webserver class.json.php?
    The Funtions Library, than it is renamed “functions.php”?
    Can the library be installed elsewhere or it exist a best practice to put it on a specific folder in the php environment?

    Thanks and greetings from Hamburg, Germany

  8. php devel
    Jul 23, 2011

    Is this library free ?

  9. admin
    Jul 23, 2011

    yes, although it has no been updated recently.

  10. Joseph Mendez
    Sep 8, 2011

    Strict Standards: mktime() [function.mktime]: You should be using the time() function instead ,
    i got an error for mktime
    — functions.php—- line 24
    $timestamp = mktime()+300;

  11. CodeAngry
    Apr 29, 2012

    Up to date competition 🙂
    SEOmoz’s MozScape API for PHP 5.3+

    Kind regards.

  12. SEOsudo
    May 28, 2012

    seems like the APIs are outdated as well.

  13. Brad Spencer
    Aug 1, 2012

    Is this outdated or does it work ok?

  14. admin
    Aug 2, 2012

    outdated

Submit a Comment

Your email address will not be published. Required fields are marked *