Welcome to the GeoJoe API!If you didn't know, GeoJoe is an online look-up service for locating IP addresses, servers and domain names. Simply input an IP or server name on the main GeoJoe website and GeoJoe will tell you exactly where in the world it is - often right down to the city, town or village - along with precise geographical co-ordinates and other such useful data. GeoJoe API for Developers and WebmastersThe GeoJoe API (Application Programming Interface) allows developers and webmasters to retrieve geolocation data for embedding within their own websites and applications . Using simple query syntax, users can pass the API single or multiple IP addresses and get back a variety of results, depending upon their requirements, in various formats. The GeoJoe API currently contains:
Calling the API functionsSingleThe single format takes an IP address and returns all geolocation data in key/value pairs. Method Name: single URL: http://www.geojoe.co.uk/api/single Passed Variables: ip or domain name (optional) Returned Formats: key/value pairs Returned Variables:
Example Callhttp://www.geojoe.co.uk/api/single/?ip=209.85.171.99 Note: If you omit the ip variable the IP calling the script will be used. Example Outputip=209.85.171.99&country_code=US&country_name=United States®ion=California&city=Mountain View&latitude=37.4192&longitude=-122.0574 BatchThe batch format takes a CSV of IP address and returns all geolocation data in the chosen format. Method Name: batch URL: http://www.geojoe.co.uk/api/batch Passed Variables: ips - CSV of IP addresses or domain names, format Returned Formats: key/value pairs (default) or XML Returned Variables:
Example Callhttp://www.geojoe.co.uk/api/batch/?ips=209.85.171.99,127.0.0.1,127.0.0.1&format=xml Note: If you omit the format variable, the default key/value pairs will be returned. Example XML Output<?xml version="1.0" encoding="iso-8859-1"?>
<results> <geodata> <ip>xx.xx.xx.xx</ip> <country_code>US</country_code> <country_name>United States</country_name> <region>California</region> <city>Mountain View</city> <latitude>37.4192</latitude> <longitude>-122.0574</longitude> </geodata>... ... <results> BadgeThe badge call takes an IP address and generates a badge based on the visitor's IP address. Method Name: badge URL: http://www.geojoe.co.uk/api/badge Passed Variables: ip or domain name, text, bg, border Returned Formats:Embedded Image (using GD) Returned Variables: Not Applicable Example CallSimply copy and paste the following code into your page where you want the badge to appear: <img src="http://www.geojoe.co.uk/api/badge/?ip=209.85.171.99&text=darkgreen&bg=ivory&border=darkgreen" alt="GeoJoe - IP Geolocation Services" title="GeoJoe - IP Geolocation Services" width="200" height="60" /> Note: If you omit the ip variable, the IP calling the script will be used. Here's how it looksVariables you can changeYou can modify the following variables (shown in bold italics above) to change the colours of your badge.
Available coloursYou can combine any of the following colours:
Default BadgeIf you do not include any variables, you'll see the default colours... <img src="http://www.geojoe.co.uk/api/badge/" alt="GeoJoe - IP Geolocation Services" title="GeoJoe - IP Geolocation Services" width="200" height="60" /> FlagThe badge call takes an IP address and generates a flag based on an IP address. Method Name: badge URL: http://www.geojoe.co.uk/api/flag Passed Variables: ip or domain name (optional) Returned Formats:Embedded Image (using GD) Returned Variables: Not Applicable Example CallSimply copy and paste the following code into your page where you want the flag to appear: <img src="http://www.geojoe.co.uk/api/flag/?ip=209.85.171.99" /> Note: If you omit the ip variable, the IP calling the script will be used. Example Output
You could use CSS and place the image between a <span> or <div> to format it further. More instructions coming soon! |

