OpenIPApi

API 문서

OpenIPApi를 애플리케이션에 통합하는 데 필요한 모든 것. 기본 URL: https://api.openipapi.com (/v1로 버전 관리).

신호이며, 판정이 아닙니다. IP 인텔리전스는 확률적입니다. threat_score와 VPN/프록시/Tor 플래그는 의사결정 로직에 대한 입력입니다. 계정, 결제, 기기, 행동 신호와 결합하여 사용하시고, 차단의 유일한 근거로 사용하지 마십시오. 자세한 내용은 데이터 방법론을 참조하십시오.

인증

모든 API 요청에는 X-API-Key 요청 헤더에 API 키를 포함해야 합니다. API 키는 콘솔.

X-API-Key: oip_your_api_key_here
API 키를 비밀로 유지하세요. 클라이언트 측 JavaScript나 공개 저장소에 노출하지 마세요.

기본 URL

모든 API 요청은 HTTPS를 통해 다음 기본 URL로 이루어집니다:

https://api.openipapi.com

기계 판독 가능 사양 (OpenAPI 3.1): /openapi.yaml.

응답 형식

모든 응답은 JSON입니다. 성공적인 응답은 HTTP 200. 오류 응답은 적절한 4xx 또는 5xx 상태 코드와 error 필드를 반환합니다.

{
  "error": "invalid_api_key",
  "message": "The provided API key is invalid or has been revoked.",
  "status": 401
}

GET /v1/lookup/{ip}

단일 IP 주소의 위치정보, 네트워크, 위협 데이터를 조회합니다.

GET https://api.openipapi.com/v1/lookup/{ip}

파라미터

파라미터 유형 설명
ip path 조회할 IPv4 또는 IPv6 주소.
fields query (optional) 반환할 최상위 필드의 쉼표로 구분된 목록: geo,network,threat,abuse.
date query (optional) 과거 조회 — 지정된 날짜의 이 IP 스냅샷을 반환합니다 (YYYY-MM-DD). 최대 365일 이전까지. 다음이 필요합니다 Pro+. 다음을 반환합니다 no_snapshot 해당 날짜에 데이터가 없는 경우 오류.

응답 필드

필드 설명 플랜
ip The queried IP address. All
type IPv4 or IPv6. All
geo.country_code 2-letter ISO 3166-1 country code. All
geo.country Full country name. All
geo.region Region / state name. All
geo.region_code Region / state code. All
geo.city City name. All
geo.postal_code Postal / ZIP code. All
geo.latitude Latitude (decimal degrees). All
geo.longitude Longitude (decimal degrees). All
geo.timezone IANA timezone identifier (e.g. Europe/Berlin). All
geo.is_sanctioned True if the country is on OFAC, EU, or UN sanction lists. All
geo.sanction_lists Array of applicable sanction programs, e.g. ["OFAC","EU"]. All
network.asn Autonomous System Number. Starter+
network.as_name AS organisation name. Starter+
network.as_domain AS organisation domain. Starter+
network.isp Internet Service Provider name. All
network.organization Network organisation name. All
network.connection_type residential, datacenter, mobile, education, or government. All
threat.is_vpn True if the IP is a known VPN endpoint. Pro+
threat.is_proxy True if the IP is a known open proxy. Pro+
threat.is_tor True if the IP is a Tor exit node. Pro+
threat.is_relay True if the IP is an anonymous relay. Pro+
threat.is_hosting True if the IP belongs to a hosting provider. Pro+
threat.threat_score Composite risk score 0–100. A signal, not a final verdict — combine with account, payment, device and behavior data. Pro+
threat.threat_categories Array of threat category strings. Pro+
threat.bot_type Verified bot identifier (e.g. "googlebot", "bingbot") or null. Verified via reverse-DNS + forward confirmation. All
abuse.contact_email Abuse contact email from WHOIS data. Pro+

요청 예제

$ curl https://api.openipapi.com/v1/lookup/185.220.101.45 \
     -H "X-API-Key: oip_your_api_key_here"

