Skip to content
This repository was archived by the owner on Jun 8, 2025. It is now read-only.

realchandan/Ip-geo-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Intro

Hi there!

Here is a ready-to-deploy IP geolocation server. It works for both IPv4 and IPv6. However, the underlying database isn't very large. It uses the OpenGeoFeed database, available here.

How to Use

Here's a command to run it using Docker:

docker run -p 8080:8080 ghcr.io/realchandan/ip-geo-api

Request

curl localhost:8080/getIpInfo?addr=140.82.114.3

Response

{ "ok": true, "country": "US", "ip_addr": "140.82.114.3", "ip_v6": false }

Configuration

You can set AUTO_UPDATE=true as an environment variable to make the program check for updates every time. Also, be sure to mount /app/data as a Docker volume so downloaded CSVs can be saved.

License

The database is licensed under CC0.

This means:

CC0 doesn't legally require users of the data to cite the source!

But feel free to attribute the IP database provider! ❤️

The code in this repository is licensed under the MIT License.

Thanks!

Packages