# Ülke, bölge, şehir ve ISP seçenekleri

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

## Yetkilendirme

`Authorization: Bearer YOUR_ARNPROXY_API_KEY`

`Accept: application/json`

Gerekli izin: `read`

## Parametreler

| Ad | Tür | Zorunlu / Koşula bağlı | Varsayılan | Açıklama |
|---|---|---|---|---|
| `level` (query) | string | İsteğe bağlı | `"countries"` | countries, regions, cities veya isps. Seviye ilerledikçe üst seçimler zorunludur. |
| `country` (query) | string | Koşula bağlı | — | countries: alt alan göndermeyin; regions: country; cities: country+region; isps: country+region+city. Bölge/şehir en fazla 160 bayt. |
| `region` (query) | string | Koşula bağlı | — | countries: alt alan göndermeyin; regions: country; cities: country+region; isps: country+region+city. Bölge/şehir en fazla 160 bayt. |
| `city` (query) | string | Koşula bağlı | — | countries: alt alan göndermeyin; regions: country; cities: country+region; isps: country+region+city. Bölge/şehir en fazla 160 bayt. |

## İstek örneği

### 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());
```

## Yanıtlar · 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"
  }
}
```

| Ad | Tür | Koşula bağlı | Açıklama |
|---|---|---|---|
| `ok` | boolean | — | Başarılı istek zarfı; false ise error.code alanını okuyun. |
| `data` | object | — | İşleme özel sonuç. Örnekler temsili ve sentetiktir. |
| `data.level` | string | — | level alanının işleme özel değeri; örnekteki türü ve ilgili davranış notlarını esas alın. |
| `data.country` | null | — | country alanının işleme özel değeri; örnekteki türü ve ilgili davranış notlarını esas alın. |
| `data.region` | null | — | region alanının işleme özel değeri; örnekteki türü ve ilgili davranış notlarını esas alın. |
| `data.city` | null | — | city alanının işleme özel değeri; örnekteki türü ve ilgili davranış notlarını esas alın. |
| `data.items` | array | — | Bu sayfanın kayıtları veya üretilen bağlantı metinleri; boş dizi de geçerli bir sonuçtur. |
| `data.items[]` | object | — | Bu sayfanın kayıtları veya üretilen bağlantı metinleri; boş dizi de geçerli bir sonuçtur. |
| `data.items[].value` | string | — | value alanının işleme özel değeri; örnekteki türü ve ilgili davranış notlarını esas alın. |
| `data.items[].label` | string | — | label alanının işleme özel değeri; örnekteki türü ve ilgili davranış notlarını esas alın. |
| `data.items[].online_nodes` | integer | — | online nodes alanının işleme özel değeri; örnekteki türü ve ilgili davranış notlarını esas alın. |
| `data.observed_at` | string | — | Kodun döndürdüğü zaman değeri; örnekte sentetik tarih kullanılır. |
| `data.source` | string | — | Bu alanın veri kaynağı; yerel kayıt ile canlı sağlayıcı okuması aynı şey değildir. |
| `data.availability_guaranteed` | boolean | — | availability guaranteed alanının işleme özel değeri; örnekteki türü ve ilgili davranış notlarını esas alın. |
| `data.age_seconds` | integer | — | age seconds alanının işleme özel değeri; örnekteki türü ve ilgili davranış notlarını esas alın. |
| `data.stale` | boolean | — | stale alanının işleme özel değeri; örnekteki türü ve ilgili davranış notlarını esas alın. |
| `data.refresh_failed` | boolean | — | refresh failed alanının işleme özel değeri; örnekteki türü ve ilgili davranış notlarını esas alın. |
| `data.count_meaning` | string | — | count meaning alanının işleme özel değeri; örnekteki türü ve ilgili davranış notlarını esas alın. |
| `meta` | object | — | İstek izleme ve veri kaynağı bilgileri. |
| `meta.request_id` | string | — | Bu HTTP isteğinin kimliği; işlem anahtarı veya sipariş ID’si değildir. |
| `meta.phase` | string | — | phase alanının işleme özel değeri; örnekteki türü ve ilgili davranış notlarını esas alın. |
| `meta.source` | string | — | Bu alanın veri kaynağı; yerel kayıt ile canlı sağlayıcı okuması aynı şey değildir. |

## Davranış ve önemli notlar

- Paket ve liste kimlikleri ARNPROXY kayıt ID’leridir; sağlayıcının paket anahtarını veya liste ID’sini göndermeyin. Eski paket gözlemi erişim için yeterli değildir; gerekirse residential_package_refresh kullanın.

Kimlik doğrulama ve alan denetimleri işlemi başlamadan reddedebilir. Hata rehberini inceleyin; destek için request_id saklayın. Anahtar veya şifre göndermeyin.

[Hatalar ve limitler](https://docs.arnproxy.com/tr/api-v1/errors)