응답 예제

{
  "ip": "185.220.101.45",
  "type": "IPv4",
  "geo": {
    "country_code": "DE",
    "country": "Germany",
    "region": "Hessen",
    "region_code": "HE",
    "city": "Frankfurt am Main",
    "postal_code": "60313",
    "latitude": 50.1109,
    "longitude": 8.6821,
    "timezone": "Europe/Berlin",
    "is_sanctioned": false,
    "sanction_lists": []
  },
  "network": {
    "asn": 205100,
    "as_name": "F3 Netze e.V.",
    "as_domain": "f3netze.de",
    "isp": "F3 Netze",
    "organization": "F3 Netze e.V.",
    "connection_type": "datacenter"
  },
  "threat": {
    "is_vpn": true,
    "is_proxy": false,
    "is_tor": true,
    "is_relay": false,
    "is_hosting": true,
    "threat_score": 85,
    "threat_categories": ["tor_exit_node", "known_abuser"],
    "bot_type": null
  },
  "abuse": {
    "contact_email": "abuse@f3netze.de"
  }
}

POST /v1/lookup/batch

단일 요청으로 여러 IP 주소를 조회합니다. 일괄 크기 제한은 플랜에 따라 다릅니다.

POST https://api.openipapi.com/v1/lookup/batch
일괄 조회는 Starter 플랜 이상이 필요합니다. 무료 플랜 계정은 plan_required 오류를 받습니다.

일괄 크기 제한

플랜 요청당 최대 IP 수
Starter 100
Pro 500
Business 1,000
Enterprise 5,000

요청 본문

{
  "ips": [
    "185.220.101.45",
    "8.8.8.8",
    "1.1.1.1"
  ]
}

응답

요청과 동일한 순서로 전체 조회 객체의 래핑된 배열을 반환합니다.

{
  "results": [
    { "ip": "185.220.101.45", /* full lookup object */ },
    { "ip": "8.8.8.8",          /* full lookup object */ },
    { "ip": "1.1.1.1",          /* full lookup object */ }
  ],
  "count": 3
}

GET /v1/me

요청을 하는 IP 주소의 위치정보 및 위협 데이터를 반환합니다. "내 IP는?"과 같은 기능에 유용합니다.

GET https://api.openipapi.com/v1/me

응답은 GET /v1/lookup/{ip} 와 동일하며 호출자의 IP가 미리 채워집니다.

$ curl https://api.openipapi.com/v1/me \
     -H "X-API-Key: oip_your_api_key_here"

GET /v1/asn/{asn}

자율 시스템 번호에 대한 자세한 정보를 검색합니다. Starter 플랜 이상이 필요합니다.

GET https://api.openipapi.com/v1/asn/{asn}

asn 파라미터는 13335AS13335 형식을 모두 허용합니다.

$ curl https://api.openipapi.com/v1/asn/13335 \
     -H "X-API-Key: oip_your_api_key_here"

응답 예제

{
  "asn": 13335,
  "as_name": "Cloudflare, Inc.",
  "as_domain": "cloudflare.com",
  "organization": "Cloudflare, Inc.",
  "country_code": "US",
  "ip_ranges_count": 1284,
  "total_ips": 2359296
}

GET /v1/validate/{ip}

IP 주소를 검증하고 유형을 결정합니다. 조회 할당량을 소비하지 않습니다.

GET https://api.openipapi.com/v1/validate/{ip}

Example response

{
  "ip": "185.220.101.45",
  "valid": true,
  "type": "IPv4",
  "private": false,
  "bogon": false
}

GET /v1/fraud/{ip}

위험 수준과 실행 가능한 권고사항이 포함된 종합 사기 점수(0–100). VPN, 프록시, Tor, 데이터센터, 과거 남용 신호를 결합합니다. Starter 플랜 이상

GET https://api.openipapi.com/v1/fraud/{ip}

Example response

