開発者向け

リセラーAPI

プログラムから顧客用プロキシを払い出し — サブアカウント作成、帯域割り当て、認証情報発行、使用量取得。

このページの内容

リセラーAPI

概要

アクセス方法. リセラーAPIはアカウント有効化後に利用可能です。APIキーを作成し、下記エンドポイントを呼び出します。

帯域プール
前払い残高です。サブアカウントへの割り当てで減り、回収で戻ります。
サブアカウント
各顧客は、独自の帯域・認証情報・使用量を持つサブアカウントです。
https://socksnode.com/api/v1/reseller

商品

3 つの商品を販売できます。それぞれ独自のプール、卸売価格、各サブアカウントの残高を持つため、ある商品の GB が別の商品として消費されることはありません。allocate・proxies・usage・locations で product フィールドを指定します。

product商品ターゲティングSticky IP
residentialローテーション住宅国、州、都市、ASN1–1440 min
datacenterローテーションデータセンター国、都市、ASN1–1440 min
mobile_rotatingローテーションモバイル(4G/5G キャリア IP)国。州・都市・ASN はトラフィック 2 倍1–120 min

product を省略すると、すべての呼び出しはこれまでどおり住宅として扱われます。データセンターとローテーションモバイルはアカウントで有効化されると利用でき、それまでは 403 product_not_enabled を返します。

# Allocate 10 GB of DATACENTER to a sub-account
curl -X POST "https://socksnode.com/api/v1/reseller/subaccounts/SUB_ID/allocate" \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{"gb": 10, "product": "datacenter"}'

# Generate a ROTATING MOBILE proxy for it
curl -X POST "https://socksnode.com/api/v1/reseller/subaccounts/SUB_ID/proxies" \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{"product": "mobile_rotating", "country": "us",
       "protocol": "http", "sessionMode": "rotating"}'

# No "product" = residential, exactly as before

Pools

住宅帯域は 3 つのプールすべてで同じ価格で使えます。POST /proxies で pool を送るとプールを選べます。省略すると以前どおり Pool 1 です。Mix は mixPools のプールにリクエストを均等に振り分けます。ターゲットに対応できないプールは外れ、1 つのプールしか対応できないターゲットは Pool 1 で動作します。各行の pool、mixPools、poolNote で実際のプールが分かります。

poolターゲティングSticky
1Pool 1国・州・都市・ISP(ASN)を自由に組み合わせ1–1440 min
2Pool 2国、さらに州・都市・ISP のいずれか 1 つ1–60 min
3Pool 3国・州・都市(ISP は不可)1–1440 min
mixMixPool 1 の地域。Mix 内の各プールが対応できる分を担当Pools 1 + 3 を含むとき 1–1440 分(60 分を超えると Pool 2 は外れます)。それ以外は 1–60 分

Pool 2 と Pool 3 の地域:GET /locations?pool=2(または 3)。名前でもコードでも構いません:"Los Angeles"、"losangeles"、"los_angeles" は同じ都市です。

# Pool 3, Los Angeles, the same IP for 30 minutes
curl -X POST "https://socksnode.com/api/v1/reseller/subaccounts/SUB_ID/proxies" \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{"pool": "3", "protocol": "http", "country": "us",
       "state": "california", "city": "losangeles",
       "sessionMode": "sticky", "stickyDurationMinutes": 30}'

# A Mix of all three pools, a new IP on every request
curl -X POST "https://socksnode.com/api/v1/reseller/subaccounts/SUB_ID/proxies" \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{"pool": "mix", "mixPools": "123", "protocol": "http",
       "country": "gb", "sessionMode": "rotating", "count": 5}'

# Pool 2's own states, cities and ISPs in one country
curl "https://socksnode.com/api/v1/reseller/locations/GB?pool=2" \
  -H "Authorization: Bearer sk_live_xxx"

認証

各リクエストはAPIキーをBearerトークンとして認証します。プールから帯域を払い出せるため厳重に管理してください。

レート制限: キーごとに毎分120リクエスト(プロキシ生成はさらに制限されます)。キーは秘密に保ち、サーバーサイドで管理してください。

