GET STARTED
기본 엔드포인트
별도의 인증 없이 GET 요청으로 사용할 수 있습니다. JSON과 XML 응답은 CORS를 허용하므로 클라이언트에서 직접 호출할 수 있습니다.
JSON 응답 예시
{
"result": true,
"ip": "203.0.113.10",
"version": "IPv4",
"country_code": null,
"country_name": {}
}
서버에 Cloudflare 국가 헤더나 GeoIP 모듈이 설정되어 있다면 country_code와 country_name이 함께 채워질 수 있습니다.
브라우저에서 호출하기
fetch('https://myip.aicodelab.co.kr/api/json/')
.then(response => response.json())
.then(data => console.log(data.ip));