{
  "ip": "185.220.101.45",
  "fraud_score": 92,
  "risk_level": "critical",
  "signals": {
    "is_vpn": true,
    "is_proxy": false,
    "is_tor": true,
    "is_datacenter": true,
    "is_known_attacker": true,
    "high_risk_country": false
  },
  "recommendation": "block"
}

위험 수준 및 권고사항

점수 위험 수준 권고사항 일반적인 조치
0–30lowallow요청을 허용합니다
31–60mediumreview수동 검토를 위해 기록합니다
61–85highchallengeCAPTCHA / 2FA / 추가 인증 요구
86–100criticalblock거부 및 알림

GET /v1/probe/{ip}

60개 이상의 활성 프로빙 노드에서 얻은 실시간 네트워크 프로브 데이터: 개방된 TCP 포트, 서비스 배너, 역방향 DNS, 전체 TLS 인증서 세부 정보(주체, 발급자, SAN, 유효 기간), 탐지된 서비스 카테고리. Pro 플랜 이상

GET https://api.openipapi.com/v1/probe/{ip}

작동 방식

  • · 최신 데이터(7일 이하): 캐시에서 즉시 반환됩니다.
  • · 오래된 데이터(7일 초과): 즉시 반환되며 백그라운드 재프로브가 대기열에 추가됩니다. 응답에는 "stale": true.
  • · 한 번도 프로빙되지 않음: 즉각적인 스캔을 위해 프로브가 대기열에 추가됩니다. 첫 번째 결과는 일반적으로 1–5분 내에 도착합니다.
  • · 프로브 할당량은 월 조회 할당량의 10%입니다. 사설 / 예약 IP는 프로빙할 수 없습니다.

Example response

{
  "ip": "185.220.101.45",
  "reachable": true,
  "last_probed": "2026-04-18T14:23:11+00:00",
  "age_hours": 2.3,
  "stale": false,
  "refresh_queued": false,
  "probe_count_24h": 14,
  "probed_from_nodes": 8,
  "open_ports": [
    { "port": 22,   "service": "ssh",       "banner": "SSH-2.0-OpenSSH_8.9p1" },
    { "port": 80,   "service": "http",      "banner": "nginx/1.24.0" },
    { "port": 443,  "service": "https",     "banner": null },
    { "port": 9001, "service": "tor-relay", "banner": null }
  ],
  "reverse_dns": "tor-exit.f3netze.de",
  "tls": {
    "subject_cn":  "*.f3netze.de",
    "issuer":      "Let's Encrypt",
    "valid_from":  "2026-02-10T00:00:00Z",
    "valid_to":    "2026-05-10T00:00:00Z",
    "sans":        ["f3netze.de", "*.f3netze.de"],
    "fingerprint": "7e:4f:...:b2:e1"
  },
  "banners": {
    "22": "SSH-2.0-OpenSSH_8.9p1",
    "80": "nginx/1.24.0"
  },
  "detected_services": {
    "is_tor_relay":  true,
    "is_ssh_open":   true,
    "is_web_server": true,
    "is_vpn":        false,
    "is_proxy":      false
  }
}

스캔하는 포트

22 (ssh), 80 / 8080 (http), 443 / 8443 (https), 1080 (socks5), 3128 / 8888 (http-proxy), 9001 / 9030 (tor-relay / tor-dir), 9050 / 9150 (tor-socks), 1194 (openvpn), 4500 (ipsec-nat-t), 51820 (wireguard).

사용 사례

  • · 사기 방지 — 동일한 SSH 버전 / TLS 핑거프린트를 실행하는 봇 팜 탐지
  • · 위협 인텔리전스 — 배너 / 인증서 변경을 위한 C2 서버 모니터링
  • · OSINT / 버그 바운티 — 공개 IP의 서비스 빠르게 열거
  • · 호스팅 / ISP 운영 — 네트워크에서 개방형 프록시 / Tor 출구 찾기

GET /v1/proxy-attribution/{ip}

