# Proxy residensial dan kredensial

> API LocalSERP Proxy: langganan trafik, kredensial proxy, sub-pengguna, penggunaan dan lokasi yang dapat ditargetkan, dengan contoh curl, Python, dan Node.js.

- URL: https://localserpproxy.com/id/docs/api/residential/
- Terakhir diperbarui: 2026-10-15
- Publisher: LocalSERP Proxy (https://localserpproxy.com)

Kelola langganan trafik (proxy residensial dan proxy 4G/5G berotasi per GB): kredensial proxy, subpengguna dengan kredensial dan batas trafik sendiri, penggunaan harian, serta lokasi yang dapat ditargetkan melalui nama pengguna proxy.

**Endpoint di halaman ini**

- `GET /v1/residential/subscriptions`: Daftar langganan trafik (proxy residensial dan proxy seluler berotasi per GB)
- `GET /v1/residential/subscriptions/{subscriptionId}`: Dapatkan langganan proxy residensial
- `PATCH /v1/residential/subscriptions/{subscriptionId}`: Ganti nama atau aktifkan/nonaktifkan perpanjangan otomatis
- `POST /v1/residential/subscriptions/{subscriptionId}/reset-password`: Buat kata sandi proxy baru untuk pengguna utama
- `GET /v1/residential/subscriptions/{subscriptionId}/usage`: Penggunaan trafik harian
- `GET /v1/residential/subscriptions/{subscriptionId}/sub-users`: Daftar sub-pengguna (kredensial proxy terpisah dengan batas trafik masing-masing)
- `POST /v1/residential/subscriptions/{subscriptionId}/sub-users`: Buat sub-pengguna
- `PATCH /v1/residential/subscriptions/{subscriptionId}/sub-users/{subUserId}`: Perbarui sub-pengguna (label, batas, aktifkan/nonaktifkan, kata sandi baru)
- `DELETE /v1/residential/subscriptions/{subscriptionId}/sub-users/{subUserId}`: Hapus sub-pengguna
- `GET /v1/catalog/countries`: Negara tempat produk tersedia
- `GET /v1/catalog/countries/{countryCode}/states`: Negara bagian/provinsi yang dapat ditargetkan di suatu negara (US, CA, AU…)
- `GET /v1/catalog/countries/{countryCode}/cities`: Kota yang dapat ditargetkan di suatu negara
- `GET /v1/catalog/countries/{countryCode}/asns`: ISP (ASN) yang dapat ditargetkan di suatu negara — hanya proxy residensial

URL dasar `https://localserpproxy.com/api/v1`. Autentikasi, error, dan batas: lihat [ringkasan API](https://localserpproxy.com/id/docs/api/).

## Sesi lengket

Tambahkan `-session-{id}-ttl-{minutes}` ke nama pengguna proxy untuk mempertahankan IP yang sama: `{id}` adalah 1–32 huruf atau angka pilihan Anda, `ttl` adalah 1–30 menit. IP dapat berubah lebih awal, misalnya saat perangkat di baliknya offline.

## Daftar langganan trafik (proxy residensial dan proxy seluler berotasi per GB)

`GET /v1/residential/subscriptions`

Autentikasi: kunci API di header `Authorization: Bearer API_KEY`.

**Parameter**

| Nama | Di | Tipe | Wajib | Deskripsi |
| --- | --- | --- | --- | --- |
| `productId` | query | `residential` · `mobile-gb` | Tidak | Hanya produk ini (jika tidak dicantumkan: keduanya). |

**Respons** `200 OK`

```json
{
  "data": [
    {
      "id": "res_9x2m4k",
      "productId": "residential",
      "label": "Residential #1",
      "planId": "res-10",
      "status": "active",
      "trafficTotalBytes": 10000000000,
      "trafficUsedBytes": 2350000000,
      "trafficRemainingBytes": 7650000000,
      "expiresAt": null,
      "autoRenew": false,
      "username": "u7k2m9",
      "password": "PASSWORD",
      "endpoint": {
        "host": "gw.localserpproxy.com",
        "httpPort": 7777,
        "socksPort": 7778
      },
      "subUserCount": 1,
      "createdAt": "2026-10-05T14:03:11Z"
    }
  ]
}
```

*curl*

```bash
curl -s "https://localserpproxy.com/api/v1/residential/subscriptions" \
  -H "Authorization: Bearer $API_KEY"
```

*Python*

```python
import os
import requests

API = "https://localserpproxy.com/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['API_KEY']}"}

r = requests.get(f"{API}/residential/subscriptions", headers=HEADERS, timeout=30)
r.raise_for_status()
print(r.json())
```

*Node.js*

```javascript
// Node.js 18+ (built-in fetch), ES module
const API = 'https://localserpproxy.com/api/v1';

const res = await fetch(`${API}/residential/subscriptions`, {
  headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());
```

## Dapatkan langganan proxy residensial

`GET /v1/residential/subscriptions/{subscriptionId}`

Autentikasi: kunci API di header `Authorization: Bearer API_KEY`.

**Parameter**

| Nama | Di | Tipe | Wajib | Deskripsi |
| --- | --- | --- | --- | --- |
| `subscriptionId` | path | string | Ya | — |

**Respons** `200 OK`

```json
{
  "id": "res_9x2m4k",
  "productId": "residential",
  "label": "Residential #1",
  "planId": "res-10",
  "status": "active",
  "trafficTotalBytes": 10000000000,
  "trafficUsedBytes": 2350000000,
  "trafficRemainingBytes": 7650000000,
  "expiresAt": null,
  "autoRenew": false,
  "username": "u7k2m9",
  "password": "PASSWORD",
  "endpoint": {
    "host": "gw.localserpproxy.com",
    "httpPort": 7777,
    "socksPort": 7778
  },
  "subUserCount": 1,
  "createdAt": "2026-10-05T14:03:11Z"
}
```

*curl*

```bash
curl -s "https://localserpproxy.com/api/v1/residential/subscriptions/res_9x2m4k" \
  -H "Authorization: Bearer $API_KEY"
```

*Python*

```python
import os
import requests

API = "https://localserpproxy.com/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['API_KEY']}"}

r = requests.get(f"{API}/residential/subscriptions/res_9x2m4k", headers=HEADERS, timeout=30)
r.raise_for_status()
print(r.json())
```

*Node.js*

```javascript
// Node.js 18+ (built-in fetch), ES module
const API = 'https://localserpproxy.com/api/v1';

const res = await fetch(`${API}/residential/subscriptions/res_9x2m4k`, {
  headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());
```

## Ganti nama atau aktifkan/nonaktifkan perpanjangan otomatis

`PATCH /v1/residential/subscriptions/{subscriptionId}`

Autentikasi: kunci API di header `Authorization: Bearer API_KEY`.

**Parameter**

| Nama | Di | Tipe | Wajib | Deskripsi |
| --- | --- | --- | --- | --- |
| `subscriptionId` | path | string | Ya | — |

**Isi permintaan**

| Kolom | Tipe | Wajib | Deskripsi |
| --- | --- | --- | --- |
| `label` | string | Tidak | maks. 60 karakter |
| `autoRenew` | boolean | Tidak | — |

*Contoh*

```json
{
  "label": "Price monitoring",
  "autoRenew": true
}
```

**Respons** `200 OK`

```json
{
  "id": "res_9x2m4k",
  "productId": "residential",
  "label": "Residential #1",
  "planId": "res-10",
  "status": "active",
  "trafficTotalBytes": 10000000000,
  "trafficUsedBytes": 2350000000,
  "trafficRemainingBytes": 7650000000,
  "expiresAt": null,
  "autoRenew": false,
  "username": "u7k2m9",
  "password": "PASSWORD",
  "endpoint": {
    "host": "gw.localserpproxy.com",
    "httpPort": 7777,
    "socksPort": 7778
  },
  "subUserCount": 1,
  "createdAt": "2026-10-05T14:03:11Z"
}
```

*curl*

```bash
curl -s -X PATCH "https://localserpproxy.com/api/v1/residential/subscriptions/res_9x2m4k" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"label":"Price monitoring","autoRenew":true}'
```

*Python*

```python
import os
import requests

API = "https://localserpproxy.com/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['API_KEY']}"}

r = requests.patch(f"{API}/residential/subscriptions/res_9x2m4k", headers=HEADERS, json={"label": "Price monitoring", "autoRenew": True}, timeout=30)
r.raise_for_status()
print(r.json())
```

*Node.js*

```javascript
// Node.js 18+ (built-in fetch), ES module
const API = 'https://localserpproxy.com/api/v1';

const res = await fetch(`${API}/residential/subscriptions/res_9x2m4k`, {
  method: 'PATCH',
  headers: { Authorization: `Bearer ${process.env.API_KEY}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({ label: 'Price monitoring', autoRenew: true }),
});
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());
```

## Buat kata sandi proxy baru untuk pengguna utama

`POST /v1/residential/subscriptions/{subscriptionId}/reset-password`

Kata sandi lama berhenti berfungsi di gateway dalam 60 detik.

Autentikasi: kunci API di header `Authorization: Bearer API_KEY`.

**Parameter**

| Nama | Di | Tipe | Wajib | Deskripsi |
| --- | --- | --- | --- | --- |
| `subscriptionId` | path | string | Ya | — |

**Respons** `200 OK`

```json
{
  "id": "res_9x2m4k",
  "productId": "residential",
  "label": "Residential #1",
  "planId": "res-10",
  "status": "active",
  "trafficTotalBytes": 10000000000,
  "trafficUsedBytes": 2350000000,
  "trafficRemainingBytes": 7650000000,
  "expiresAt": null,
  "autoRenew": false,
  "username": "u7k2m9",
  "password": "PASSWORD",
  "endpoint": {
    "host": "gw.localserpproxy.com",
    "httpPort": 7777,
    "socksPort": 7778
  },
  "subUserCount": 1,
  "createdAt": "2026-10-05T14:03:11Z"
}
```

*curl*

```bash
curl -s -X POST "https://localserpproxy.com/api/v1/residential/subscriptions/res_9x2m4k/reset-password" \
  -H "Authorization: Bearer $API_KEY"
