IP Address API Documentation

Free API Service - Available without authentication.

API Overview

The WhatIP API returns the client IP address and country information in JSON format.

  • Real-time IP address lookup
  • Country code and country names
  • JSON response format
  • CORS enabled
  • Free to use, no API key required

API Endpoint

GET https://ip.officialsite.kr/api

Response Format

The API returns JSON in the following format:

{
  "ip_address": "123.456.789.012",
  "countryCode": "KR",
  "countryNameKr": "대한민국",
  "countryNameEn": "South Korea"
}

Response Fields

Field Type Description
ip_address string Client IP address
countryCode string ISO 3166-1 alpha-2 country code, such as KR, US, JP
countryNameKr string Country name in Korean
countryNameEn string Country name in English

Examples

JavaScript (Fetch API)

fetch('https://ip.officialsite.kr/api')
  .then(response => response.json())
  .then(data => {
    console.log('내 IP:', data.ip_address);
    console.log('국가:', data.countryNameKr);
    console.log('Country:', data.countryNameEn);
  })
  .catch(error => console.error('Error:', error));

jQuery

$.getJSON('https://ip.officialsite.kr/api', function(data) {
  console.log('내 IP:', data.ip_address);
  console.log('국가:', data.countryNameKr);
  console.log('Country:', data.countryNameEn);
});

Python

import requests

response = requests.get('https://ip.officialsite.kr/api')
data = response.json()

print(f"내 IP: {data['ip_address']}")
print(f"국가: {data['countryNameKr']}")
print(f"Country: {data['countryNameEn']}")

cURL

curl https://ip.officialsite.kr/api

CORS Policy

CORS is enabled so the API can be called directly from web browsers on any domain.

Limitations

  • Rate limit: none, but reasonable use is expected
  • HTTPS only
  • IPv4 supported, IPv6 support planned

Error Response

If a server-side error occurs, the API returns an error message with an HTTP status code:

{
  "error": "Internal Server Error",
  "message": "서버 처리 중 오류가 발생했습니다."
}

Contact

For API-related questions or feature requests, please contact us by email.

admin@officialsite.kr

Quick Links
Live Test