IP가 알려진 일반 사용자 프록시 풀, 상업용 VPN, 또는 데이터센터 범위에 속하는지 식별합니다. 일반적인 is_proxy 플래그와 달리, 이 엔드포인트는 IP를 특정 제공업체(Bright Data, Oxylabs, NordVPN 등)에 귀속합니다 — 일부 제공업체는 허용하고 다른 제공업체는 차단해야 하는 사기 팀에 매우 중요합니다. Proxy Intel 애드온

GET https://api.openipapi.com/v1/proxy-attribution/{ip}

응답 예제(VPN 범위의 IP)

{
  "ip": "2.56.16.42",
  "detected": true,
  "primary_provider": {
    "provider":     "unknown_vpn",
    "display_name": "Unknown VPN",
    "network_type": "vpn",
    "confidence":   0.75
  },
  "networks": [
    {
      "provider":    "unknown_vpn",
      "network_type": "vpn",
      "confidence":   0.75,
      "source":       "x4bnet-vpn",
      "cidr":         "2.56.16.0/22"
    },
    {
      "provider":    "unknown_datacenter",
      "network_type": "datacenter",
      "confidence":   0.75,
      "source":       "x4bnet-datacenter"
    }
  ],
  "recommendation": "treat_as_vpn"
}

네트워크 유형

  • · residential — 일반 사용자 프록시 풀(Bright Data, Oxylabs, Smartproxy, IPRoyal, Hola, Honeygain, EarnApp, Peer2Profit, SOAX)
  • · vpn — 상업용 VPN 제공업체(NordVPN, ExpressVPN, Surfshark, Mullvad, ProtonVPN, PIA, IPVanish, CyberGhost)
  • · datacenter — 상업용 프록시 출구로 자주 사용되는 호스팅 제공업체(AWS, DigitalOcean, OVH, Hetzner 등)
  • · tor — Tor 출구 / 릴레이 노드
  • · mobile — 모바일 통신사 프록시 풀

권고사항

권고사항 의미
no_proxy_detectedIP가 알려진 풀과 일치하지 않습니다 — 정상 트래픽으로 처리하세요.
treat_as_commercial_proxyIP가 일반 사용자 프록시 풀에 있습니다 — 스크래핑 외 사이트에서는 악성일 가능성이 높습니다.
treat_as_vpnIP가 상업용 VPN 범위에 있습니다 — VPN 정책을 적용하세요.
treat_as_datacenterIP가 데이터센터 범위에서 왔습니다 — 실제 일반 사용자가 아닙니다.
block_or_challengeTor 출구 — 차단하거나 강력한 인증을 요구하세요.

GET /v1/account/usage

계정의 현재 청구 기간 사용 통계를 반환합니다.

GET https://api.openipapi.com/v1/account/usage

Example response

{
  "plan": "Pro",
  "period_start": "2026-03-01",
  "period_end": "2026-03-31",
  "lookups_used": 184320,
  "lookups_limit": 500000,
  "lookups_remaining": 315680,
  "reset_at": "2026-04-01T00:00:00Z"
}

GET /v1/database/list

플랜에서 사용 가능한 MMDB 데이터베이스를 나열합니다. 오프라인 / 엣지 사용을 위한 MaxMind .mmdb 대체품 — 모든 MaxMind DB 리더(PHP, Go, Python, Node.js, Rust, Java)와 호환됩니다.

GET https://api.openipapi.com/v1/database/list

Example response

{
  "plan": "Business",
  "sources": [
    {
      "source": "country",
      "filename": "geo-whois-asn-country.mmdb",
      "size_bytes": 8225621,
      "updated_at": "2026-04-18T02:00:00+00:00",
      "etag": "\"fa2b851f9155838b\"",
      "download_url": "https://api.openipapi.com/v1/database/download/country"
    }
  ]
}

GET /v1/database/download/{source}

원시 MMDB 파일을 스트리밍합니다. ETag + If-None-Match 조건부 GET 지원(파일이 변경되지 않은 경우 304 Not Modified). 속도 제한: 소스당 하루 10회 다운로드.

