本文へスキップ
starproxy
はじめる

StarProxy API

ダッシュボードの機能のほとんどはコードから使えます。残高の確認、料金の確認、残高からの注文、オプション付きプロキシユーザー名の取得を、1つのREST APIで行えます。

何から始めればよいですか

  1. 1ユーザー名で登録し、ダッシュボードにログインします。
  2. 2接続タブでAPIキーを作成します。キー全体は作成時に一度だけ表示されるので、すぐに安全な場所に保管してください。
  3. 3キーが必要なリクエストでは、毎回Authorizationヘッダーでキーを送ってください。
  4. 4まず/accountを呼び出してキーが使えることを確認し、その後/ordersで注文します。

認証

ご自身のアカウントに関するリクエスト (account、orders、proxy-user) にはAPIキーが必要で、ヘッダーにAuthorization: Bearer spk_...として送ります。料金、国、見積もりは公開されており、キーなしで使えます。

StarProxyはキーそのものではなく、各キーのハッシュのみを保持します。キーを紛失した場合は、ダッシュボードで新しいキーを作成してください。その時点で古いキーは使えなくなります。キーはサーバーのコードにのみ置き、ブラウザで動くコードや公開リポジトリには絶対に入れないでください。

HTTP header
Authorization: Bearer spk_your_api_key

ベースURLとデータ形式

ベースURL
https://starproxy.shop/api/v1
リクエストとレスポンスの本文
application/json
金額
USDの数値 (例: 1047.70)
タイムスタンプ
ISO 8601 (UTC)

レート制限はありますか

1つのAPIキーで1分あたり最大60回呼び出せます。キーなしの公開エンドポイントは、IPごとに1分あたり60回までです。上限を超えるとHTTP 429が返るので、1分待ってから送り直してください。

エラーの形式

HTTPステータスコードと、短いエラーコードとメッセージを含むJSON本文が返ります。

例
{
  "error": {
    "code": "insufficient_balance",
    "message": "Your balance is too low for this order. Top up in the dashboard."
  }
}
code
bad_requestHTTP 400必須の値がないか、この製品では無効な値です。
unauthorizedHTTP 401APIキーがないか、一致しません。
insufficient_balanceHTTP 402残高が注文の合計額より少なくなっています。差し引きは行われていません。
not_foundHTTP 404お客様のアカウントにこのidの注文はありません。
rate_limitedHTTP 4291分間のリクエストが多すぎます。
server_errorHTTP 500サーバーがリクエストを完了できませんでした。差し引きは行われていません。

エンドポイント

アカウントを取得

GET/api/v1/accountAPIキーが必要

残高、プロキシのホストとポート、プロキシユーザー名とパスワード、許可IPを返します。

リクエスト
curl https://starproxy.shop/api/v1/account \
  -H "Authorization: Bearer spk_your_api_key"
レスポンス
{
  "username": "star_user01",
  "balance_usd": 1300,
  "proxy": {
    "host": "gate.starproxy.shop",
    "http_port": 6100,
    "socks5_port": 6200,
    "username": "spexample1",
    "password": "your_password"
  },
  "allowed_ips": [
    "203.0.113.10"
  ]
}

製品と料金を取得

GET/api/v1/productsキー不要

料金ページと同じ料金表から、製品ごとの注文範囲、数量段階ごとの料金、期間割引を返します。

リクエスト
curl https://starproxy.shop/api/v1/products
レスポンス
{
  "currency": "USD",
  "prices_as_of": "2026-10-31",
  "products": [
    {
      "id": "unlimited",
      "unit": "day",
      "quantity": {
        "meaning": "days",
        "min": 1,
        "max": 365
      },
      "...": "..."
    },
    {
      "id": "residential",
      "unit": "gb",
      "...": "..."
    }
  ]
}

国と都市の一覧

GET/api/v1/countriesキー不要

製品ごとに対応している国と、ユーザー名オプション-city-で使う都市の値を返します。

