Endpoints

Last updated: Jan 14, 2018

GeoJS’s main endpoint gives you the ability to lookup the requesters/specific IP information in multiple formats.

IP


This endpoint returns the requesters IP. You can specify a custom callback for the JSONP endpoint.

URIs

Type URI
Text https://get.geojs.io/v1/ip
JSON https://get.geojs.io/v1/ip.json
JSONP https://get.geojs.io/v1/ip.js(?callback=custom)

Query Parameters

Paramater Default Description Endpoint
callback geoip JSONP callback /v1/ip.js

Example Responses

45.63.26.69
{
  "ip": "45.63.26.69"
}
geoip({
  "ip": "45.63.26.69"
})

IP - Country


This endpoint returns information about an IPs country. You can specify a custom callback for the JSONP endpoint along with requesting information about multiple IPs using the IP arg.

All URIs support looking up a specific IP address by adding it as part of the URI. The JSON and text URIs have the additional option to supply multiple IPs (IPv6 or IPv4) comma separated in the IP arg.

URIs

Type URI
Text https://get.geojs.io/v1/ip/country(?ip=8.8.8.8,198.35.26.96) https://get.geojs.io/v1/ip/country/{ip address}
JSON https://get.geojs.io/v1/ip/country.json(?ip=8.8.8.8,198.35.26.96) https://get.geojs.io/v1/ip/country/{ip address}.json
JSONP https://get.geojs.io/v1/ip/country.js(?callback=custom&ip=8.8.8.8,198.35.26.96) https://get.geojs.io/v1/ip/country/{ip address}.js(?callback=custom)

Query Parameters

Paramater Default Description Endpoint
ip None Allows searching of multiple IPs at once All
callback countryip JSONP callback /v1/ip/country.js

Example Responses

AU

When multiple IPs are queried using the the ip arg on a request you get a response like this:

8.8.8.8: US
198.35.26.96: US
{
  "ip": "8.8.8.8",
  "country": "US",
  "name": "United States",
  "country_3": "USA"
}

When querying multiple IPs using the ip arg the return becomes a list like below:

[
  {
    "name": "United States",
    "country": "US",
    "ip": "8.8.8.8",
    "country_3": "USA"
  },
  {
    "name": "United States",
    "country": "US",
    "ip": "198.35.26.96",
    "country_3": "USA"
  }
]
countryip({
  "ip": "8.8.8.8",
  "country": "US",
  "name": "United States",
  "country_3": "USA"
})

When querying multiple IPs using the ip arg the return becomes a list like below:

countryip(
  [
    {
      "name": "United States",
      "country": "US",
      "ip": "8.8.8.8",
      "country_3": "USA"
    },
    {
      "name": "United States",
      "country": "US",
      "ip": "198.35.26.96",
      "country_3": "USA"
    }
  ]
)

IP - Country Full


This endpoint only has a text version available as it is the exact same as the above, however it returns the full country name as opposed to the two letter code.

URIs

Type URI
Text https://get.geojs.io/v1/ip/country/full(?ip=8.8.8.8,198.35.26.96) https://get.geojs.io/v1/ip/country/full/{ip address}

Query Parameters

Paramater Default Description Endpoint
ip None Allows searching of multiple IPs at once /v1/ip/country/full

Example Responses

Australia
8.8.8.8: United States
198.35.26.96: United States

IP - Geo


Unlike other endpoints the Geo endpoint doesn’t have a text based version, it simply contains too much information to be useful as plain text. If people think otherwise, please reach out and let me know.

This endpoint mainly contains geographical information about an IP, such as its latitude and longitude, along with the owning (ASN) organisiation.

URIs

Type URI
JSON https://get.geojs.io/v1/ip/geo.json(?ip=8.8.8.8,198.35.26.96) https://get.geojs.io/v1/ip/geo/{ip address}.json
JSONP https://get.geojs.io/v1/ip/geo.js(?callback=custom&ip=8.8.8.8,198.35.26.96) https://get.geojs.io/v1/ip/geo/{ip address}.js(?callback=custom)

Query Parameters

Paramater Default Description Endpoint
ip None Allows searching of multiple IPs at once All
callback geoip JSONP callback /v1/ip/geo.js

Example Responses

{
  "area_code": "0",
  "continent_code": "NA",
  "country": "United States",
  "country_code": "US",
  "country_code3": "USA",
  "ip": "8.8.8.8",
  "latitude": "37.7510",
  "longitude": "-97.8220",
  "organization": "AS15169 Google Inc.",
  "timezone": ""
}

When multiple IPs are queried using the the ip arg on a request you get a response like this:

[
  {
    "area_code": "0",
    "continent_code": "NA",
    "country": "United States",
    "country_code": "US",
    "country_code3": "USA",
    "ip": "8.8.8.8",
    "latitude": "37.7510",
    "longitude": "-97.8220",
    "organization": "AS15169 Google Inc.",
    "timezone": ""
  },
  {
    "area_code": "0",
    "city": "San Francisco",
    "continent_code": "NA",
    "country": "United States",
    "country_code": "US",
    "country_code3": "USA",
    "ip": "198.35.26.96",
    "organization": "AS14907 Wikimedia Foundation, Inc.",
    "region": "California",
    "timezone": "America/Los_Angeles"
  }
]
geoip({
  "city": "San Francisco",
  "timezone": "America\/Los_Angeles",
  "organization": "AS14907 Wikimedia Foundation, Inc.",
  "region": "California",
  "latitude": "37.7898",
  "country_code": "US",
  "ip": "8.8.8.8",
  "longitude": "-122.3942",
  "area_code": "0",
  "continent_code": "US",
  "country": "United States",
  "country_code3": "USA"
})

When querying multiple IPs using the ip arg the return becomes a list like below:

geoip(
  [
    {
      "longitude": "-97.8220",
      "latitude": "37.7510",
      "timezone": "",
      "organization": "AS15169 Google Inc.",
      "country_code": "US",
      "ip": "8.8.8.8",
      "area_code": "0",
      "continent_code": "NA",
      "country": "United States",
      "country_code3": "USA"
    },
    {
      "longitude": "-122.3942",
      "city": "San Francisco",
      "timezone": "America\/Los_Angeles",
      "region": "California",
      "organization": "AS14907 Wikimedia Foundation, Inc.",
      "country_code": "US",
      "ip": "198.35.26.96",
      "latitude": "37.7898",
      "area_code": "0",
      "continent_code": "NA",
      "country": "United States",
      "country_code3": "USA"
    }
  ]
)

DNS


GeoJS’ second endpoint allows you to query PTR records for IPs.

DNS - PTR


This endpoint returns the requester IP’s PTR record. It is not currently possible to lookup multiple PTRs at once.

URIs

Type URI
Text

https://get.geojs.io/v1/dns/ptr
https://get.geojs.io/v1/dns/ptr/{ip address}

JSON

https://get.geojs.io/v1/dns/ptr.json
https://get.geojs.io/v1/dns/ptr/{ip address}.json

JSONP

https://get.geojs.io/v1/dns/ptr.js(?callback=custom) https://get.geojs.io/v1/dns/ptr/{ip address}.js(?callback=custom)

Query Parameters

Paramater Default Description Endpoint
callback ptr JSONP callback /v1/dns/ptr.js

Example Responses

google-public-dns-a.google.com
{
  "ptr": "google-public-dns-a.google.com"
}
ptr({
  "ptr": "google-public-dns-a.google.com"
})