GET https://api.openipapi.com/v1/database/download/{source}

사용 가능한 출처

출처 내용 라이선스 필요 플랜
country국가 코드 + ASNCC0Pro
asnASN + 조직CC0Business
city-geolite2도시, 지역, 위도/경도, 시간대(GeoLite2)MaxMind GeoLite2 EULABusiness
city-dbip도시(GeoLite2의 대안)DB-IP LiteEnterprise

예제: PHP에서 다운로드 + 사용

# Download latest MMDB
$ curl -H "X-API-Key: YOUR_KEY" \
    -o asn.mmdb \
    https://api.openipapi.com/v1/database/download/asn

# Use with maxmind-db/reader
$ composer require maxmind-db/reader

<?php
use MaxMind\Db\Reader;
$reader = new Reader('asn.mmdb');
$record = $reader->get('8.8.8.8');
// ['autonomous_system_number' => 15169,
//  'autonomous_system_organization' => 'Google LLC']

제재 플래그

모든 /v1/lookup 응답에는 IP의 국가가 국제 제재를 받는지 알려주는 두 필드가 geo 블록에 포함됩니다.

필드 설명
geo.is_sanctioned true 국가가 모니터링된 제재 목록에 있는 경우; false 그렇지 않은 경우.
geo.sanction_lists 적용되는 제재 프로그램 식별자 배열: OFAC, EU, UN, UK. 빈 배열 [] 제재받지 않는 경우.

지원 제재 목록: OFAC(미국), EU, UN 안전보장이사회, 영국 OFSI. 현재 표시된 국가에는 이란, 북한, 러시아, 벨라루스, 시리아, 쿠바, 베네수엘라, 수단 등이 포함됩니다. 목록은 프로그램 변경에 따라 유지 및 업데이트됩니다.

제재 국가 예제

"geo": {
  "country_code": "IR",
  "country": "Iran",
  ...
  "is_sanctioned": true,
  "sanction_lists": ["OFAC", "EU", "UN"]
}

봇 탐지

OpenIPApi는 이중 역방향 DNS 검증 을 수행하여 합법적인 크롤러를 식별합니다. 결과는 모든 조회의 threat.bot_type 에서 확인할 수 있습니다.

필드
threat.bot_type null (검증된 봇이 아님) 또는 다음 중 하나: googlebot, google_special_crawl, bingbot, applebot, yandexbot, duckduckbot, facebookbot, semrushbot, ahrefsbot, mj12bot

검증 방법: (1) IP에 대한 PTR 조회 → 호스트명. (2) 호스트명이 봇의 도메인 패턴과 일치해야 합니다(예: *.googlebot.com). (3) 호스트명에 대한 정방향 DNS가 원래 IP로 다시 확인되어야 합니다. 결과는 24시간 동안 캐시됩니다.

검증된 Googlebot 예제

"threat": {
  "is_vpn": false,
  "is_proxy": false,
  "is_tor": false,
  "threat_score": 0,
  "bot_type": "googlebot"
}

과거 조회

단일 IP 조회에 ?date=YYYY-MM-DD 파라미터를 추가하여 해당 날짜의 스냅샷을 검색합니다.

과거 조회는 Pro 플랜 이상이 필요합니다. 스냅샷은 최대 365일 동안 사용 가능합니다. 일별 스냅샷은 가장 많이 조회된 IP에 대해 자동으로 생성됩니다.
GET https://api.openipapi.com/v1/lookup/{ip}?date=2026-01-15

요청 예제

$ curl "https://api.openipapi.com/v1/lookup/185.220.101.45?date=2026-01-15" \
     -H "X-API-Key: oip_your_api_key_here"

응답 봉투

{
  "ip": "185.220.101.45",
  "snapshot_date": "2026-01-15",
  "is_historical": true,
  "data": {
    /* standard lookup response */
  }
}

오류: 스냅샷 없음

{
  "error": "No historical snapshot available for this IP on 2026-01-15",
  "code": "no_snapshot"
}

오류 코드