```

*Python*

```python
import os
import requests

API = "https://localserpproxy.com/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['API_KEY']}"}

r = requests.post(f"{API}/residential/subscriptions/res_9x2m4k/reset-password", headers=HEADERS, timeout=30)
r.raise_for_status()
print(r.json())
```

*Node.js*

```javascript
// Node.js 18+ (built-in fetch), ES module
const API = 'https://localserpproxy.com/api/v1';

const res = await fetch(`${API}/residential/subscriptions/res_9x2m4k/reset-password`, {
  method: 'POST',
  headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());
```

## Penggunaan trafik harian

`GET /v1/residential/subscriptions/{subscriptionId}/usage`

Autentikasi: kunci API di header `Authorization: Bearer API_KEY`.

**Parameter**

| Nama | Di | Tipe | Wajib | Deskripsi |
| --- | --- | --- | --- | --- |
| `subscriptionId` | path | string | Ya | — |
| `from` | query | string (date) | Tidak | Hari pertama (UTC), termasuk. Default = 29 hari sebelum `to`. |
| `to` | query | string (date) | Tidak | Hari terakhir (UTC), termasuk. Default = hari ini. Rentang maksimum 366 hari. |
| `subUserId` | query | string | Tidak | Batasi ke satu subpengguna. |

**Respons** `200 OK`

```json
{
  "from": "2026-10-04",
  "to": "2026-10-05",
  "totalBytes": 2350000000,
  "totalRequests": 48210,
  "points": [
    {
      "date": "2026-10-04",
      "bytes": 1200000000,
      "requests": 24800
    },
    {
      "date": "2026-10-05",
      "bytes": 1150000000,
      "requests": 23410
    }
  ],
  "byCountry": [
    {
      "country": "US",
      "bytes": 2350000000
    }
  ]
}
```

*curl*

```bash
curl -s "https://localserpproxy.com/api/v1/residential/subscriptions/res_9x2m4k/usage" \
  -H "Authorization: Bearer $API_KEY"
```

*Python*

```python
import os
import requests

API = "https://localserpproxy.com/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['API_KEY']}"}

