# Residential 위치

`GET /account/api/v1/residential/locations`

## 권한 인증

`Authorization: Bearer YOUR_ARNPROXY_API_KEY`

`Accept: application/json`

필요한 권한: `read`

## 매개변수

| 이름 | 유형 | 필수 / 조건부 | 기본값 | 설명 |
|---|---|---|---|---|
| `level` (query) | string | 선택 | `"countries"` | countries, regions, cities 또는 isps. 하위 단계에는 상위 선택이 필요합니다. |
| `country` (query) | string | 조건부 | — | countries에는 하위값 없음, regions는 country, cities는 country+region, isps는 country+region+city 필요. region/city 최대 160바이트. |
| `region` (query) | string | 조건부 | — | countries에는 하위값 없음, regions는 country, cities는 country+region, isps는 country+region+city 필요. region/city 최대 160바이트. |
| `city` (query) | string | 조건부 | — | countries에는 하위값 없음, regions는 country, cities는 country+region, isps는 country+region+city 필요. region/city 최대 160바이트. |

## 요청 예제

### curl

```curl
printf 'Authorization: Bearer %s\n' "$ARNPROXY_API_KEY" |
  curl --silent --show-error --header @- \
    --header 'Accept: application/json' \
    --connect-timeout 10 --max-time 30 \
    'https://www.arnproxy.com/account/api/v1/residential/locations?level=countries'
```

### python

```python
import os, requests

headers = {"Authorization": "Bearer " + os.environ["ARNPROXY_API_KEY"]}
response = requests.get(
    "https://www.arnproxy.com/account/api/v1/residential/locations?level=countries",
    headers=headers,
    timeout=(10, 30), allow_redirects=False
)
print(response.status_code, response.text)
# No automatic write retry.
```

### javascript

```javascript
const headers = { Authorization: `Bearer ${process.env.ARNPROXY_API_KEY}` };
const response = await fetch("https://www.arnproxy.com/account/api/v1/residential/locations?level=countries", {
  method: 'GET', headers, redirect: 'error',
  signal: AbortSignal.timeout(30000)
});
console.log(response.status, await response.text());
// A write timeout is ambiguous; query its saved operation.
```

### php

```php
<?php
$headers = ['Accept: application/json',
    'Authorization: Bearer '.getenv('ARNPROXY_API_KEY')];
$ch = curl_init('https://www.arnproxy.com/account/api/v1/residential/locations?level=countries');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_FOLLOWLOCATION => false,
    CURLOPT_SSL_VERIFYPEER => true, CURLOPT_SSL_VERIFYHOST => 2,
    CURLOPT_CONNECTTIMEOUT => 10, CURLOPT_TIMEOUT => 30,
]);
$result = curl_exec($ch);
if ($result === false) {
    // Do not repeat a write; use the original operation key.
    throw new RuntimeException('Transport result unknown');
}
echo curl_getinfo($ch, CURLINFO_HTTP_CODE).PHP_EOL.$result;
curl_close($ch);
```

### go

```go
package main

import (
  "fmt"
  "io"
  "net/http"
  "os"
  "time"
)

func main() {
  client := &http.Client{Timeout: 30*time.Second,
    CheckRedirect: func(req *http.Request, via []*http.Request) error {
      return http.ErrUseLastResponse
    }}
  var body io.Reader
  req, err := http.NewRequest("GET", "https://www.arnproxy.com/account/api/v1/residential/locations?level=countries", body)
  if err != nil { panic(err) }
  req.Header.Set("Authorization", "Bearer "+os.Getenv("ARNPROXY_API_KEY"))
  res, err := client.Do(req); if err != nil { panic(err) }
  defer res.Body.Close()
  data, err := io.ReadAll(res.Body); if err != nil { panic(err) }
  fmt.Println(res.StatusCode, string(data))
}
```

### csharp

```csharp
using System;
using System.IO;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;

using var handler = new HttpClientHandler { AllowAutoRedirect = false };
using var client = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(30) };
using var request = new HttpRequestMessage(HttpMethod.Get,
    "https://www.arnproxy.com/account/api/v1/residential/locations?level=countries");
request.Headers.Authorization = new AuthenticationHeaderValue(
    "Bearer", Environment.GetEnvironmentVariable("ARNPROXY_API_KEY"));
using var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
// Never automatically retry an ambiguous write.
```

### java