GET /api/v1/reseller/pool HTTP/1.1
Host: socksnode.com
Authorization: Bearer sk_live_xxx

エラー

エラーは、対応する HTTP ステータスとともに JSON ボディ { "error": { "code", "message" } } を返します:

ステータス意味
400リクエストボディまたはパラメータが無効です
401API キーがない、無効、または失効しています
402プロキシを生成するための帯域幅残高が不足しています
403API キーに必要なスコープがありません
404見つからないか、あなたのものではありません。
422サブアカウント数の上限に達しました。
429レート制限を超過しました — Retry-After ヘッダーを参照してください
503製品はメンテナンス中です。少し後に再試行してください。
HTTP/1.1 402 Payment Required
Content-Type: application/json

{
  "error": {
    "code": "insufficient_pool",
    "message": "…"
  }
}

セッションIDのセルフ生成

各認証情報のusernameは単なるトークン文字列で、passwordはサブアカウントの存続期間中変わりません。一度取得すれば、rotatingでもstickyでも好きなだけローカルでセッションを組み立てられます — 追加のAPI呼び出しも、1リクエストあたり20件の上限も不要です。

この方法で作成したセッションは個別の認証情報として記録されません — サブアカウントのプロキシ一覧には表示されず、個別の失効もできません。帯域は割り当て通りに正しく制限され続け、合計使用量はusageエンドポイントから引き続き確認できます。

# Base credential, from any POST …/proxies call
username: acme-country-us
password: 3f9c2a1b-7e4d-4a2c-9f1a-8b6c5d4e3f2a

# Rotating: no session token, a fresh IP every request
acme-country-us

# Sticky: append your own session id + lifetime (1-1440 minutes).
# Build as many as you want locally, no API call needed:
acme-country-us-session-req0001-lifetime-30
acme-country-us-session-req0002-lifetime-30
acme-country-us-session-req0003-lifetime-30

# State and city targeting work the same way (see /locations):
acme-country-us-state-california-session-req0004-lifetime-30

ゲートウェイの独自ブランド化

プロキシを弊社のドメインではなく、お客様自身のドメイン経由でルーティングできます。gatewayIdは入口リージョン(fr/us/sg)を指定するもので、出口国には影響しません — 出口国はcountryフィールドで別途指定します。

RegiongatewayIdCNAME target
Nearest (default)autoglobal.socksnode.com
Francefrfr.socksnode.com
United Statesusus.socksnode.com
Singaporesgsg.socksnode.com
  1. 1

    Add a DNS record.

    For each region you want branded, create a CNAME from your own subdomain (e.g. us.yourbrand.com) to that region's target above. Only set up the regions you'll use; anything left blank falls back to your default host. If your DNS provider can't do a CNAME there, use an A record and ask us for the current IPs. A CNAME follows automatically if they change; an A record won't.

  2. 2

    Wait for DNS to propagate.

    Usually a few minutes, sometimes a few hours, depending on your provider and TTL.

  3. 3

    Set it in your dashboard.

    Go to Reseller → White-label gateway. With more than one region you'll see a field per region plus a Default field. Enter the domain you set up and save.

  4. 4

    Verify.

    Generate a test proxy for that region, check that the host in the response is your domain, then connect through it once.

gatewayId picks your customer's entry point, not their exit country; the exit country is the country field. A DNS lookup on your CNAME still shows it resolves to socksnode.com. To hide that from your own customers, run your own relay (nginx or HAProxy stream) in front instead of a plain CNAME, and ask us if you need help.

; One CNAME per region you brand
proxy.yourbrand.com.   CNAME   global.socksnode.com.
fr.yourbrand.com.      CNAME   fr.socksnode.com.
us.yourbrand.com.      CNAME   us.socksnode.com.
sg.yourbrand.com.      CNAME   sg.socksnode.com.

エンドポイント

帯域プールの残高を取得

GET/pool

スコープ: reseller:read

パラメータなし。

curl "https://socksnode.com/api/v1/reseller/pool" \
  -H "Authorization: Bearer sk_live_xxx"
