Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/timursevimli/geoip-api

GeoIP Api
https://github.com/timursevimli/geoip-api

Last synced: 2 days ago
JSON representation

GeoIP Api

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'
```