NestJS 기반 MaxMind GeoIP API입니다. GeoLite2 데이터베이스를 30분마다 자동으로 다운로드합니다.
npm install# 개발 모드 (watch)
npm run start:dev
# 프로덕션
npm run build
npm run start:prodGET /asn/:ip| Parameter | Type | Description |
|---|---|---|
ip |
string |
조회할 IP 주소 |
GET /country/:ip| Parameter | Type | Description |
|---|---|---|
ip |
string |
조회할 IP 주소 |
GET /city/:ip| Parameter | Type | Description |
|---|---|---|
ip |
string |
조회할 IP 주소 |
GET /geolocation/:ip| Parameter | Type | Description |
|---|---|---|
ip |
string |
조회할 IP 주소 |
응답 예시:
{
"ISP": "GOOGLE",
"registered_country_code": "US",
"registered_country": "United States",
"country_code": "US",
"country": "United States",
"continent_code": "NA",
"continent": "North America",
"location": {
"accuracy_radius": 1000,
"latitude": 37.751,
"longitude": -97.822,
"time_zone": "America/Chicago"
}
}GET /isp| Status Code | Description |
|---|---|
| 200 | 정보 조회 성공 |
| 400 | 유효하지 않은 IP |
| 422 | MaxMind DB에 정보 없음 |
서버 시작 시 및 30분마다 다음 데이터베이스를 자동으로 다운로드합니다:
- GeoLite2-ASN.mmdb
- GeoLite2-City.mmdb
- GeoLite2-Country.mmdb
데이터베이스 출처: P3TERX/GeoLite.mmdb