レスポンス200
{
  "poolGb": 812.5,
  "allocatedGb": 187.5,
  "subAccounts": 42,
  "products": {
    "residential": { "poolGb": 812.5, "allocatedGb": 187.5, "ratePerGb": 0.54, "pricing": "wholesale" },
    "datacenter": { "poolGb": 300, "allocatedGb": 23.2, "ratePerGb": null, "pricing": "site" }
  }
}

顧客用のサブアカウントを作成

POST/subaccounts

スコープ: reseller:manage

ボディパラメータ

  • labelstring任意

    この顧客の名前、最大80文字。

curl -X POST "https://socksnode.com/api/v1/reseller/subaccounts" \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "label": "customer-acme"
  }'
レスポンス201
{
  "id": "sub_9f2a…",
  "label": "customer-acme",
  "balanceGb": 0,
  "usedGb": 0,
  "status": "active",
  "createdAt": "2026-09-30T08:12:44.000Z",
  "products": {
    "residential": { "balanceGb": 8.4, "usedGb": 1.6 },
    "datacenter": { "balanceGb": 20, "usedGb": 3.2 },
    "mobile_rotating": { "balanceGb": 0, "usedGb": 0 }
  }
}

残高と使用量つきでサブアカウントを一覧

GET/subaccounts

スコープ: reseller:read

パラメータなし。

curl "https://socksnode.com/api/v1/reseller/subaccounts" \
  -H "Authorization: Bearer sk_live_xxx"
レスポンス200
{
  "data": [
    {
      "id": "sub_9f2a…",
      "label": "customer-acme",
      "balanceGb": 8.4,
      "usedGb": 1.6,
      "status": "active",
      "createdAt": "2026-09-30T08:12:44.000Z",
      "products": {
        "residential": { "balanceGb": 8.4, "usedGb": 1.6 },
        "datacenter": { "balanceGb": 20, "usedGb": 3.2 },
        "mobile_rotating": { "balanceGb": 0, "usedGb": 0 }
      }
    }
  ]
}

サブアカウントを1件取得

GET/subaccounts/{id}

スコープ: reseller:read

パスパラメータ

  • idstring必須

    サブアカウントの id。

curl "https://socksnode.com/api/v1/reseller/subaccounts/SUB_ID" \
  -H "Authorization: Bearer sk_live_xxx"
レスポンス200
{
  "id": "sub_9f2a…",
  "label": "customer-acme",
  "balanceGb": 8.4,
  "usedGb": 1.6,
  "status": "active",
  "createdAt": "2026-09-30T08:12:44.000Z",
  "products": {
    "residential": { "balanceGb": 8.4, "usedGb": 1.6 },
    "datacenter": { "balanceGb": 20, "usedGb": 3.2 },
    "mobile_rotating": { "balanceGb": 0, "usedGb": 0 }
  }
}

サブアカウントの名前変更または再有効化

PATCH/subaccounts/{id}

スコープ: reseller:manage

パスパラメータ

  • idstring必須

    サブアカウントの id。

ボディパラメータ

  • labelstring | null任意

    この顧客の名前、最大80文字。

  • reactivateboolean任意

    true でサブアカウントのプロキシを再有効化。帯域は戻りません。

curl -X PATCH "https://socksnode.com/api/v1/reseller/subaccounts/SUB_ID" \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "label": "customer-acme-eu"
  }'
レスポンス200
{
  "id": "sub_9f2a…",
  "label": "customer-acme-eu",
  "balanceGb": 8.4,
  "usedGb": 1.6,
  "status": "active",
  "createdAt": "2026-09-30T08:12:44.000Z",
  "products": {
    "residential": { "balanceGb": 8.4, "usedGb": 1.6 },
    "datacenter": { "balanceGb": 20, "usedGb": 3.2 },
    "mobile_rotating": { "balanceGb": 0, "usedGb": 0 }
  }
}

プールからサブアカウントへ帯域を割り当てます

POST/subaccounts/{id}/allocate

gbに負の値を指定すると逆に回収できます。

スコープ: reseller:manage

パスパラメータ

  • idstring必須

    サブアカウントの id。

ボディパラメータ

  • gbnumber必須

    プールから移す GB。負の値はサブアカウント残高を上限に GB を戻します。

  • productstring任意

    商品:residential(デフォルト)、datacenter、mobile_rotating。それぞれ独自のプール、卸売価格、サブアカウント残高を持ち、アカウントで有効化されると利用できます。

    residentialdatacentermobile_rotatingデフォルト: residential