r = requests.get(f"{API}/residential/subscriptions/res_9x2m4k/usage", headers=HEADERS, timeout=30)
r.raise_for_status()
print(r.json())
```

*Node.js*

```javascript
// Node.js 18+ (built-in fetch), ES module
const API = 'https://localserpproxy.com/api/v1';

const res = await fetch(`${API}/residential/subscriptions/res_9x2m4k/usage`, {
  headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());
```

## Daftar subpengguna (kredensial proxy terpisah dengan batas trafik masing-masing)

`GET /v1/residential/subscriptions/{subscriptionId}/sub-users`

Autentikasi: kunci API di header `Authorization: Bearer API_KEY`.

**Parameter**

| Nama | Di | Tipe | Wajib | Deskripsi |
| --- | --- | --- | --- | --- |
| `subscriptionId` | path | string | Ya | — |

**Respons** `200 OK`

```json
{
  "data": [
    {
      "id": "sub_3m9qk2",
      "label": "Client A",
      "username": "u7k2m9_scraper",
      "password": "PASSWORD",
      "trafficLimitBytes": 5000000000,
      "trafficUsedBytes": 1200000000,
      "enabled": true,
      "createdAt": "2026-10-05T14:03:11Z"
    }
  ],
  "limit": 50
}
```

*curl*

```bash
curl -s "https://localserpproxy.com/api/v1/residential/subscriptions/res_9x2m4k/sub-users" \
  -H "Authorization: Bearer $API_KEY"
```

*Python*

```python
import os
import requests

API = "https://localserpproxy.com/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['API_KEY']}"}

