Jun.30

Google Rank Checker API

Part of the Raven Tools API is the SERP tracker. First, you have to go to your Profile page, and get an API key. Once you have your key, you’ll see links to the documentation and API testing tool.

One of Raven Tool’s API calls is Domain Keyword Rank. Since there’s 1,000 different things you could do with this data, I’ll show you how to fetch it, but it’s up to you to finish the script for your own use (or, hire me and I’ll finish it for you):

<?php

$cAPIKey = 'xxxxxxxxxxxxxxxx';
$cKeyword = 'raven tools review';
$cDomain = 'www.ericnagel.com';

date_default_timezone_set('America/New_York');

$cURL = 'http://api.raventools.com/api?key=' . urlencode($cAPIKey) . '&format=xml';

$cURL .= '&method=rank';
$cURL .= '&domain=' . urlencode($cDomain);
$cURL .= '&keyword=' . urlencode($cKeyword);
$cURL .= '&engine=all';
$cURL .= '&start_date=2011-06-01';
$cURL .= '&end_date=' . date("Y-m-d");

echo("$cURL\n\n");

$cXML = file_get_contents($cURL);
echo("$cXML");

$oXML = simplexml_load_string($cXML);
print_r($oXML);
?>

What you get back is an XML document, which you can then parse & handle as necessary

<results engine="google">
	<result date="2011/06/27" status="match">
		<rank>2</rank>
		<url><![CDATA[http://ericnagel.wpengine.com/2010/09/raven-tools-review.html]]></url>
	</result>
	<result date="2011/06/20" status="match">
		<rank>2</rank>
		<url><![CDATA[http://ericnagel.wpengine.com/2010/09/raven-tools-review.html]]></url>
	</result>
	<result date="2011/06/13" status="match">
		<rank>2</rank>
		<url><![CDATA[http://ericnagel.wpengine.com/2010/09/raven-tools-review.html]]></url>
	</result>
	<result date="2011/06/06" status="match">
		<rank>2</rank>
		<url><![CDATA[http://ericnagel.wpengine.com/2010/09/raven-tools-review.html]]></url>
	</result>
	<result date="2011/05/30" status="no data" />
</results>

So it’s not exactly a paid rank checker from Google, but for $19 / month, it’s probably the best solution out there.

Resources
Share this Story:
  • facebook
  • twitter
  • gplus

Comments(3)

  1. Matt Pardo
    1982 days ago

    Is this pulling the page rank metric?

  2. Eric Nagel
    1982 days ago

    No, not PR, but rank in the SERPs.

  3. Matt Pardo
    1982 days ago

    Ah, got it, I missed the cKeyword on my first scan. Thanks!

Leave a comment

Comment