# モバイルポートとIPローテーション

> LocalSERP Proxy API：4G/5Gポート、IPローテーション（即時、タイマー設定、リンク経由）と日次通信量。パラメーター、レスポンス例、curl、Python、Node.jsのコード。

- URL: https://localserpproxy.com/ja/docs/api/mobile/
- 最終更新日: 2026-10-15
- Publisher: LocalSERP Proxy (https://localserpproxy.com)

専用4G/5Gポート：今すぐ、またはタイマーでIPを変更し、ローテーションリンクを使用して、日次トラフィックを確認できます。

**このページのエンドポイント**

- `GET /v1/mobile`：モバイルポート一覧を取得
- `GET /v1/mobile/{portId}`：モバイルポートを取得
- `PATCH /v1/mobile/{portId}`：名前の変更、自動更新の切り替え、自動ローテーションの設定
- `POST /v1/mobile/{portId}/rotate`：今すぐIPを変更
- `GET /v1/mobile/{portId}/rotate`：ローテーションリンク（クエリ文字列にAPIキーを含めてGET）
- `POST /v1/mobile/{portId}/reset-password`：ポート用の新しいプロキシパスワードを生成
- `GET /v1/mobile/{portId}/usage`：ポート経由の日次通信量（参考情報：フェアユースの範囲内でデータ無制限）
- `GET /v1/catalog/countries/{countryCode}/carriers`：国ごとの、利用可能な4G/5Gポートを持つモバイルキャリア

ベースURL `https://localserpproxy.com/api/v1`。認証、エラー、制限については[API概要](https://localserpproxy.com/ja/docs/api/)をご覧ください。

## モバイルポート一覧

`GET /v1/mobile`

認証：`Authorization: Bearer API_KEY`ヘッダーにAPIキーを指定します。

**レスポンス** `200 OK`

```json
{
  "data": [
    {
      "id": "mob_2v8k1q",
      "label": "US Verizon #1",
      "status": "active",
      "country": "US",
      "city": null,
      "carrier": "verizon",
      "carrierName": "Verizon",
      "networkType": "4G",
      "currentIp": "203.0.113.201",
      "ipChangedAt": "2026-10-05T14:03:11Z",
      "endpoint": {
        "host": "gw.localserpproxy.com",
        "httpPort": 7777,
        "socksPort": 7778
      },
      "username": "USERNAME",
      "password": "PASSWORD",
      "rotation": {
        "mode": "interval",
        "intervalMinutes": 10
      },
      "minRotationIntervalSeconds": 30,
      "rotationLink": "https://localserpproxy.com/api/v1/mobile/mob_2v8k1q/rotate?key=API_KEY",
      "planId": "mob-us-30d",
      "autoRenew": false,
      "createdAt": "2026-10-05T14:03:11Z",
      "expiresAt": "2026-11-04T14:03:11Z"
    }
  ]
}
```

*curl*

```bash
curl -s "https://localserpproxy.com/api/v1/mobile" \
  -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}/mobile", 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}/mobile`, {
  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());
```

## モバイルポートを取得

`GET /v1/mobile/{portId}`

認証：`Authorization: Bearer API_KEY`ヘッダーにAPIキーを指定します。

**パラメーター**

| 名前 | 場所 | 型 | 必須 | 説明 |
| --- | --- | --- | --- | --- |
| `portId` | path | string | はい | — |

**レスポンス** `200 OK`

```json
{
  "id": "mob_2v8k1q",
  "label": "US Verizon #1",
  "status": "active",
  "country": "US",
  "city": null,
  "carrier": "verizon",
  "carrierName": "Verizon",
  "networkType": "4G",
  "currentIp": "203.0.113.201",
  "ipChangedAt": "2026-10-05T14:03:11Z",
  "endpoint": {
    "host": "gw.localserpproxy.com",
    "httpPort": 7777,
    "socksPort": 7778
  },
  "username": "USERNAME",
  "password": "PASSWORD",
  "rotation": {
    "mode": "interval",
    "intervalMinutes": 10
  },
  "minRotationIntervalSeconds": 30,
  "rotationLink": "https://localserpproxy.com/api/v1/mobile/mob_2v8k1q/rotate?key=API_KEY",
  "planId": "mob-us-30d",
  "autoRenew": false,
  "createdAt": "2026-10-05T14:03:11Z",
  "expiresAt": "2026-11-04T14:03:11Z"
}
```

*curl*

```bash
curl -s "https://localserpproxy.com/api/v1/mobile/mob_2v8k1q" \
  -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}/mobile/mob_2v8k1q", 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}/mobile/mob_2v8k1q`, {
  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());
