# Proxies residenciales y credenciales

> API de LocalSERP Proxy: suscripciones de tráfico, credenciales de proxy, subusuarios, uso y ubicaciones disponibles para segmentar, con ejemplos para curl, Python y Node.js.

- URL: https://localserpproxy.com/es/docs/api/residential/
- Última actualización: 2026-10-15
- Publisher: LocalSERP Proxy (https://localserpproxy.com)

Gestiona suscripciones de tráfico (residencial y 4G/5G rotativo por GB): credenciales de proxy, subusuarios con credenciales propias y límite de tráfico, uso diario y las ubicaciones a las que puedes dirigirte desde el nombre de usuario del proxy.

**Endpoints de esta página**

- `GET /v1/residential/subscriptions`: Consultar suscripciones de tráfico (proxy residencial y proxies móviles rotativos por GB)
- `GET /v1/residential/subscriptions/{subscriptionId}`: Obtener una suscripción de proxy residencial
- `PATCH /v1/residential/subscriptions/{subscriptionId}`: Cambiar el nombre o activar/desactivar la renovación automática
- `POST /v1/residential/subscriptions/{subscriptionId}/reset-password`: Generar una nueva contraseña de proxy para el usuario principal
- `GET /v1/residential/subscriptions/{subscriptionId}/usage`: Consultar el uso diario de tráfico
- `GET /v1/residential/subscriptions/{subscriptionId}/sub-users`: Consultar subusuarios (credenciales de proxy independientes con su propio límite de tráfico)
- `POST /v1/residential/subscriptions/{subscriptionId}/sub-users`: Crear un subusuario
- `PATCH /v1/residential/subscriptions/{subscriptionId}/sub-users/{subUserId}`: Actualizar un subusuario (etiqueta, límite, activar/desactivar, nueva contraseña)
- `DELETE /v1/residential/subscriptions/{subscriptionId}/sub-users/{subUserId}`: Eliminar un subusuario
- `GET /v1/catalog/countries`: Países donde está disponible un producto
- `GET /v1/catalog/countries/{countryCode}/states`: Estados/provincias disponibles para segmentar en un país (US, CA, AU…)
- `GET /v1/catalog/countries/{countryCode}/cities`: Ciudades disponibles para segmentar en un país
- `GET /v1/catalog/countries/{countryCode}/asns`: ISP disponibles para segmentar (ASN) en un país: solo proxy residencial

URL base `https://localserpproxy.com/api/v1`. Autenticación, errores y límites: consulta la [descripción general de la API](https://localserpproxy.com/es/docs/api/).

## Sesiones persistentes

Añade `-session-{id}-ttl-{minutes}` al nombre de usuario del proxy para mantener la misma IP: `{id}` puede tener entre 1 y 32 letras o números a tu elección; `ttl` puede ser de 1 a 30 minutos. La IP puede cambiar antes, por ejemplo, si el dispositivo que la utiliza se desconecta.

## Consultar suscripciones de tráfico (proxy residencial y proxies móviles rotativos por GB)

`GET /v1/residential/subscriptions`

Autenticación: clave de API en el encabezado `Authorization: Bearer API_KEY`.

**Parámetros**

| Nombre | En | Tipo | Obligatorio | Descripción |
| --- | --- | --- | --- | --- |
| `productId` | query | `residential` · `mobile-gb` | No | Solo este producto (si se omite: ambos). |

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

## Obtener una suscripción de proxy residencial

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

Autenticación: clave de API en el encabezado `Authorization: Bearer API_KEY`.

**Parámetros**

| Nombre | En | Tipo | Obligatorio | Descripción |
| --- | --- | --- | --- | --- |
| `subscriptionId` | path | string | Sí | — |

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

## Cambiar el nombre o activar/desactivar la renovación automática

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

Autenticación: clave de API en el encabezado `Authorization: Bearer API_KEY`.

**Parámetros**

| Nombre | En | Tipo | Obligatorio | Descripción |
| --- | --- | --- | --- | --- |
| `subscriptionId` | path | string | Sí | — |

**Cuerpo de la solicitud**

| Campo | Tipo | Obligatorio | Descripción |
| --- | --- | --- | --- |
| `label` | string | No | máx. 60 caracteres |
| `autoRenew` | boolean | No | — |

*Ejemplo*

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

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

## Generar una nueva contraseña de proxy para el usuario principal

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

La contraseña anterior deja de funcionar en la puerta de enlace en un plazo de 60 segundos.

Autenticación: clave de API en el encabezado `Authorization: Bearer API_KEY`.

**Parámetros**

| Nombre | En | Tipo | Obligatorio | Descripción |
| --- | --- | --- | --- | --- |
| `subscriptionId` | path | string | Sí | — |

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

## Uso diario de tráfico

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

Autenticación: clave de API en el encabezado `Authorization: Bearer API_KEY`.

**Parámetros**

| Nombre | En | Tipo | Obligatorio | Descripción |
| --- | --- | --- | --- | --- |
| `subscriptionId` | path | string | Sí | — |
| `from` | query | string (date) | No | Primer día (UTC), incluido. Valor predeterminado = 29 días antes de `to`. |
| `to` | query | string (date) | No | Último día (UTC), incluido. Valor predeterminado = hoy. Rango máximo: 366 días. |
| `subUserId` | query | string | No | Limitar a un solo subusuario. |

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

## Lista de subusuarios (credenciales de proxy independientes con su propio límite de tráfico)

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

Autenticación: clave de API en el encabezado `Authorization: Bearer API_KEY`.

**Parámetros**

| Nombre | En | Tipo | Obligatorio | Descripción |
| --- | --- | --- | --- | --- |
| `subscriptionId` | path | string | Sí | — |

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

## Crear un subusuario

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

Autenticación: clave de API en el encabezado `Authorization: Bearer API_KEY`.

**Parámetros**

| Nombre | En | Tipo | Obligatorio | Descripción |
| --- | --- | --- | --- | --- |
| `subscriptionId` | path | string | Sí | — |

**Cuerpo de la solicitud**

| Campo | Tipo | Obligatorio | Descripción |
| --- | --- | --- | --- |
| `label` | string | Sí | máx. 60 caracteres |
| `password` | string | No | Se genera si se omite. — máx. 64 caracteres |
| `trafficLimitBytes` | integer (int64), nullable | No | ≥ 0 |

*Ejemplo*

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

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

## Actualizar un subusuario (etiqueta, límite, activar/desactivar, nueva contraseña)

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

Autenticación: clave de API en el encabezado `Authorization: Bearer API_KEY`.

**Parámetros**

| Nombre | En | Tipo | Obligatorio | Descripción |
| --- | --- | --- | --- | --- |
| `subscriptionId` | path | string | Sí | — |
| `subUserId` | path | string | Sí | — |

**Cuerpo de la solicitud**

| Campo | Tipo | Obligatorio | Descripción |
| --- | --- | --- | --- |
| `label` | string | No | máx. 60 caracteres |
| `trafficLimitBytes` | integer (int64), nullable | No | ≥ 0 |
| `enabled` | boolean | No | — |
| `regeneratePassword` | boolean | No | — |

*Ejemplo*

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

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

## Eliminar un subusuario

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

Autenticación: clave de API en el encabezado `Authorization: Bearer API_KEY`.

**Parámetros**

| Nombre | En | Tipo | Obligatorio | Descripción |
| --- | --- | --- | --- | --- |
| `subscriptionId` | path | string | Sí | — |
| `subUserId` | path | string | Sí | — |

**Respuesta** `204 No Content`

Sin cuerpo: el código de estado es la respuesta.

*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
```

## Países donde está disponible un producto

`GET /v1/catalog/countries`

Público: no se necesita una clave de API.

**Parámetros**

| Nombre | En | Tipo | Obligatorio | Descripción |
| --- | --- | --- | --- | --- |
| `product` | query | string | No | Restringe la búsqueda a las ubicaciones donde este producto está disponible (`residential`, `mobile`, `mobile-gb`). |

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

## Estados o provincias disponibles para segmentar en un país (US, CA, AU…)

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

Valores del segmento de nombre de usuario `-state-{state}`. Lista vacía para países sin segmentación por estado. No se enumeran los códigos ZIP: el segmento `-zip-{zip}` acepta cualquier código ZIP de 5 dígitos de EE. UU. y la puerta de enlace muestra una página de error cuando no hay una IP de salida que coincida.

Público: no se necesita una clave de API.

**Parámetros**

| Nombre | En | Tipo | Obligatorio | Descripción |
| --- | --- | --- | --- | --- |
| `countryCode` | path | string | Sí | ISO 3166-1 alpha-2, en mayúsculas. |

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

## Ciudades disponibles para segmentar en un país

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

Con `product=mobile` o `product=mobile-gb`, solo las ciudades donde hay módems 4G/5G.

Público: no se necesita una clave de API.

**Parámetros**

| Nombre | En | Tipo | Obligatorio | Descripción |
| --- | --- | --- | --- | --- |
| `countryCode` | path | string | Sí | ISO 3166-1 alpha-2, en mayúsculas. |
| `product` | query | string | No | Restringe la búsqueda a las ubicaciones donde este producto está disponible (`residential`, `mobile`, `mobile-gb`). |

**Respuesta** `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) disponibles para segmentar en un país: solo residencial

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

Público: no se necesita una clave de API.

**Parámetros**

| Nombre | En | Tipo | Obligatorio | Descripción |
| --- | --- | --- | --- | --- |
| `countryCode` | path | string | Sí | ISO 3166-1 alpha-2, en mayúsculas. |

**Respuesta** `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 es un servicio de proxy residencial de Estados Unidos para comprobar resultados de búsqueda locales, anuncios y precios ciudad por ciudad, con pago en criptomonedas y sin subir documentos de identidad.
