GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ipapi-co/api: API for IP address lookup (ipapi.co)

BranchesTags
Open more actions menu

Latest commit

 

History

4 Commits
4 Commits

Folders and files

NameName
Last commit message
Last commit date
README.md
README.md
 
 
index.rst
index.rst
 
 

Repository files navigation

Introduction

Documentation for IP address location API from ipapi.co.

You can use our API to lookup an IP address and get its location information. This includes city, region, country, latitude, longitude and time zone. Both IPv4 & IPv6 type addresses are supported.

Get Location from a specific IP Address

This endpoint retrieves location for the IP address specified in the URL.

GET https://ipapi.co/<IP>/json/

URL Parameters

Parameter Description
IP The IP address for which you want to retrieve the location

curl https://ipapi.co/8.8.8.8/json/

The above command returns JSON structured like this:

{
    "ip" : "8.8.8.8", 
    "city" : "Mountain View", 
    "region" : "California", 
    "country" : "US", 
    "postal" : "94040", 
    "latitude" : 37.3845, 
    "longitude" : -122.0881,
    "timezone" : "America/Los_Angeles"
}

Code samples in common languages

ruby

require 'net/http'
require 'json'

loc = Net::HTTP.get(URI('https://ipapi.co/8.8.8.8/json/'))
puts JSON.parse(loc)

python

from requests import get

loc = get('https://ipapi.co/8.8.8.8/json/')
print loc.json()

php

<?php
    $loc = file_get_contents('https://ipapi.co/8.8.8.8/json/');
    echo $loc;
    $obj = json_decode($loc);
?>

Node.js

var https = require('https');

https.get('https://ipapi.co/8.8.8.8/json/', function(resp){
    var body = ''
    resp.on('data', function(data){
        body += data;
    });

    resp.on('end', function(){
        var loc = JSON.parse(body);
        console.log(loc);
    });
});

jQuery

$.getJSON('https://ipapi.co/8.8.8.8/json/', function(data){
  console.log(data)
})

Find your public IP Address and get its location

This endpoint retrieves location for your IP address.

GET https://ipapi.co/json/

curl https://ipapi.co/json/

Retrieve location for your IP address formatted as JSON
(say your IP address is "208.67.222.222")

{
    "ip" : "208.67.222.222", 
    "city" : "San Francisco", 
    "region" : "California", 
    "country" : "US", 
    "postal" : "94107", 
    "latitude" : 37.7697, 
    "longitude" : -122.3933,
    "timezone" : "America/Los_Angeles"
}

Code samples in common languages

ruby

require 'net/http'
require 'json'

loc = Net::HTTP.get(URI('https://ipapi.co/json/'))
puts JSON.parse(loc)

python

from requests import get

loc = get('https://ipapi.co/json/')
print loc.json()

php

<?php
    $loc = file_get_contents('https://ipapi.co/json/');
    echo $loc;
    $obj = json_decode($loc);
?>

Node.js

var https = require('https');

https.get('https://ipapi.co/json/', function(resp){
    var body = ''
    resp.on('data', function(data){
        body += data;
    });

    resp.on('end', function(){
        var loc = JSON.parse(body);
        console.log(loc);
    });
});

jQuery

$.getJSON('https://ipapi.co/json/', function(data){
  console.log(data)
})

About

API for IP address lookup (ipapi.co)

ipapi.co

Topics

apigeolocationipip-addressip-locationip-lookupipapijsonlocationlookup

Resources

Readme
Activity

Stars

29 stars

Watchers

4 watching

Forks

5 forks
Report repository

Releases

Packages

Contributors

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.