IP to location APIs

HostIP.info API

by hostip.info

IP to location APIs Added on February 4th, 2011 Checked and working on November 15th, 2026
Visit hostip.info →

What it does

This is an easy HTTP oriented API to locate IP addresses and Geocode them. If you don't supply the "?ip=aa.bb.cc.dd" bit, then the ip address lookup of the calling machine will be located instead (here, the aa,bb,cc,dd are decimal digits). If you add &position=true to the end of the URL then latitude and longitude will be returned also. Both HTML and XML formats are supplied for your convenience.
  • HTTP-GET

At a glance

API key
Not needed · More APIs with no key
From the browser
Yes (CORS)
Interface
HTTP-GET
Provider
hostip.info
Last checked
Working on November 15th, 2026

More information: http://www.hostip.info/use.php

Is this your service? Show that it is listed

Put this badge on your website or in your README; it links to this page. About the badge

Listed on Free Web Services

hostip.info
HostIP.info API

Example request

curl

curl 'http://api.hostip.info/get_json.php?ip=8.8.8.8'

JavaScript

const response = await fetch("http://api.hostip.info/get_json.php?ip=8.8.8.8");
const text = await response.text();
console.log(text);

Python

import requests

response = requests.get(
    "http://api.hostip.info/get_json.php?ip=8.8.8.8",
    timeout=30,
)
print(response.text)

The JavaScript works in a web page as well as in Node.js 18 or newer.

Did it work for you?

Tell us what you found when you tried HostIP.info API.