curl -X POST "https://socksnode.com/api/v1/reseller/subaccounts/SUB_ID/allocate" \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "gb": 10,
    "product": "datacenter"
  }'
レスポンス200
{
  "id": "sub_9f2a…",
  "product": "datacenter",
  "balanceGb": 10,
  "poolGb": 290
}

// With a negative gb:
// { "id": "sub_9f2a…", "product": "datacenter", "reclaimedGb": 4, "balanceGb": 6, "poolGb": 294 }

サブアカウントのプロキシ認証情報を発行

POST/subaccounts/{id}/proxies

rotating(リクエストごとに新しいIP)またはsticky(stickyDurationMinutesで指定した1〜1440分の間、同じIPを維持)。

スコープ: reseller:manage

パスパラメータ

  • idstring必須

    サブアカウントの id。

ボディパラメータ

  • productstring任意

    商品:residential(デフォルト)、datacenter、mobile_rotating。それぞれ独自のプール、卸売価格、サブアカウント残高を持ち、アカウントで有効化されると利用できます。 mobile_rotating は国指定が標準です。州・都市・ASN 指定はトラフィックが 2 倍で計算され、sticky IP は最長 120 分維持されます。

    residentialdatacentermobile_rotatingデフォルト: residential

  • protocolstring必須

    認証情報のプロトコル。

    httpsocks5

  • countrystring必須

    2文字の国コード、または全世界なら ANY。

  • statestring任意

    米国の州名。スペースなしの正式名、例: california。

  • citystring任意

    スペースなしの都市名、例: losangeles。asn 指定時は無視されます。

  • asninteger任意

    ISP のネットワーク番号、例: Comcast は 7922。

  • sessionModestring必須

    rotating はリクエストごとに新しい IP、sticky は stickyDurationMinutes の間同じ IP。

    rotatingsticky

  • stickyDurationMinutesinteger任意

    sticky IP を保持する時間、1–1440 分。sessionMode が sticky のとき必須。

  • countinteger任意

    作成する認証情報の数、1–20。

    デフォルト: 1

  • labelstring任意

    任意の名前、最大80文字。count が2以上なら各々に #n が付きます。

  • gatewayIdstring任意

    入口リージョン: fr、us、sg。返すホワイトラベルホストを選びます。

    frussg

  • poolstring任意

    住宅プール:1(デフォルト)、2、3、または mix。Pools を参照。

    123mixデフォルト: 1

  • mixPoolsstring任意

    pool が mix のとき:使うプール。12、13、23、123(デフォルト 123)。

    121323123デフォルト: 123

  • strictboolean任意

    true:指定した州・都市・ISP のみ。false:空き IP がないときは国全体にフォールバック。デフォルトは Pool 1 で true、Mix で false。strict の Mix は Pool 1 で動作します。

curl -X POST "https://socksnode.com/api/v1/reseller/subaccounts/SUB_ID/proxies" \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "country": "us",
    "protocol": "http",
    "sessionMode": "rotating",
    "gatewayId": "us"
  }'
レスポンス201
{
  "data": [
    {
      "id": "clx…",
      "host": "gw.your-brand.com",
      "port": 9000,
      "username": "acme-country-us",
      "password": "…",
      "protocol": "http",
      "country": "us",
      "state": null,
      "city": null,
      "sessionMode": "rotating",
      "stickyDurationMinutes": null,
      "label": "customer-acme",
      "product": "residential",
      "pool": "1",
      "mixPools": null,
      "poolNote": null
    }
  ]
}

サブアカウントのプロキシ認証情報を一覧(パスワード付き)

GET/subaccounts/{id}/proxies

スコープ: reseller:read

パスパラメータ

  • idstring必須

    サブアカウントの id。

curl "https://socksnode.com/api/v1/reseller/subaccounts/SUB_ID/proxies" \
  -H "Authorization: Bearer sk_live_xxx"
