Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/timursevimli/geoip-api
GeoIP Api
https://github.com/timursevimli/geoip-api
Last synced: 2 days ago
JSON representation
GeoIP Api
- Host: GitHub
- URL: https://github.com/timursevimli/geoip-api
- Owner: timursevimli
- License: mit
- Created: 2024-03-05T00:36:52.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-07-18T19:47:02.000Z (4 months ago)
- Last Synced: 2024-07-19T03:28:36.484Z (4 months ago)
- Language: JavaScript
- Size: 62.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GeoIP - API
### Install
```bash
npm install @tsevimli/geo-api
# or
git lfs clone https://github.com/timursevimli/geoip-api.git
```### Usage (API)
```bash
npm start # default running on port 8000 or PORT=8000 node main.js
curl "http://localhost:8000?ip=8.8.8.8" # -> {"country":"US"}
# or
curl "http://localhost:8000" # -> return ip of forwarder or sender of the request
```### Usage (Module)
```javascript
'use strict';const { getGeoInfo } = require('geo-api');
console.log(getGeoInfo('8.8.8.8')); //output -> 'US'
```