• Using Compete.com API in your Website

    Posted on March 9th, 2009 Webmaster No comments

    Compete.com is a company that provides web analytics, visitors, keywords driving traffic and more. Some of the results that compete.com offers are just for paying users other no.

    In this post i will show you how can you use the api from Compete.com in your website, like i did in my http://whois.gwebtools.com/compete.com.

    1 step: Register for a developer user account.

    Register Compete Screen

    Register Compete Screen

    2 step: Register your application to get your personal API key.

    Register App

    Register App

    3 step: Start coding using your API key.

    Sample Call

    http://api.compete.com/fast-cgi/MI?d=google.com&ver=3&apikey=1234567890&size=large

    Sample Result

    <ci>
    <dmn>
    <nm>google.com</nm>
    <trust caption=”Trust”>
    <val>green</val>
    <link>http://toolbar.compete.com/trustgreen/google.com</link>
    <icon>http://home.compete.com.edgesuite.net/site_media/images/icons/trust_green_53.gif</icon>
    </trust>
    <rank caption=”Profile”>
    <val>2</val>
    <link>http://toolbar.compete.com/siteprofile/google.com</link>
    <icon>http://home.compete.com.edgesuite.net/site_media/images/icons/profile_3_53.gif</icon>
    </rank>
    <metrics caption=”Profile”>
    <val>
    <mth>12</mth>
    <yr>2006</yr>
    <uv>
    <ranking>2</ranking>
    <count>115,120,111</count>
    </uv>
    </val>
    <link>http://toolbar.compete.com/siteprofile/google.com</link>
    <icon>http://home.compete.com.edgesuite.net/site_media/images/icons/profile_3_53.gif</icon>
    </metrics>
    <deals caption=”Deals”>
    <val>1</val>
    <link>http://toolbar.compete.com/deals/google.com</link>
    <icon>http://home.compete.com.edgesuite.net/site_media/images/icons/deals_on_53.gif</icon>
    </deals>
    </dmn>
    </ci>

    How to parse it?

    You can develop your on xml parser, but if you use PHP or .NET it is really not necessary you can use the scripts that Compete.com provides to you.

    .NET wrapper

    PHP5 wrapper

    PHP5 wrapper in the PEAR repository

    More info access developer zone from Compete.com

    Leave a reply