レスポンス200
{
  "data": [
    {
      "id": "clx…",
      "host": "gw.your-brand.com",
      "port": 9000,
      "username": "acme-country-us",
      "password": "…",
      "protocol": "http",
      "country": "us",
      "state": null,
      "city": null,
      "sessionMode": "rotating",
      "stickyDurationMinutes": null,
      "label": "customer-acme",
      "status": "active",
      "createdAt": "2026-09-30T08:12:44.000Z",
      "lastUsedAt": null,
      "product": "residential",
      "pool": "1",
      "mixPools": null,
      "poolNote": null
    }
  ]
}

期間指定でサブアカウントの使用量を取得

GET/subaccounts/{id}/usage

スコープ: reseller:read

パスパラメータ

  • idstring必須

    サブアカウントの id。

クエリパラメータ

  • rangestring任意

    期間。不明な値は 24h として扱います。

    1h24h7d30d90dtodaymonth12mallデフォルト: 24h

  • productstring任意

    商品:residential(デフォルト)、datacenter、mobile_rotating。それぞれ独自のプール、卸売価格、サブアカウント残高を持ち、アカウントで有効化されると利用できます。

    residentialdatacentermobile_rotatingデフォルト: residential

curl "https://socksnode.com/api/v1/reseller/subaccounts/SUB_ID/usage?range=30d" \
  -H "Authorization: Bearer sk_live_xxx"
レスポンス200
{
  "product": "residential",
  "range": "30d",
  "totalGb": 6.8,
  "totalRequests": 91240,
  "successRate": 98.7,
  "series": [{ "period": "2026-09-01", "gb": 0.4 }],
  "requestSeries": [ … ]
}

サブアカウントを無効化し、残りの帯域を回収

DELETE/subaccounts/{id}

スコープ: reseller:manage

パスパラメータ

  • idstring必須

    サブアカウントの id。

curl -X DELETE "https://socksnode.com/api/v1/reseller/subaccounts/SUB_ID" \
  -H "Authorization: Bearer sk_live_xxx"
レスポンス200
{
  "id": "sub_9f2a…",
  "status": "deactivated",
  "reclaimedGb": 8.4,
  "reclaimed": { "residential": 8.4, "datacenter": 20, "mobile_rotating": 0 }
}

ターゲティング可能な全ての国を一覧表示

GET/locations

スコープ: reseller:read

クエリパラメータ

  • productstring任意

    商品:residential(デフォルト)、datacenter、mobile_rotating。それぞれ独自のプール、卸売価格、サブアカウント残高を持ち、アカウントで有効化されると利用できます。

    residentialdatacentermobile_rotatingデフォルト: residential

  • poolstring任意

    地域を一覧する住宅プール:1(デフォルト)、2、3。Mix は Pool 1 の一覧を使います。

    123デフォルト: 1

curl "https://socksnode.com/api/v1/reseller/locations" \
  -H "Authorization: Bearer sk_live_xxx"
レスポンス200
{
  "product": "residential",
  "data": [
    { "code": "US", "name": "United States" },
    { "code": "GB", "name": "United Kingdom" }
  ]
}

1つの国の州・都市・ISP/ASNを取得

GET/locations/{country}

スコープ: reseller:read

パスパラメータ

  • countrystring必須

    2文字の国コード。

クエリパラメータ

  • productstring任意

    商品:residential(デフォルト)、datacenter、mobile_rotating。それぞれ独自のプール、卸売価格、サブアカウント残高を持ち、アカウントで有効化されると利用できます。

    residentialdatacentermobile_rotatingデフォルト: residential

  • poolstring任意

    地域を一覧する住宅プール:1(デフォルト)、2、3。Mix は Pool 1 の一覧を使います。

    123デフォルト: 1

curl "https://socksnode.com/api/v1/reseller/locations/US" \
  -H "Authorization: Bearer sk_live_xxx"
レスポンス200
{
  "product": "residential",
  "data": {
    "states": [
      {
        "code": "california",
        "name": "California",
        "cities": [{ "code": "losangeles", "name": "Los Angeles" }]
      }
    ],
    "asns": [{ "code": "7922", "name": "Comcast Cable Communications, LLC" }]
  }
}

自社ブランドで住宅用プロキシを販売

リセラーAPIはプログラムと共に順次提供中です。