코드 HTTP 상태 설명
invalid_api_key 401 API 키가 없거나, 잘못된 형식이거나, 취소되었습니다.
limit_exceeded 429 현재 청구 기간의 모든 조회를 사용했습니다.
plan_required 403 요청한 기능은 현재 플랜에서 사용할 수 없습니다.
invalid_ip 400 제공된 IP 주소가 유효한 IPv4 또는 IPv6 주소가 아닙니다.
not_found 404 요청된 리소스에 대한 데이터를 찾을 수 없습니다(예: 알 수 없는 ASN).
no_snapshot 404 요청된 날짜에 이 IP에 대한 과거 스냅샷이 없습니다.
date_out_of_range 400 과거 조회 날짜가 365일을 초과합니다.
invalid_date 400 날짜 파라미터가 없거나, 잘못된 형식이거나, 미래입니다.
plan_upgrade_required 403 요청한 기능은 더 높은 플랜 티어가 필요합니다.
rate_limited 429 짧은 시간 내에 너무 많은 요청입니다. 잠시 후 재시도하세요.
internal_error 500 예기치 않은 서버 오류가 발생했습니다. 계속 발생하면 지원팀에 문의하세요.

속도 제한

월별 조회 할당량 외에도, 요청은 슬라이딩 윈도우를 사용하여 API 키별로 속도가 제한됩니다. 초과 시 API는 HTTP 429Retry-After 헤더를 반환합니다.

플랜 분당 요청 수 월 조회 수
Free 30 10,000
Starter 120 100,000
Pro 300 500,000
Business 600 2,000,000
Enterprise Custom Unlimited

추가 제한: /v1/validate (미인증)은 호출자 IP당 분당 60개 요청으로 제한됩니다; /v1/me 는 분당 30개. MMDB 다운로드는 계정당 소스당 하루 10회로 제한됩니다. 속도 제한 응답에는 Retry-After.

Webhook

Webhook을 통해 감시 중인 IP의 상태가 변경될 때 실시간 HTTP POST 알림을 받을 수 있습니다. 에서 설정하세요 콘솔 → Webhook, 또는 대시보드 UI를 통해 — API 호출이 필요 없습니다.

이벤트

이벤트 발생 시점
vpn_detected감시 중인 IP가 새로 VPN 엔드포인트로 탐지됩니다.
tor_detected감시 중인 IP가 Tor 출구 노드 목록에 나타나거나 Tor 릴레이로 프로빙됩니다.
proxy_detected감시 중인 IP가 개방형 또는 SOCKS 프록시로 탐지됩니다.
high_threat위협 점수가 설정된 임계값(50–95)을 초과합니다.

요청 헤더

POST https://your-endpoint.example.com/webhook
Content-Type: application/json
User-Agent: OpenIPApi-Webhook/1.0
X-OpenIPApi-Event: high_threat
X-OpenIPApi-Signature: sha256=8c7f1a...b2e

페이로드 예제

{
  "event": "high_threat",
  "delivered_at": "2026-04-18T12:34:56Z",
  "webhook_id": 142,
  "data": {
    "ip": "185.220.101.45",
    "threat_score": 92,
    "previous_score": 45,
    "is_tor": true,
    "is_vpn": true
  }
}

서명 검증

모든 webhook은 webhook 시크릿으로 원시 JSON 본문의 HMAC-SHA256을 사용하여 서명됩니다. 서명은 X-OpenIPApi-Signature 헤더에 sha256=<hex>. 로 전송됩니다. 페이로드에 따른 조치 전에 항상 검증하세요:

PHP

$body = file_get_contents('php://input');
$hdr  = $_SERVER['HTTP_X_OPENIPAPI_SIGNATURE'] ?? '';
$expected = 'sha256=' . hash_hmac(
    'sha256', $body, $webhookSecret
);
if (!hash_equals($expected, $hdr)) {
    http_response_code(401);
    exit;
}
// Safe to process $body now

Node.js (Express)

const crypto = require('crypto');

