Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/risk3sixty/geoapi
Lightweight API service to get geolocation data from IP addresses.
https://github.com/risk3sixty/geoapi
Last synced: about 2 months ago
JSON representation
Lightweight API service to get geolocation data from IP addresses.
- Host: GitHub
- URL: https://github.com/risk3sixty/geoapi
- Owner: risk3sixty
- License: mit
- Created: 2019-12-04T23:39:48.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T02:23:18.000Z (over 1 year ago)
- Last Synced: 2024-07-11T02:01:24.177Z (2 months ago)
- Language: JavaScript
- Homepage: https://geo.risk3sixty.com
- Size: 1.2 MB
- Stars: 709
- Watchers: 9
- Forks: 39
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome - risk3sixty/geoapi - Lightweight API service to get geolocation data from IP addresses. (JavaScript)
README
# [risk3sixty](https://risk3sixty.com)
## geoapi
Tiny API service to report geolocation data from IP addresses.
The underlying data is coming from [geoip-lite](https://www.npmjs.com/package/geoip-lite)
so special thanks to the contributors of this package and
[MaxMind](https://maxmind.com) for keeping up-to-date information
in the geolocation DB!### Usage
Make a GET request to the geoapi endpoint with `/me` or an IP
address (IPv4 or IPv6) located in the path of the URL, e.g.
`https://geo.risk3sixty.com/8.8.8.8`. The server responds with JSON
that contains geolocation data present for the provided IP address,
or your current IP address if `/me` was passed.Also, [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS)
is enabled for browser usage.```sh
# https://geo.risk3sixty.com/IPV4_OR_IPV6_IP_ADDRESS$ curl https://geo.risk3sixty.com/me
{"ip":"196.245.163.202","range":[3304431616,3304432639],"country":"GB","region":"ENG","eu":"1","timezone":"Europe/London","city":"London","ll":[51.5064,-0.02],"metro":0,"area":50}$ curl https://geo.risk3sixty.com/128.61.0.0
{"ip":"128.61.0.0","range":[2151481344,2151546879],"country":"US","region":"GA","eu":"0","timezone":"America/New_York","city":"Atlanta","ll":[33.7746,-84.3973],"metro":524,"area":5}$ curl https://geo.risk3sixty.com/2001:468:300:0:0:0:0:0
{"ip":"2001:468:300:0:0:0:0:0","range":"","country":"US","region":"","city":"","ll":[37.751,-97.822],"metro":0,"area":100,"eu":"0","timezone":"America/Chicago"}
```### Development
```sh
$ git clone https://github.com/risk3sixty/geoapi
$ cd geoapi
$ npm install# run tests
$ npm test# build production files
$ npm run build# start server
$ npm start
```### License
MIT