フィールド意味
product任意unlimited、residential、isp、datacenterのいずれか。初期値はresidentialです。
リクエスト
curl "https://starproxy.shop/api/v1/countries?product=datacenter"
レスポンス
{
  "product": "datacenter",
  "countries": [
    {
      "code": "us",
      "name": "United States",
      "region": "americas",
      "datacenter": true,
      "cities": [
        {
          "name": "New York",
          "value": "new_york"
        },
        {
          "name": "Los Angeles",
          "value": "los_angeles"
        }
      ]
    }
  ]
}

見積もりを取得

POST/api/v1/quoteキー不要

残高を変えずに注文の合計額を計算します。注文時と同じ本文を送ってください。

フィールド意味
product必須unlimited、residential、isp、datacenterのいずれか。
quantity必須unlimitedは日数 (1~365)、residentialはGB (5~5,000)、ispはIP数 (1~1,000)、datacenterはIP数 (5~5,000)。
concurrency任意unlimitedのみ。200、500、1000、2000のいずれか。
bandwidth任意unlimitedのみ、単位はMbps。100、200、500、1000のいずれか。
months任意ispとdatacenterのみ。1、3、6、12のいずれか。
country任意ispとdatacenterのみ。jpのような2文字の国コード。有効な値は/countriesをご覧ください。
リクエスト
curl -X POST https://starproxy.shop/api/v1/quote \
  -H "Content-Type: application/json" \
  -d '{"product":"unlimited","quantity":30,"concurrency":1000,"bandwidth":200}'
レスポンス
{
  "product": "unlimited",
  "quantity": 30,
  "unit_price_usd": 8.41,
  "unit": "day",
  "total_usd": 252.3
}

注文を作成

POST/api/v1/ordersAPIキーが必要

合計額を残高から差し引き、注文を作成します。状態はpending (準備中) から始まり、注文の準備ができるとactiveに変わります。開通できない場合はrefundedになり、全額が残高に戻ります。残高が足りない場合は402が返ります。

フィールド意味
product必須unlimited、residential、isp、datacenterのいずれか。
quantity必須unlimitedは日数 (1~365)、residentialはGB (5~5,000)、ispはIP数 (1~1,000)、datacenterはIP数 (5~5,000)。
concurrency任意unlimitedのみ。200、500、1000、2000のいずれか。
bandwidth任意unlimitedのみ、単位はMbps。100、200、500、1000のいずれか。
months任意ispとdatacenterのみ。1、3、6、12のいずれか。
country任意ispとdatacenterのみ。jpのような2文字の国コード。有効な値は/countriesをご覧ください。
リクエスト
curl -X POST https://starproxy.shop/api/v1/orders \
  -H "Authorization: Bearer spk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"product":"unlimited","quantity":30,"concurrency":1000,"bandwidth":200}'
レスポンス
{
  "order": {
    "id": "SP-7KQ2M-X4HTD",
    "product": "unlimited",
    "quantity": 30,
    "months": null,
    "concurrency": 1000,
    "bandwidth_mbps": 200,
    "country": null,
    "unit_price_usd": 8.41,
    "total_usd": 252.3,
    "status": "pending",
    "created_at": "2026-10-31T09:12:44.120Z",
    "updated_at": "2026-10-31T09:12:44.120Z"
  },
  "balance_usd": 1047.7
}

注文一覧

GET/api/v1/ordersAPIキーが必要

新しい順に最大100件の注文を返します。

フィールド意味
status任意pending、active、refundedのいずれか。空にするとすべての状態を返します。
リクエスト
curl "https://starproxy.shop/api/v1/orders?status=pending" \
  -H "Authorization: Bearer spk_your_api_key"
レスポンス
{
  "orders": [
    {
      "id": "SP-7KQ2M-X4HTD",
      "product": "unlimited",
      "quantity": 30,
      "months": null,
      "concurrency": 1000,
      "bandwidth_mbps": 200,
      "country": null,
      "unit_price_usd": 8.41,
      "total_usd": 252.3,
      "status": "pending",
      "created_at": "2026-10-31T09:12:44.120Z",
      "updated_at": "2026-10-31T09:12:44.120Z"
    }
  ]
}

注文を取得

