More than 1703 benchmarks completed!
Follow us on twitter

API Access

PetaByet GeoIP & JsonIP REST API (now with IPv6 support!)

About

PetaByet offers a free GeoIP & JsonIP API to developers for their projects.
The output is JSON (JavaScript Object Notation) which can be integrated into anything.
We offer this service for free public use (both commercial/non-commercial) and an optional link back is appreciated.

API End Points

http://api.petabyet.com/ip/
http://api.petabyet.com/jsonip/
http://api.petabyet.com/geoip/
The database is updated monthly.
Last updated: 20 June 2019

GeoIP API Usage

Get GeoIP data of your IP: http://api.petabyet.com/geoip/

Get information about a specific IP address: http://api.petabyet.com/geoip/{ip-address}

Example GeoIP Output

Below you can find the output of our API server:

GET /geoip/162.245.217.117
{
  "ip": "162.245.217.117",
  "continent_code": "NA",
  "country": "United States",
  "country_code": "US",
  "country_code3": "USA",
  "region": "North Carolina",
  "region_code": "NC",
  "city": "Charlotte",
  "postal_code": "28202",
  "latitude": 35.2316,
  "longitude": -80.8428,
  "timezone": "America/New_York",
  "offset": -14400,
  "asn": 7489,
  "organization": "HostUS"
}

Acknowledgement

This product includes GeoLite2 data created by MaxMind, available from https://www.maxmind.com.

JsonIP API Usage

Get your IP address: http://api.petabyet.com/jsonip

JsonIP Example Output

GET /jsonip/
{"ip":"192.168.1.1"}

Simple IP

Get your IP address in plain text http://api.petabyet.com/ip

GET /ip/
192.168.1.1

Error Output

When an error occurs (eg. Bad input), an error message will be presented.

HTTP: 400 (Bad Request)
JSON Response:
GET /geoip/1.0
{
	"code": 400,
	"errormessage": "You did not enter a valid IP address"
}