r = requests.get(f"{API}/residential/subscriptions/res_9x2m4k/sub-users", headers=HEADERS, timeout=30)
r.raise_for_status()
print(r.json())
```

*Node.js*

```javascript
// Node.js 18+ (built-in fetch), ES module
const API = 'https://localserpproxy.com/api/v1';

const res = await fetch(`${API}/residential/subscriptions/res_9x2m4k/sub-users`, {
  headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());
```

## Buat subpengguna

`POST /v1/residential/subscriptions/{subscriptionId}/sub-users`

Autentikasi: kunci API di header `Authorization: Bearer API_KEY`.

**Parameter**

| Nama | Di | Tipe | Wajib | Deskripsi |
| --- | --- | --- | --- | --- |
| `subscriptionId` | path | string | Ya | — |

**Isi permintaan**

| Kolom | Tipe | Wajib | Deskripsi |
| --- | --- | --- | --- |
| `label` | string | Ya | maks. 60 karakter |
| `password` | string | Tidak | Dibuat otomatis jika dikosongkan. — maks. 64 karakter |
| `trafficLimitBytes` | integer (int64), nullable | Tidak | ≥ 0 |

*Contoh*

```json
{
  "label": "Scraper EU",
  "trafficLimitBytes": 5000000000
}
```

**Respons** `201 Created`

```json
{
  "id": "sub_3m9qk2",
  "label": "Client A",
  "username": "u7k2m9_scraper",
  "password": "PASSWORD",
  "trafficLimitBytes": 5000000000,
  "trafficUsedBytes": 1200000000,
  "enabled": true,
  "createdAt": "2026-10-05T14:03:11Z"
}
```

*curl*

```bash
curl -s -X POST "https://localserpproxy.com/api/v1/residential/subscriptions/res_9x2m4k/sub-users" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"label":"Scraper EU","trafficLimitBytes":5000000000}'
```

*Python*

```python
import os
import requests

API = "https://localserpproxy.com/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['API_KEY']}"}

r = requests.post(f"{API}/residential/subscriptions/res_9x2m4k/sub-users", headers=HEADERS, json={"label": "Scraper EU", "trafficLimitBytes": 5000000000}, timeout=30)
r.raise_for_status()
print(r.json())
```

*Node.js*

```javascript
// Node.js 18+ (built-in fetch), ES module
const API = 'https://localserpproxy.com/api/v1';