GET/api/v1/orders/{id}APIキーが必要

idで1件の注文を返します。開通が完了したかの確認に使えます。

フィールド意味
id必須注文id (例: SP-7KQ2M-X4HTD)。
リクエスト
curl https://starproxy.shop/api/v1/orders/SP-7KQ2M-X4HTD \
  -H "Authorization: Bearer spk_your_api_key"
レスポンス
{
  "order": {
    "id": "SP-7KQ2M-X4HTD",
    "product": "unlimited",
    "quantity": 30,
    "months": null,
    "concurrency": 1000,
    "bandwidth_mbps": 200,
    "country": null,
    "unit_price_usd": 8.41,
    "total_usd": 252.3,
    "status": "active",
    "created_at": "2026-10-31T09:12:44.120Z",
    "updated_at": "2026-10-31T09:40:02.511Z"
  }
}

プロキシユーザー名を生成

GET/api/v1/proxy-userAPIキーが必要

オプションを組み込んだプロキシユーザー名と、そのまま貼り付けられるHTTPとSOCKS5のURLを返します。sessionがなければ、リクエストごとに新しいIPになります。

フィールド意味
product任意unlimited、residential、isp、datacenterのいずれか。初期値はunlimitedです。
country任意jpのような2文字の国コード。
city任意/countriesにある都市の値 (例: tokyo)。countryが必要です。
session任意英数字1~32文字。同じsessionのリクエストは1つのIPを共有します。
ttl任意セッションのIPを維持する分数、1~60。初期値は30です。
リクエスト
curl "https://starproxy.shop/api/v1/proxy-user?product=residential&country=jp&city=tokyo&session=job42&ttl=30" \
  -H "Authorization: Bearer spk_your_api_key"
レスポンス
{
  "username": "spexample1-zone-res-cc-jp-city-tokyo-sid-job42-ttl-30",
  "password": "your_password",
  "http": "http://spexample1-zone-res-cc-jp-city-tokyo-sid-job42-ttl-30:your_password@gate.starproxy.shop:6100",
  "socks5": "socks5h://spexample1-zone-res-cc-jp-city-tokyo-sid-job42-ttl-30:your_password@gate.starproxy.shop:6200"
}

全体の例

見積もりを取得し、残高から注文して、日本のIP経由で接続するまでを1つのスクリプトで行います。

Python (requests)
import requests

API = "https://starproxy.shop/api/v1"
HEAD = {"Authorization": "Bearer spk_your_api_key"}

# 1) Check the price first
plan = {"product": "residential", "quantity": 100}
print(requests.post(f"{API}/quote", json=plan).json())

# 2) Order from your balance
r = requests.post(f"{API}/orders", json=plan, headers=HEAD)
order = r.json()["order"]
print(order["id"], order["status"])

# 3) Get a username for Japanese IPs
u = requests.get(f"{API}/proxy-user", headers=HEAD,
                 params={"product": "residential", "country": "jp"}).json()
proxies = {"http": u["http"], "https": u["http"]}
print(requests.get("https://ipinfo.io/json", proxies=proxies, timeout=30).json())
Node.js 18+
const API = "https://starproxy.shop/api/v1";
const HEAD = { Authorization: "Bearer spk_your_api_key", "Content-Type": "application/json" };

// Check the balance
const acc = await fetch(`${API}/account`, { headers: HEAD }).then((r) => r.json());
console.log(acc.balance_usd);

// Order 7 days of unlimited
const res = await fetch(`${API}/orders`, {
  method: "POST",
  headers: HEAD,
  body: JSON.stringify({ product: "unlimited", quantity: 7, concurrency: 500, bandwidth: 100 }),
});
if (res.status === 402) console.log("Top up first");
else console.log((await res.json()).order.id);

APIからの注文はダッシュボードからの注文と同じように処理され、履歴タブに表示されます。例にあるspk_your_api_keyはご自身のキーに置き換えてください。

StarProxyをコードから直接使う

ユーザー名で登録し、ダッシュボードでAPIキーを作成すれば、APIの呼び出しを始められます。