```java
import java.net.URI;
import java.net.http.*;
import java.nio.charset.StandardCharsets;
import java.nio.file.*;

// Inside your application method:
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder(URI.create("https://www.arnproxy.com/account/api/v1/residential/locations?level=countries"))
    .header("Authorization", "Bearer " + System.getenv("ARNPROXY_API_KEY"))
    .header("Accept", "application/json")
    .GET()
    .build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
```

## 응답 · HTTP 200

```json
{
  "ok": true,
  "data": {
    "level": "countries",
    "country": null,
    "region": null,
    "city": null,
    "items": [
      {
        "value": "TR",
        "label": "TR",
        "online_nodes": 125
      }
    ],
    "observed_at": "2026-10-24T12:00:00+00:00",
    "source": "private_cache",
    "availability_guaranteed": false,
    "age_seconds": 15,
    "stale": false,
    "refresh_failed": false,
    "count_meaning": "provider_reported_nodes_not_reserved_unique_ips"
  },
  "meta": {
    "request_id": "000000000000000000000001",
    "phase": "public_v1",
    "source": "provider_read"
  }
}
```

| 이름 | 유형 | 조건부 | 설명 |
|---|---|---|---|
| `ok` | boolean | — | 성공 여부. false이면 error.code를 확인하세요. |
| `data` | object | — | 작업별 결과이며 예제는 설명용 합성 데이터입니다. |
| `data.level` | string | — | level의 작업별 값입니다. 반환된 유형을 유지하고 동작 설명을 확인하세요. |
| `data.country` | null | — | country의 작업별 값입니다. 반환된 유형을 유지하고 동작 설명을 확인하세요. |
| `data.region` | null | — | region의 작업별 값입니다. 반환된 유형을 유지하고 동작 설명을 확인하세요. |
| `data.city` | null | — | city의 작업별 값입니다. 반환된 유형을 유지하고 동작 설명을 확인하세요. |
| `data.items` | array | — | 현재 페이지 기록 또는 형식화된 연결 문자열. 빈 목록도 유효할 수 있습니다. |
| `data.items[]` | object | — | 현재 페이지 기록 또는 형식화된 연결 문자열. 빈 목록도 유효할 수 있습니다. |
| `data.items[].value` | string | — | value의 작업별 값입니다. 반환된 유형을 유지하고 동작 설명을 확인하세요. |
| `data.items[].label` | string | — | label의 작업별 값입니다. 반환된 유형을 유지하고 동작 설명을 확인하세요. |
| `data.items[].online_nodes` | integer | — | online nodes의 작업별 값입니다. 반환된 유형을 유지하고 동작 설명을 확인하세요. |
| `data.observed_at` | string | — | API가 반환하는 형식의 타임스탬프. 예제 날짜는 합성값입니다. |
| `data.source` | string | — | 데이터 출처. 로컬 기록과 실시간 공급자 조회는 서로 다른 근거입니다. |
| `data.availability_guaranteed` | boolean | — | availability guaranteed의 작업별 값입니다. 반환된 유형을 유지하고 동작 설명을 확인하세요. |
| `data.age_seconds` | integer | — | age seconds의 작업별 값입니다. 반환된 유형을 유지하고 동작 설명을 확인하세요. |
| `data.stale` | boolean | — | stale의 작업별 값입니다. 반환된 유형을 유지하고 동작 설명을 확인하세요. |
| `data.refresh_failed` | boolean | — | refresh failed의 작업별 값입니다. 반환된 유형을 유지하고 동작 설명을 확인하세요. |
| `data.count_meaning` | string | — | count meaning의 작업별 값입니다. 반환된 유형을 유지하고 동작 설명을 확인하세요. |
| `meta` | object | — | 요청 추적 및 데이터 출처 메타데이터. |
| `meta.request_id` | string | — | 이 HTTP 요청의 추적 ID이며 작업 키나 주문 ID가 아닙니다. |
| `meta.phase` | string | — | phase의 작업별 값입니다. 반환된 유형을 유지하고 동작 설명을 확인하세요. |
| `meta.source` | string | — | 데이터 출처. 로컬 기록과 실시간 공급자 조회는 서로 다른 근거입니다. |

## 동작 및 주요 참고 사항

- 패키지와 목록 ID는 ARNPROXY 기록 ID이며 공급자 키가 아닙니다. 오래된 스냅샷은 접근을 허용하지 않습니다. 필요 시 residential_package_refresh를 사용하세요.

인증 및 검증 단계에서 실행 전에 요청이 거부될 수 있습니다. 오류 문서를 확인하고 지원 문의용 request_id를 보관하세요. 키나 비밀번호를 보내지 마세요.

[오류 및 제한](https://docs.arnproxy.com/ko/api-v1/errors)