const res = await fetch(`${API}/residential/subscriptions/res_9x2m4k/sub-users`, {
  method: 'POST',
  headers: { Authorization: `Bearer ${process.env.API_KEY}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({ label: 'Scraper EU', trafficLimitBytes: 5000000000 }),
});
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());
```

## Perbarui subpengguna (label, batas, aktifkan/nonaktifkan, kata sandi baru)

`PATCH /v1/residential/subscriptions/{subscriptionId}/sub-users/{subUserId}`

Autentikasi: kunci API di header `Authorization: Bearer API_KEY`.

**Parameter**

| Nama | Di | Tipe | Wajib | Deskripsi |
| --- | --- | --- | --- | --- |
| `subscriptionId` | path | string | Ya | — |
| `subUserId` | path | string | Ya | — |

**Isi permintaan**

| Kolom | Tipe | Wajib | Deskripsi |
| --- | --- | --- | --- |
| `label` | string | Tidak | maks. 60 karakter |
| `trafficLimitBytes` | integer (int64), nullable | Tidak | ≥ 0 |
| `enabled` | boolean | Tidak | — |
| `regeneratePassword` | boolean | Tidak | — |

*Contoh*

```json
{
  "enabled": false
}
```

**Respons** `200 OK`

```json
{
  "id": "sub_3m9qk2",
  "label": "Client A",
  "username": "u7k2m9_scraper",
  "password": "PASSWORD",
  "trafficLimitBytes": 5000000000,
  "trafficUsedBytes": 1200000000,
  "enabled": true,
  "createdAt": "2026-10-05T14:03:11Z"
}
```

*curl*

```bash
curl -s -X PATCH "https://localserpproxy.com/api/v1/residential/subscriptions/res_9x2m4k/sub-users/sub_3m9qk2" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"enabled":false}'
```

*Python*

```python
import os
import requests

API = "https://localserpproxy.com/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['API_KEY']}"}

r = requests.patch(f"{API}/residential/subscriptions/res_9x2m4k/sub-users/sub_3m9qk2", headers=HEADERS, json={"enabled": False}, timeout=30)
r.raise_for_status()
print(r.json())
```

*Node.js*

```javascript
// Node.js 18+ (built-in fetch), ES module
const API = 'https://localserpproxy.com/api/v1';

const res = await fetch(`${API}/residential/subscriptions/res_9x2m4k/sub-users/sub_3m9qk2`, {
  method: 'PATCH',
  headers: { Authorization: `Bearer ${process.env.API_KEY}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({ enabled: false }),
});
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());
```

## Hapus subpengguna

`DELETE /v1/residential/subscriptions/{subscriptionId}/sub-users/{subUserId}`

Autentikasi: kunci API di header `Authorization: Bearer API_KEY`.

**Parameter**

| Nama | Di | Tipe | Wajib | Deskripsi |
| --- | --- | --- | --- | --- |
| `subscriptionId` | path | string | Ya | — |
| `subUserId` | path | string | Ya | — |

**Respons** `204 No Content`

Tanpa isi: kode status adalah jawabannya.

*curl*

```bash
curl -s -X DELETE "https://localserpproxy.com/api/v1/residential/subscriptions/res_9x2m4k/sub-users/sub_3m9qk2" \
  -H "Authorization: Bearer $API_KEY"
```

*Python*

```python
import os
import requests

API = "https://localserpproxy.com/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['API_KEY']}"}

r = requests.delete(f"{API}/residential/subscriptions/res_9x2m4k/sub-users/sub_3m9qk2", headers=HEADERS, timeout=30)
r.raise_for_status()
print(r.status_code)  # 204: done
```

*Node.js*

```javascript
// Node.js 18+ (built-in fetch), ES module
const API = 'https://localserpproxy.com/api/v1';

