Free IP API
Documentation
Tools
Pricing
Status
Rate Limit
Contact
Blog
svg]:px-3 absolute right-4 bottom-4 left-4 absolute right-4 bottom-4 left-4" data-slot="button" href="https://freeipapi.com/login" x-on:click="menu = false"><br>Login
Docs
Tools
Pricing
Status
Rate Limit
Blog
Contact
svg]:px-3" data-slot="button" href="https://freeipapi.com/login"><br>Login
Features
Explore our comprehensive suite of APIs designed to provide accurate and reliable geolocation data<br>and related information for your applications.
IP Geolocation
Get detailed geolocation information for any IPv4 or IPv6 address. Includes country, city, region,<br>coordinates, timezone, currency, and more. Available in JSON and XML formats.
Countries API
Access comprehensive country information including name, code, capital, and more. Query all<br>countries or get details for a specific country by code.
Phone Codes
Get international dialing codes for countries worldwide. Retrieve all phone codes or look up<br>specific codes by country. Essential for international communication features.
Timezones
Query timezone information for any location. Get timezone offset, abbreviation, and DST information.<br>Perfect for scheduling and time conversion applications.
Distance Calculator
Calculate the distance between two IP addresses' geographic coordinates. Returns distance in<br>kilometers and miles. Useful for location-based services and proximity calculations.
Proxy Detection
Detect if an IP address is using a proxy, VPN, or hosting service. Enhance security and prevent<br>fraud with accurate proxy detection included in geolocation responses.
Bulk IP Lookup
Process multiple IP addresses in a single request (up to 50 IPs). Perfect for batch operations,<br>analytics, and processing large datasets efficiently.
Languages API
Access language information by country or language code. Discover which countries use specific<br>languages. Essential for internationalization and localization projects.
How it works?
FreeIPAPI is a free service for commercial and non-commercial uses. We're using multiple<br>data sources<br>and various ways of calculations, to provide this API. Since we're running servers to provide this<br>service, to prevent heavy loads on our servers we apply a limit of 60 requests per minute. However,<br>if you need more, you can subscribe to our paid plan.
How to use?
The API accepts GET and POST methods and you can pass ip field as body or query param. However, If<br>you don't pass the ip field we'll use the sender's ip address to extract the information. Here you<br>can find some sample codes to use it however, you can read our<br>documentation
PHP
Curl
Python
Java
JS (Node.js)
JS (JQuery)
Go
Ruby
C#
Rust
# Get the ip info<br>curl https://free.freeipapi.com/api/json/1.1.1.1
# Get only public ip address<br>curl https://free.freeipapi.com
import requests
ip_address = "{IP-ADDRESS}"<br>url = f"https://free.freeipapi.com/api/json/{ip_address}"
response = requests.get(url)<br>data = response.json()
print(data)
import java.io.BufferedReader;<br>import java.io.IOException;<br>import java.io.InputStreamReader;<br>import java.net.HttpURLConnection;<br>import java.net.URL;
public class Main {<br>public static void main(String[] args) throws IOException {<br>String ipAddress = "{IP-ADDRESS}";<br>String urlString = "https://free.freeipapi.com/api/json/" + ipAddress;
URL url = new URL(urlString);<br>HttpURLConnection connection = (HttpURLConnection) url.openConnection();<br>connection.setRequestMethod("GET");
BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));<br>StringBuilder response = new StringBuilder();<br>String line;<br>while ((line = reader.readLine()) != null) {<br>response.append(line);<br>reader.close();
System.out.println(response.toString());
const axios = require('axios');
const ipAddress = "{IP-ADDRESS}";<br>const url = `https://free.freeipapi.com/api/json/${ipAddress}`; // to get specific ip's info<br>// const url = `https://free.freeipapi.com/api/json`; // to get current request's ip info
axios.get(url)<br>.then(response => {<br>const data = response.data;<br>console.log(data);<br>})<br>.catch(error => {<br>console.error(error);<br>});
const url = `https://free.freeipapi.com/api/json`; // get current request's ip info
$.get(url, function (data) {<br>console.log(data);<br>});
package main
import (<br>"fmt"<br>"io/ioutil"<br>"net/http"
func main() {<br>ipAddress := "{IP-ADDRESS}"<br>url := fmt.Sprintf("https://free.freeipapi.com/api/json/%s", ipAddress)
response, err := http.Get(url)<br>if err != nil {<br>fmt.Println(err)<br>return<br>defer response.Body.Close()
body, err := ioutil.ReadAll(response.Body)<br>if err != nil {<br>fmt.Println(err)<br>return
fmt.Println(string(body))
require 'net/http'<br>require 'json'
ip_address = "{IP-ADDRESS}"<br>url = URI.parse("https://free.freeipapi.com/api/json/#{ip_address}")<br>http = Net::HTTP.new(url.host, url.port)<br>http.use_ssl = true
request = Net::HTTP::Get.new(url.request_uri)<br>response = http.request(request)<br>data = JSON.parse(response.body)
puts data
using...