本文へスキップ
royalproxy

プロキシAPIドキュメント

RoyalProxy REST APIを使うと、ご自身のコードから残高と接続情報の取得、料金の確認、残高からの注文、プロキシユーザー名の作成ができます。

始め方

  1. 1新規登録してダッシュボードにログインします。
  2. 2「接続」を開いてAPIキーを作成します。キー全体は一度しか表示されないので、安全な場所にコピーしてください。
  3. 3キーが必要なリクエストでは、毎回Authorizationヘッダーでキーを送ってください。
  4. 4/account を呼び出してキーが使えるか確認し、/orders で注文します。

認証の仕組み

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

当社はキーのハッシュ値のみを保存します。キーを紛失した場合はダッシュボードで新しいキーを作成してください。古いキーはすぐに使えなくなります。キーをブラウザー側のコードや公開リポジトリに含めないでください。

HTTP header
Authorization: Bearer rpk_your_api_key

ベースURLと形式

ベースURL
https://royalproxy.online/api/v1
リクエストとレスポンスの本文
application/json
金額
USDの数値(例: 807.90)
時刻
ISO 8601 (UTC)

レート制限はありますか

APIキー1つにつき1分間に60回までリクエストできます。公開エンドポイントは1 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://royalproxy.online/api/v1/account \
  -H "Authorization: Bearer rpk_your_api_key"
レスポンス
{
  "username": "royal_user",
  "balance_usd": 1300,
  "proxy": {
    "host": "gate.royalproxy.online",
    "http_port": 6100,
    "socks5_port": 6200,
    "username": "rpexample1",
    "password": "your_password"
  },
  "allowed_ips": [
    "203.0.113.10"
  ]
}

製品と料金の一覧

GET/api/v1/productsキー不要

すべての製品を、上限、料金段階、割引とともに返します。料金は料金ページと同じ表に基づきます。

リクエスト
curl https://royalproxy.online/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キー不要

製品ごとに利用できる国と、プロキシユーザー名に入れられる都市の値を返します。

フィールド意味
product任意unlimited、residential、isp、datacenter のいずれか。初期値は residential。
リクエスト
curl "https://royalproxy.online/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 のみ: 2文字の国コード(例: jp)。/countries を参照してください。
リクエスト
curl -X POST https://royalproxy.online/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.97,
  "unit": "day",
  "total_usd": 269.1
}

注文する

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 のみ: 2文字の国コード(例: jp)。/countries を参照してください。
リクエスト
curl -X POST https://royalproxy.online/api/v1/orders \
  -H "Authorization: Bearer rpk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"product":"unlimited","quantity":30,"concurrency":1000,"bandwidth":200}'
レスポンス
{
  "order": {
    "id": "RP-7KQ2M-X4HTD",
    "product": "unlimited",
    "quantity": 30,
    "months": null,
    "concurrency": 1000,
    "bandwidth_mbps": 200,
    "country": null,
    "unit_price_usd": 8.97,
    "total_usd": 269.1,
    "status": "pending",
    "created_at": "2026-10-31T09:12:44.120Z",
    "updated_at": "2026-10-31T09:12:44.120Z"
  },
  "balance_usd": 1030.9
}

注文の一覧

GET/api/v1/ordersAPIキー

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

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

注文1件の取得

GET/api/v1/orders/{id}APIキー

idを指定して注文を1件返します。有効になったか確認するときなどに使います。

フィールド意味
id必須注文id(例: RP-7KQ2M-X4HTD)。
リクエスト
curl https://royalproxy.online/api/v1/orders/RP-7KQ2M-X4HTD \
  -H "Authorization: Bearer rpk_your_api_key"
レスポンス
{
  "order": {
    "id": "RP-7KQ2M-X4HTD",
    "product": "unlimited",
    "quantity": 30,
    "months": null,
    "concurrency": 1000,
    "bandwidth_mbps": 200,
    "country": null,
    "unit_price_usd": 8.97,
    "total_usd": 269.1,
    "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任意2文字の国コード(例: jp)。
city任意/countries の都市の値(例: tokyo)。country の指定が必要です。
session任意1~32文字の英数字。同じ session のリクエストは同じIPを使います。
ttl任意セッションのIPを維持する分数、1~60。初期値は30。
リクエスト
curl "https://royalproxy.online/api/v1/proxy-user?product=residential&country=jp&city=tokyo&session=job42&ttl=30" \
  -H "Authorization: Bearer rpk_your_api_key"
レスポンス
{
  "username": "rpexample1-zone-res-cc-jp-city-tokyo-sid-job42-ttl-30",
  "password": "your_password",
  "http": "http://rpexample1-zone-res-cc-jp-city-tokyo-sid-job42-ttl-30:your_password@gate.royalproxy.online:6100",
  "socks5": "socks5h://rpexample1-zone-res-cc-jp-city-tokyo-sid-job42-ttl-30:your_password@gate.royalproxy.online:6200"
}

コード例

以下の例では、料金を確認し、残高から注文し、日本のIPで接続します。

Python (requests)
import requests

API = "https://royalproxy.online/api/v1"
HEAD = {"Authorization": "Bearer rpk_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://royalproxy.online/api/v1";
const HEAD = { Authorization: "Bearer rpk_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で行った注文はダッシュボードからの注文と同じで、履歴に表示されます。rpk_your_api_key はご自身のキーに置き換えてください。

RoyalProxyをご自身のシステムにつなぐ

アカウントを作成し、ダッシュボードでAPIキーを発行してください。