app.post('/webhook',
  express.raw({ type: 'application/json' }),
  (req, res) => {
    const hdr = req.headers['x-openipapi-signature'];
    const expected = 'sha256=' + crypto
      .createHmac('sha256', process.env.WEBHOOK_SECRET)
      .update(req.body).digest('hex');
    if (expected !== hdr) return res.status(401).end();
    // Process JSON.parse(req.body)
  });

재시도 정책

엔드포인트는 수신을 확인하기 위해 10초 이내에 HTTP 2xx로 응답해야 합니다. 다른 상태(또는 타임아웃)는 지수 백오프 재시도를 트리거합니다: 1분, 5분, 30분, 2시간, 12시간. 최종 시도 후 webhook이 실패로 표시되고 대시보드 알림이 발생합니다.

배달 내역 및 재전송

콘솔 → Webhook 에서 계정당 최근 100개의 배달 시도를 보여주며, 이벤트 유형, HTTP 상태 코드, 엔드포인트가 반환한 응답 본문을 표시합니다. 원본 서명 페이로드를 재전송하려면 재전송 이전 배달을 재전송하고 내장된 서명 디버거 를 사용하여 시크릿을 서버와 공유하지 않고 브라우저에서 HMAC-SHA256 서명을 검증할 수 있습니다.

재전송된 배달에는 추가 X-OpenIPApi-Replay: 1 헤더가 포함되어 엔드포인트가 라이브 이벤트와 구별할 수 있습니다.

코드 예제 — curl

단일 조회

$ curl https://api.openipapi.com/v1/lookup/8.8.8.8 \
     -H "X-API-Key: oip_your_api_key_here"

일괄 조회

$ curl -X POST https://api.openipapi.com/v1/lookup/batch \
     -H "X-API-Key: oip_your_api_key_here" \
     -H "Content-Type: application/json" \
     -d '{"ips": ["8.8.8.8", "1.1.1.1", "185.220.101.45"]}'

내 IP

$ curl https://api.openipapi.com/v1/me \
     -H "X-API-Key: oip_your_api_key_here"

코드 예제 — JavaScript

단일 조회(fetch)

const response = await fetch('https://api.openipapi.com/v1/lookup/8.8.8.8', {
  headers: {
    'X-API-Key': 'oip_your_api_key_here'
  }
});

const data = await response.json();
console.log(data.geo.country);       // "United States"
console.log(data.threat.is_vpn);     // false
console.log(data.threat.threat_score); // 0

일괄 조회

const response = await fetch('https://api.openipapi.com/v1/lookup/batch', {
  method: 'POST',
  headers: {
    'X-API-Key': 'oip_your_api_key_here',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    ips: ['8.8.8.8', '1.1.1.1', '185.220.101.45']
  })
});

const { results } = await response.json();
for (const info of results) {
  console.log(info.ip, info.geo.city, info.threat.threat_score);
}

코드 예제 — Python

단일 조회(requests)

import requests

API_KEY = "oip_your_api_key_here"
headers = {"X-API-Key": API_KEY}

r = requests.get(
    "https://api.openipapi.com/v1/lookup/8.8.8.8",
    headers=headers
)
r.raise_for_status()
data = r.json()

print(data["geo"]["country"])       # United States
print(data["threat"]["is_vpn"])     # False
print(data["threat"]["threat_score"]) # 0

일괄 조회

import requests

API_KEY = "oip_your_api_key_here"
headers = {
    "X-API-Key": API_KEY,
    "Content-Type": "application/json"
}

payload = {
    "ips": ["8.8.8.8", "1.1.1.1", "185.220.101.45"]
}

r = requests.post(
    "https://api.openipapi.com/v1/lookup/batch",
    json=payload,
    headers=headers
)
r.raise_for_status()

for info in r.json()["results"]:
    print(info["ip"], info["geo"]["city"], info["threat"]["threat_score"])

시작할 준비가 되셨나요?

월 10,000회 무료 조회. 신용카드 불필요.

무료 API 키 받기