---
title: "geoLocation"
slug: "ai-application-service-geolocation-geolocation"
tags: ["GeoLocation"]
updated: 2026-04-23T08:55:48Z
published: 2026-04-23T09:02:20Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://api.ncloud-docs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# geoLocation

Classic/VPC 환경에서 이용 가능합니다.

IP 주소를 지정하여 지리적 위치 정보를 검색합니다.

## 요청

요청 형식을 설명합니다. 요청 형식은 다음과 같습니다.

| 메서드 | URI |
| --- | --- |
| GET | /geolocation/v2/geoLocation |

### 요청 헤더

GeoLocation API에서 공통으로 사용하는 헤더에 대한 정보는 [GeoLocation 요청 헤더](/docs/ai-application-service-geolocation#%EC%9A%94%EC%B2%AD%ED%97%A4%EB%8D%94)를 참조해 주십시오.

### 요청 쿼리 파라미터

요청 쿼리 파라미터에 대한 설명은 다음과 같습니다.

| 필드 | 타입 | 필수 여부 | 설명 |
| --- | --- | --- | --- |
| `ip` | String | Required | 지역 정보를 알고자 하는 사용자 IP - IP 주소 형식에 대한 자세한 정보는 [IPv4 위키백과](https://ko.wikipedia.org/wiki/IPv4) 참고 |
| `ext` | String | Optional | 추가 정보 포함 여부 - `t` \| `f` (기본값) - `t`: 포함 - `f`: 미포함 |
| `enc` | String | Optional | 응답 결과의 인코딩 방식 - `utf8` (기본값) \| `euckr` |
| `responseFormatType` | String | Optional | 응답 결과의 형식 - `xml` (기본값) \| `json` |

### 요청 예시

요청 예시는 다음과 같습니다.

```
curl --location --request GET 'https://geolocation.apigw.ntruss.com/geolocation/v2/geoLocation?ip=**.**.**.**&ext=t&enc=utf8&responseFormatType=json' \
--header 'x-ncp-apigw-timestamp: {Timestamp}' \
--header 'x-ncp-iam-access-key: {Access Key}' \
--header 'x-ncp-apigw-signature-v2: {API Gateway Signature}'
```

## 응답

응답 형식을 설명합니다.

### 응답 바디

응답 바디에 대한 설명은 다음과 같습니다.

| 필드 | 타입 | 필수 여부 | 설명 |
| --- | --- | --- | --- |
| `returnCode` | String | - | 정상 코드는 0, 이외는 오류 코드 |
| `requestId` | String | - | API 요청 ID |
| `country` | String | - | IP 주소에 해당하는 국가 코드 - [ISO 3166 표준](https://www.iso.org/iso-3166-country-codes.html) 준수 - EU (유럽), AP (아시아, 호주), A1 (Anonymous Proxy), A2 (Satellite Provider), O1 (Other Country) 포함 |
| `code` | String | - | 대한민국 행정안전부에서 정의한 행정 구역 코드 |
| `r1` | String | - | 도, 광역시, 주 |
| `r2` | String | - | 시, 군, 구 |
| `r3` | String | - | 동, 면, 읍 |
| `lat` | Number | - | 위도 |
| `long` | Number | - | 경도 |
| `net` | String | - | 통신사 이름 |

### 응답 상태 코드

GeoLocation API에서 공통으로 사용하는 응답 상태 코드에 대한 정보는 [GeoLocation 응답 상태 코드](/docs/ai-application-service-geolocation#%EC%9D%91%EB%8B%B5%EC%83%81%ED%83%9C%EC%BD%94%EB%93%9C)를 참조해 주십시오.

### 응답 예시

응답 예시는 다음과 같습니다.

- 국내, `ext=f`, `responseFormatType=xml`일 때

```
<?xml version="1.0" encoding="utf-8"?>
<getLocationResponse>
    <returnCode>0</returnCode>
    <requestId>c4e52003-****-****-****-66c93acfd0d2</requestId>
    <geoLocation>
        <country>KR</country>
        <code>41135*****</code>
        <r1>경기도</r1>
        <r2>성남시 분당구</r2>
    </geoLocation>
</getLocationResponse>
```

- 국내, `ext=f`, `responseFormatType=json`일 때

```
{
    "returnCode": 0,
    "requestId": "c4e52003-****-****-****-66c93acfd0d2",
    "geoLocation": {
        "country": "KR",
        "code": "41135*****",
        "r1": "경기도",
        "r2": "성남시 분당구",
    }
}
```

- 해외, `ext=f`, `responseFormatType=xml`일 때

```
<?xml version="1.0" encoding="utf-8"?>
<getLocationResponse>
    <returnCode>0</returnCode>
    <requestId>c4e52003-****-****-****-66c93acfd0d2</requestId>
    <geoLocation>
        <country>US</country>
        <code></code>
        <r1>California</r1>
        <r2>San Francisco</r2>
    </geoLocation>
</getLocationResponse>
```

- 해외, `ext=f`, `responseFormatType=json`일 때

```
{
    "returnCode": 0,
    "requestId": "c4e52003-****-****-****-66c93acfd0d2",
    "geoLocation": {
        "country": "US",
        "code": "",
        "r1": "California",
        "r2": "San Francisco",
    }
}
```

- 국내, `ext=t`, `responseFormatType=xml`일 때

```
<?xml version="1.0" encoding="utf-8"?>
<getLocationResponse>
    <returnCode>0</returnCode>
    <requestId>c4e52003-****-****-****-66c93acfd0d2</requestId>
    <geoLocation>
        <country>KR</country>
        <code>41135*****</code>
        <r1>경기도</r1>
        <r2>성남시 분당구</r2>
        <r3>정자동</r3>
        <lat>**.268***</lat>
        <long>**.030***</long>
        <net>Korea Telecom</net>
    </geoLocation>
</getLocationResponse>
```

- 국내, `ext=t`, `responseFormatType=json`일 때

```
{
    "returnCode": 0,
    "requestId": "c4e52003-****-****-****-66c93acfd0d2",
    "geoLocation": {
        "country": "KR",
        "code": "41135*****",
        "r1": "경기도",
        "r2": "성남시 분당구",
        "r3": "정자동",
        "lat": **.268***,
        "long": **.030***,
        "net": "Korea Telecom"
    }
}
```

- 해외, `ext=t`, `responseFormatType=xml`일 때

```
<?xml version="1.0" encoding="utf-8"?>
<getLocationResponse>
    <returnCode>0</returnCode>
    <requestId>c4e52003-****-****-****-66c93acfd0d2</requestId>    
    <geoLocation>
        <country>US</country>
        <code></code>
        <r1>California</r1>
        <r2>San Francisco</r2>
        <r3></r3>
        <lat>**.769***</lat>
        <long>-***.393***</long>
        <net>Fastly</net>
    </geoLocation>
</getLocationResponse>
```

- 해외, `ext=t`, `responseFormatType=xml`일 때

```
{
    "returnCode": 0,
    "requestId": "c4e52003-****-****-****-66c93acfd0d2",
    "geoLocation": {
        "country": "US",
        "code": "",
        "r1": "California",
        "r2": "San Francisco",
        "r3": "",
        "lat": **.769***,
        "long": -***.393***,
        "net": "Fastly"
    }
}
```

## 예제

[GeoLocation 예제 파일](https://cdn.document360.io/da0368a0-4444-4862-a528-42f78876f9e6/Images/Documentation/geolocation_sample%20%281%29.zip)을 다운로드하여 GeoLocation API를 테스트하거나 예시로 활용할 수 있습니다.