const res = await fetch(`${API}/residential/subscriptions/res_9x2m4k/sub-users/sub_3m9qk2`, {
  method: 'DELETE',
  headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(res.status); // 204: done
```

## Negara tempat produk tersedia

`GET /v1/catalog/countries`

Publik: tidak perlu kunci API.

**Parameter**

| Nama | Di | Tipe | Wajib | Deskripsi |
| --- | --- | --- | --- | --- |
| `product` | query | string | Tidak | Batasi ke lokasi tempat produk ini tersedia (`residential`, `mobile`, `mobile-gb`). |

**Respons** `200 OK`

```json
{
  "data": [
    {
      "code": "US",
      "name": "United States",
      "region": "Americas",
      "products": [
        "residential",
        "mobile",
        "mobile-gb"
      ],
      "cities": 6,
      "asns": 4,
      "carriers": 3
    }
  ]
}
```

*curl*

```bash
curl -s "https://localserpproxy.com/api/v1/catalog/countries"
```

*Python*

```python
import os
import requests

API = "https://localserpproxy.com/api/v1"

r = requests.get(f"{API}/catalog/countries", timeout=30)
r.raise_for_status()
print(r.json())
```

*Node.js*

```javascript
// Node.js 18+ (built-in fetch), ES module
const API = 'https://localserpproxy.com/api/v1';

const res = await fetch(`${API}/catalog/countries`);
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());
```

## Negara bagian/provinsi yang dapat ditargetkan di suatu negara (US, CA, AU…)

`GET /v1/catalog/countries/{countryCode}/states`

Nilai segmen nama pengguna `-state-{state}`. Daftar kosong untuk negara tanpa penargetan negara bagian. Kode ZIP tidak dicantumkan: segmen `-zip-{zip}` menerima kode ZIP US 5 digit apa pun, dan gateway menampilkan halaman error jika tidak ada IP keluar yang cocok.

Publik: tidak perlu kunci API.

**Parameter**

| Nama | Di | Tipe | Wajib | Deskripsi |
| --- | --- | --- | --- | --- |
| `countryCode` | path | string | Ya | ISO 3166-1 alpha-2, huruf kapital. |

**Respons** `200 OK`

```json
{
  "data": [
    {
      "id": "ny",
      "code": "NY",
      "name": "New York",
      "cities": 0
    }
  ]
}
```

*curl*

```bash
curl -s "https://localserpproxy.com/api/v1/catalog/countries/US/states"
```

*Python*

```python
import os
import requests

API = "https://localserpproxy.com/api/v1"

r = requests.get(f"{API}/catalog/countries/US/states", timeout=30)
r.raise_for_status()
print(r.json())
```

*Node.js*

```javascript
// Node.js 18+ (built-in fetch), ES module
const API = 'https://localserpproxy.com/api/v1';

const res = await fetch(`${API}/catalog/countries/US/states`);
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());
```

## Kota yang dapat ditargetkan di suatu negara

`GET /v1/catalog/countries/{countryCode}/cities`

Dengan `product=mobile` atau `product=mobile-gb`, hanya kota yang memiliki modem 4G/5G.

Publik: tidak perlu kunci API.

**Parameter**

| Nama | Di | Tipe | Wajib | Deskripsi |
| --- | --- | --- | --- | --- |
| `countryCode` | path | string | Ya | ISO 3166-1 alpha-2, huruf kapital. |
| `product` | query | string | Tidak | Batasi ke lokasi tempat produk ini tersedia (`residential`, `mobile`, `mobile-gb`). |

**Respons** `200 OK`

```json
{
  "data": [
    {
      "id": "new_york",
      "name": "New York",
      "state": "ny"
    }
  ]
}
```

*curl*

```bash
curl -s "https://localserpproxy.com/api/v1/catalog/countries/US/cities"
```

*Python*

```python
import os
import requests

API = "https://localserpproxy.com/api/v1"

r = requests.get(f"{API}/catalog/countries/US/cities", timeout=30)
r.raise_for_status()
print(r.json())
```

*Node.js*

```javascript
// Node.js 18+ (built-in fetch), ES module
const API = 'https://localserpproxy.com/api/v1';

const res = await fetch(`${API}/catalog/countries/US/cities`);
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());
```

## ISP (ASN) yang dapat ditargetkan di suatu negara — hanya proxy residensial

`GET /v1/catalog/countries/{countryCode}/asns`

Publik: tidak perlu kunci API.

**Parameter**

| Nama | Di | Tipe | Wajib | Deskripsi |
| --- | --- | --- | --- | --- |
| `countryCode` | path | string | Ya | ISO 3166-1 alpha-2, huruf kapital. |

**Respons** `200 OK`

```json
{
  "data": [
    {
      "asn": 7922,
      "name": "Comcast Cable"
    }
  ]
}
```

*curl*

```bash
curl -s "https://localserpproxy.com/api/v1/catalog/countries/US/asns"
```

*Python*

```python
import os
import requests

API = "https://localserpproxy.com/api/v1"

r = requests.get(f"{API}/catalog/countries/US/asns", timeout=30)
r.raise_for_status()
print(r.json())
```

*Node.js*

```javascript
// Node.js 18+ (built-in fetch), ES module
const API = 'https://localserpproxy.com/api/v1';

const res = await fetch(`${API}/catalog/countries/US/asns`);
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());
```

---

LocalSERP Proxy: LocalSERP Proxy adalah layanan proxy residensial AS untuk memeriksa hasil pencarian lokal, iklan, dan harga kota demi kota, dengan pembayaran kripto tanpa mengunggah dokumen identitas.
