# Proxys résidentiels et identifiants

> API LocalSERP Proxy : abonnements de trafic, identifiants proxy, sous-utilisateurs, utilisation et emplacements ciblables, avec des exemples pour curl, Python et Node.js.

- URL: https://localserpproxy.com/fr/docs/api/residential/
- Dernière mise à jour: 2026-10-15
- Publisher: LocalSERP Proxy (https://localserpproxy.com)

Gérez vos abonnements de trafic (résidentiel et 4G/5G rotatif au GB) : identifiants de proxy, sous-utilisateurs avec leurs propres identifiants et limite de trafic, consommation quotidienne et emplacements que vous pouvez cibler dans le nom d’utilisateur du proxy.

**Points de terminaison sur cette page**

- `GET /v1/residential/subscriptions` : lister les abonnements de trafic (proxy résidentiel et proxy mobile rotatif au GB)
- `GET /v1/residential/subscriptions/{subscriptionId}` : obtenir un abonnement de proxy résidentiel
- `PATCH /v1/residential/subscriptions/{subscriptionId}` : renommer un abonnement ou activer/désactiver le renouvellement automatique
- `POST /v1/residential/subscriptions/{subscriptionId}/reset-password` : générer un nouveau mot de passe proxy pour l’utilisateur principal
- `GET /v1/residential/subscriptions/{subscriptionId}/usage` : utilisation quotidienne du trafic
- `GET /v1/residential/subscriptions/{subscriptionId}/sub-users` : lister les sous-utilisateurs (identifiants proxy distincts avec leur propre limite de trafic)
- `POST /v1/residential/subscriptions/{subscriptionId}/sub-users` : créer un sous-utilisateur
- `PATCH /v1/residential/subscriptions/{subscriptionId}/sub-users/{subUserId}` : modifier un sous-utilisateur (libellé, limite, activer/désactiver, nouveau mot de passe)
- `DELETE /v1/residential/subscriptions/{subscriptionId}/sub-users/{subUserId}` : supprimer un sous-utilisateur
- `GET /v1/catalog/countries` : pays où un produit est disponible
- `GET /v1/catalog/countries/{countryCode}/states` : États/provinces ciblables dans un pays (US, CA, AU…)
- `GET /v1/catalog/countries/{countryCode}/cities` : villes ciblables dans un pays
- `GET /v1/catalog/countries/{countryCode}/asns` : ISP ciblables (ASN) dans un pays — proxy résidentiel uniquement

URL de base `https://localserpproxy.com/api/v1`. Authentification, erreurs et limites : voir la [présentation de l’API](https://localserpproxy.com/fr/docs/api/).

## Sessions persistantes

Ajoutez `-session-{id}-ttl-{minutes}` au nom d’utilisateur proxy pour conserver la même IP : `{id}` correspond à 1–32 lettres ou chiffres de votre choix, `ttl` à 1–30 minutes. L’IP peut changer plus tôt, par exemple si l’appareil qui l’utilise se déconnecte.

## Lister les abonnements de trafic (proxy résidentiel et proxy mobile rotatif au GB)

`GET /v1/residential/subscriptions`

Authentification : clé API dans l’en-tête `Authorization: Bearer API_KEY`.

**Paramètres**

| Nom | Dans | Type | Obligatoire | Description |
| --- | --- | --- | --- | --- |
| `productId` | query | `residential` · `mobile-gb` | Non | Uniquement ce produit (absent : les deux). |

**Réponse** `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());
```

## Obtenir un abonnement de proxy résidentiel

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

Authentification : clé API dans l’en-tête `Authorization: Bearer API_KEY`.

**Paramètres**

| Nom | Dans | Type | Obligatoire | Description |
| --- | --- | --- | --- | --- |
| `subscriptionId` | path | string | Oui | — |

**Réponse** `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());
```

## Renommer un abonnement ou activer/désactiver le renouvellement automatique

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

Authentification : clé API dans l’en-tête `Authorization: Bearer API_KEY`.

**Paramètres**

| Nom | Dans | Type | Obligatoire | Description |
| --- | --- | --- | --- | --- |
| `subscriptionId` | path | string | Oui | — |

**Corps de la requête**

| Champ | Type | Obligatoire | Description |
| --- | --- | --- | --- |
| `label` | string | Non | 60 caractères max. |
| `autoRenew` | boolean | Non | — |

*Exemple*

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

**Réponse** `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());
```

## Générer un nouveau mot de passe proxy pour l’utilisateur principal

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

L’ancien mot de passe cesse de fonctionner sur la passerelle sous 60 secondes.

Authentification : clé API dans l’en-tête `Authorization: Bearer API_KEY`.

**Paramètres**

| Nom | Dans | Type | Obligatoire | Description |
| --- | --- | --- | --- | --- |
| `subscriptionId` | path | string | Oui | — |

**Réponse** `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());
```

## Consommation quotidienne de trafic

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

Authentification : clé API dans l’en-tête `Authorization: Bearer API_KEY`.

**Paramètres**

| Nom | Dans | Type | Obligatoire | Description |
| --- | --- | --- | --- | --- |
| `subscriptionId` | path | string | Oui | — |
| `from` | query | string (date) | Non | Premier jour (UTC), inclus. Par défaut = 29 jours avant `to`. |
| `to` | query | string (date) | Non | Dernier jour (UTC), inclus. Par défaut = aujourd’hui. Plage maximale : 366 jours. |
| `subUserId` | query | string | Non | Limiter à un seul sous-utilisateur. |

**Réponse** `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());
```

## Lister les sous-utilisateurs (identifiants proxy distincts avec leur propre plafond de trafic)

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

Authentification : clé API dans l’en-tête `Authorization: Bearer API_KEY`.

**Paramètres**

| Nom | Dans | Type | Obligatoire | Description |
| --- | --- | --- | --- | --- |
| `subscriptionId` | path | string | Oui | — |

**Réponse** `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());
```

## Créer un sous-utilisateur

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

Authentification : clé API dans l’en-tête `Authorization: Bearer API_KEY`.

**Paramètres**

| Nom | Dans | Type | Obligatoire | Description |
| --- | --- | --- | --- | --- |
| `subscriptionId` | path | string | Oui | — |

**Corps de la requête**

| Champ | Type | Obligatoire | Description |
| --- | --- | --- | --- |
| `label` | string | Oui | 60 caractères max. |
| `password` | string | Non | Généré si omis. — 64 caractères max. |
| `trafficLimitBytes` | integer (int64), nullable | Non | ≥ 0 |

*Exemple*

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

**Réponse** `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());
```

## Modifier un sous-utilisateur (libellé, plafond, activation/désactivation, nouveau mot de passe)

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

Authentification : clé API dans l’en-tête `Authorization: Bearer API_KEY`.

**Paramètres**

| Nom | Dans | Type | Obligatoire | Description |
| --- | --- | --- | --- | --- |
| `subscriptionId` | path | string | Oui | — |
| `subUserId` | path | string | Oui | — |

**Corps de la requête**

| Champ | Type | Obligatoire | Description |
| --- | --- | --- | --- |
| `label` | string | Non | 60 caractères max. |
| `trafficLimitBytes` | integer (int64), nullable | Non | ≥ 0 |
| `enabled` | boolean | Non | — |
| `regeneratePassword` | boolean | Non | — |

*Exemple*

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

**Réponse** `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());
```

## Supprimer un sous-utilisateur

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

Authentification : clé API dans l’en-tête `Authorization: Bearer API_KEY`.

**Paramètres**

| Nom | Dans | Type | Obligatoire | Description |
| --- | --- | --- | --- | --- |
| `subscriptionId` | path | string | Oui | — |
| `subUserId` | path | string | Oui | — |

**Réponse** `204 No Content`

Aucun corps : le code d’état fait office de réponse.

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

## Pays où un produit est disponible

`GET /v1/catalog/countries`

Public : aucune clé API requise.

**Paramètres**

| Nom | Dans | Type | Obligatoire | Description |
| --- | --- | --- | --- | --- |
| `product` | query | string | Non | Limitez la recherche aux zones où ce produit est disponible (`residential`, `mobile`, `mobile-gb`). |

**Réponse** `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());
```

## États / provinces ciblables dans un pays (US, CA, AU…)

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

Valeurs du segment de nom d’utilisateur `-state-{state}`. Liste vide pour les pays sans ciblage par État. Les codes ZIP ne sont pas répertoriés : le segment `-zip-{zip}` accepte tout code ZIP américain à 5 chiffres et la passerelle renvoie une page d’erreur lorsqu’aucune IP de sortie ne correspond.

Public : aucune clé API requise.

**Paramètres**

| Nom | Dans | Type | Obligatoire | Description |
| --- | --- | --- | --- | --- |
| `countryCode` | path | string | Oui | ISO 3166-1 alpha-2, en majuscules. |

**Réponse** `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());
```

## Villes ciblables dans un pays

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

Avec `product=mobile` ou `product=mobile-gb`, seules les villes équipées de modems 4G/5G sont disponibles.

Public : aucune clé API requise.

**Paramètres**

| Nom | Dans | Type | Obligatoire | Description |
| --- | --- | --- | --- | --- |
| `countryCode` | path | string | Oui | ISO 3166-1 alpha-2, en majuscules. |
| `product` | query | string | Non | Limitez la recherche aux zones où ce produit est disponible (`residential`, `mobile`, `mobile-gb`). |

**Réponse** `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());
```

## FAI (ASN) ciblables dans un pays — résidentiel uniquement

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

Public : aucune clé API requise.

**Paramètres**

| Nom | Dans | Type | Obligatoire | Description |
| --- | --- | --- | --- | --- |
| `countryCode` | path | string | Oui | ISO 3166-1 alpha-2, en majuscules. |

**Réponse** `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 est un service de proxy résidentiel aux États-Unis pour vérifier les résultats de recherche locaux, les annonces et les prix ville par ville, avec paiement en crypto et sans envoi de pièce d’identité.