```

## ポート名の変更、自動更新の切り替え、自動ローテーションの設定

`PATCH /v1/mobile/{portId}`

ポート名の変更、自動更新のオン・オフ、または2分ごとから24時間ごとまでの自動ローテーションタイマーを設定できます：`"rotation": { "mode": "interval", "intervalMinutes": 10 }`（2～1440分）；`"mode": "manual"`でオフになります。それ以外の場合、ローテーションするまでポートのIPは維持されますが、通信事業者が不定期に変更することがあります。

認証：`Authorization: Bearer API_KEY`ヘッダーにAPIキーを指定します。

**パラメーター**

| 名前 | 場所 | 型 | 必須 | 説明 |
| --- | --- | --- | --- | --- |
| `portId` | path | string | はい | — |

**リクエストボディ**

| フィールド | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `label` | string | いいえ | 最大60文字 |
| `autoRenew` | boolean | いいえ | — |
| `rotation` | object | いいえ | 自動ローテーションタイマー：`{ "mode": "interval", "intervalMinutes": 2–1440 }`（2分ごとから24時間ごと）、または`{ "mode": "manual", "intervalMinutes": null }`で必要なときだけローテーションします。 |

*例: 自動ローテーション*

```json
{
  "rotation": {
    "mode": "interval",
    "intervalMinutes": 10
  }
}
```

*例: 手動*

```json
{
  "rotation": {
    "mode": "manual",
    "intervalMinutes": null
  }
}
```

**レスポンス** `200 OK`

```json
{
  "id": "mob_2v8k1q",
  "label": "US Verizon #1",
  "status": "active",
  "country": "US",
  "city": null,
  "carrier": "verizon",
  "carrierName": "Verizon",
  "networkType": "4G",
  "currentIp": "203.0.113.201",
  "ipChangedAt": "2026-10-05T14:03:11Z",
  "endpoint": {
    "host": "gw.localserpproxy.com",
    "httpPort": 7777,
    "socksPort": 7778
  },
  "username": "USERNAME",
  "password": "PASSWORD",
  "rotation": {
    "mode": "interval",
    "intervalMinutes": 10
  },
  "minRotationIntervalSeconds": 30,
  "rotationLink": "https://localserpproxy.com/api/v1/mobile/mob_2v8k1q/rotate?key=API_KEY",
  "planId": "mob-us-30d",
  "autoRenew": false,
  "createdAt": "2026-10-05T14:03:11Z",
  "expiresAt": "2026-11-04T14:03:11Z"
}
```

*curl*

```bash
curl -s -X PATCH "https://localserpproxy.com/api/v1/mobile/mob_2v8k1q" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"rotation":{"mode":"interval","intervalMinutes":10}}'
```

*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}/mobile/mob_2v8k1q", headers=HEADERS, json={"rotation": {"mode": "interval", "intervalMinutes": 10}}, 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}/mobile/mob_2v8k1q`, {
  method: 'PATCH',
  headers: { Authorization: `Bearer ${process.env.API_KEY}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({ rotation: { mode: 'interval', intervalMinutes: 10 } }),
});
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());
```

## 今すぐIPを変更

`POST /v1/mobile/{portId}/rotate`

ローテーションのたびにポートが通信事業者に再接続し、新しいIPを取得します。通常5～15秒かかります。通信事業者から同じIPが割り当てられることもあります。その場合は、もう一度ローテーションしてください。ポートごとに30秒に1回までです（`minRotationIntervalSeconds`）。間隔が短すぎる場合、`429 rotation_too_soon`と、待機する秒数`Retry-After`が返されます。

認証：`Authorization: Bearer API_KEY`ヘッダーにAPIキーを指定します。

**パラメーター**

| 名前 | 場所 | 型 | 必須 | 説明 |
| --- | --- | --- | --- | --- |
| `portId` | path | string | はい | — |

**レスポンス** `200 OK`

```json
{
  "ip": "203.0.113.201",
  "previousIp": "203.0.113.77",
  "rotatedAt": "2026-10-05T14:03:11Z",
  "nextRotationAvailableAt": "2026-10-05T14:03:41Z"
}
```

*curl*

```bash
curl -s -X POST "https://localserpproxy.com/api/v1/mobile/mob_2v8k1q/rotate" \
  -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}/mobile/mob_2v8k1q/rotate", 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}/mobile/mob_2v8k1q/rotate`, {
  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());
```

## ローテーション用リンク（クエリ文字列にAPIキーを含むGET）

`GET /v1/mobile/{portId}/rotate`

`POST`と同じ機能をスクリプトやブックマークから利用できます：`GET https://localserpproxy.com/api/v1/mobile/{portId}/rotate?key=API_KEY`。キーには`proxies`スコープが必要です。`format=text`は新しいIPを`text/plain`として返します。

認証：`key`クエリパラメーターにAPIキー（スコープ`proxies`）を指定するため、ブックマークからリンクを開けます。

**パラメーター**

| 名前 | 場所 | 型 | 必須 | 説明 |
| --- | --- | --- | --- | --- |
| `key` | query | string | はい | APIキー（スコープ`proxies`）。 |
| `portId` | path | string | はい | — |
| `format` | query | `json` · `text` | いいえ | デフォルト `json` |

**レスポンス** `200 OK`

```json
{
  "ip": "203.0.113.201",
  "previousIp": "203.0.113.77",
  "rotatedAt": "2026-10-05T14:03:11Z",
  "nextRotationAvailableAt": "2026-10-05T14:03:41Z"
}
```

*curl*

```bash
curl -s "https://localserpproxy.com/api/v1/mobile/mob_2v8k1q/rotate?key=$API_KEY&format=text"
```

*Python*

```python
import os
import requests

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

r = requests.get(f"{API}/mobile/mob_2v8k1q/rotate", params={"key": os.environ["API_KEY"], "format": "text"}, timeout=30)
r.raise_for_status()
print(r.text)
```

*Node.js*

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

const res = await fetch(`${API}/mobile/mob_2v8k1q/rotate?key=${process.env.API_KEY}&format=text`);
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.text());
```

## ポートの新しいプロキシパスワードを生成

`POST /v1/mobile/{portId}/reset-password`

認証：`Authorization: Bearer API_KEY`ヘッダーにAPIキーを指定します。

**パラメーター**

| 名前 | 場所 | 型 | 必須 | 説明 |
| --- | --- | --- | --- | --- |
| `portId` | path | string | はい | — |

**レスポンス** `200 OK`

```json
{
  "id": "mob_2v8k1q",
  "label": "US Verizon #1",
  "status": "active",
  "country": "US",
  "city": null,
  "carrier": "verizon",
  "carrierName": "Verizon",
  "networkType": "4G",
  "currentIp": "203.0.113.201",
  "ipChangedAt": "2026-10-05T14:03:11Z",
  "endpoint": {
    "host": "gw.localserpproxy.com",
    "httpPort": 7777,
    "socksPort": 7778
  },
  "username": "USERNAME",
  "password": "PASSWORD",
  "rotation": {
    "mode": "interval",
    "intervalMinutes": 10
  },
  "minRotationIntervalSeconds": 30,
  "rotationLink": "https://localserpproxy.com/api/v1/mobile/mob_2v8k1q/rotate?key=API_KEY",
  "planId": "mob-us-30d",
  "autoRenew": false,
  "createdAt": "2026-10-05T14:03:11Z",
  "expiresAt": "2026-11-04T14:03:11Z"
}
```

*curl*

```bash
curl -s -X POST "https://localserpproxy.com/api/v1/mobile/mob_2v8k1q/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}/mobile/mob_2v8k1q/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}/mobile/mob_2v8k1q/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());
```

## ポート経由の日次トラフィック（参考：データ通信は無制限、フェアユース適用）

`GET /v1/mobile/{portId}/usage`

参考情報です。専用ポートのデータ通信は公正利用の範囲内で無制限です。極端に大量に利用すると、通信事業者によって速度が制限されたり、一時停止されたりする場合があります。

認証：`Authorization: Bearer API_KEY`ヘッダーにAPIキーを指定します。

**パラメーター**

| 名前 | 場所 | 型 | 必須 | 説明 |
| --- | --- | --- | --- | --- |
| `portId` | path | string | はい | — |
| `from` | query | string (date) | いいえ | 開始日（UTC、当日を含む）。デフォルトは`to`の29日前です。 |
| `to` | query | string (date) | いいえ | 終了日（UTC、当日を含む）。デフォルトは今日です。期間は最大366日です。 |

**レスポンス** `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/mobile/mob_2v8k1q/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}/mobile/mob_2v8k1q/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}/mobile/mob_2v8k1q/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());
```

## 各国で4G/5Gポートを利用できるモバイル通信事業者

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

公開情報：APIキーは不要です。

**パラメーター**

| 名前 | 場所 | 型 | 必須 | 説明 |
| --- | --- | --- | --- | --- |
| `countryCode` | path | string | はい | ISO 3166-1 alpha-2（大文字）。 |

**レスポンス** `200 OK`

```json
{
  "data": [
    {
      "id": "verizon",
      "name": "Verizon",
      "networkTypes": [
        "4G",
        "5G"
      ],
      "available": true,
      "cities": []
    }
  ]
}
```

*curl*

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

*Python*

```python
import os
import requests

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

r = requests.get(f"{API}/catalog/countries/US/carriers", 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/carriers`);
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());
```

---

LocalSERP Proxy: LocalSERP Proxyは、都市ごとにローカル検索結果、広告、価格を確認するための米国のレジデンシャルプロキシサービスで、暗号資産で支払い、身分証明書のアップロードは不要です。
