API Docs

Learn how to integrate GeoPeeker into your projects

Introduction

Our API allows you to integrate GeoPeeker's many features into your own applications. Want to have renders for your site appear in a backend admin system? Or just the DNS records? Go for it. Pick and choose the features you need and wire them into your own applications however you see fit.

The API is built to be as simple as possible to use, and can be accessed from any language or framework capable of making an HTTP request. Typically this is done with cURL, a cross-platform tool that makes interaction with our API a breeze. We've also created a simple wrapper, written in PHP, that can be used as a guide for crafting your own in whatever language you prefer.

For now, this documentation will focus on interacting with the API via PHP, but a full API spec is coming soon. In the meantime, if you're crafty, you should be able to infer everything you need to know from this PHP example.

Getting Started (in PHP)

The first thing you'll need to access the API is a GeoPeeker Pro or Enterprise subscription. Check out our plans if you don't have one yet. You can also upgrade from within your existing GeoPeeker Free account.

The next thing you'll want to do is grab the GeoPeekerApiWrapper class on GitHub, found here: https://github.com/lewsid/geopeeker-php-api-wrapper

Include the class in your script, and update the private_key and public_key variables with those found in your GeoPeeker Account interface. Even if you aren't using PHP in your project, you may find the documentation included in the class useful for constructing your requests.

PHP Wrapper Example Usage

Making a request is pretty straight forward. The most basic operation is performing a peek. A peek includes renders, ping, IP, and source code for a given URL from as many locations as you require.

$public_key = '12f0b42a5c5dad851c5995f6ddd346812';
$private_key = '4be6a55c3d72f077f675101d1b4132f7';
 
$wrapper = new GeoPeekerApiWrapper($public_key, $private_key);
$response = $wrapper->doPeek('example.com', 'en', null, 1000, array(0 => 'virginia'), array(0 => '640x960'));
					
PHP Wrapper Example Response

The response from the API is a json-encoded string containing all the elements of a peek:

{
  "success": 1,
  "locations": {
    "virginia": {
      "ip": "93.184.216.34",
      "ping": "2",
      "dns": "DNS Recordsexample.com name server b.iana-servers.net.\nexample.com name server a.iana-servers.net.\n
              A Recordsexample.com has address 93.184.216.34\nCNAME Recordsexample.com has no CNAME record\n
              MX Recordsexample.com has no MX record\n
              TXT Recordsexample.com descriptive text \"v=spf1 -all\"\n
              example.com descriptive text \"$Id: example.com 4380 2015-08-12 20:14:21Z davids $\"\n
              SOA Recordsexample.com has SOA record sns.dns.icann.org. noc.dns.icann.org. 
              2015081206 7200 3600 1209600 3600\n",
      "renders": {
        "640x960": {
          "original": "https://www.geopeeker.com/uploads/api/55ccb0a24abdb_en_640x960_4.png",
          "thumb": "https://www.geopeeker.com/uploads/api/55ccb0a24abdb_en_640x960_4_thumb.png",
          "source": "https://www.geopeeker.com/uploads/api/55ccb0a24abdb_en_640x960_4_source.txt"
        }
      }
    }
  }
}
					

Note: It is recommended that you make local copies of any renders if you plan to use them later. They are automatically deleted from our servers every 15 minutes.