はじめに
- 1アカウントを作成し、ダッシュボードにログインします。
- 2「接続」でAPIキーを作成します。全体が表示されるのは一度だけなので、すぐに保存してください。
- 3キーが必要な各リクエストで、キーをAuthorizationヘッダーに入れます。
- 4/account を呼び出してキーが使えることを確認し、/orders で購入します。
認証
アカウントに関わるエンドポイント(account、orders、proxy-user)にはAPIキーが必要で、AuthorizationヘッダーにBearerトークンとして送ります。料金、国、見積もりは公開されており、キーなしで使えます。
保存するのはキーのハッシュだけです。キーをなくした場合はダッシュボードで新しいキーを作ってください。古いキーはすぐに使えなくなります。キーをブラウザのコードや公開リポジトリに書かないでください。
Authorization: Bearer rpk_your_api_key
ベースURLとデータ形式
- ベースURL
- https://royalproxy.online/api/v1
- リクエストとレスポンスの本文
- application/json
- 金額
- 金額はUSDの数値(例: 807.90)
- 時刻
- ISO 8601 (UTC)
レート制限
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."
}
}| HTTP | code | 意味 |
|---|---|---|
| bad_requestHTTP 400必須の値がないか、値がこの製品では有効ではありません。 | 必須の値がないか、値がこの製品では有効ではありません。 | |
| unauthorizedHTTP 401APIキーが送られていないか、キーが有効ではありません。 | APIキーが送られていないか、キーが有効ではありません。 | |
| insufficient_balanceHTTP 402注文の金額が残高を上回っています。請求は行われていません。 | 注文の金額が残高を上回っています。請求は行われていません。 | |
| not_foundHTTP 404このidの注文はお客様のアカウントにありません。 | このidの注文はお客様のアカウントにありません。 | |
| rate_limitedHTTP 4291分あたりのリクエスト上限に達しました。 | 1分あたりのリクエスト上限に達しました。 | |
| 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-11-28",
"products": [
{
"id": "unlimited",
"unit": "day",
"quantity": {
"meaning": "days",
"min": 1,
"max": 365
},
"...": "..."
},
{
"id": "residential",
"unit": "gb",
"...": "..."
}
]
}国と都市
GET/api/v1/countriesキー不要
1つの製品で使える国と、プロキシユーザー名に入れる都市の値。
| フィールド | 型 | 意味 |
|---|---|---|
product任意 | string | residential、unlimited、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必須 | string | residential、unlimited、isp、datacenter のいずれか。 |
quantity必須 | integer | residentialはGB(5~5,000)、unlimitedは日数(1~365)、ispはIP数(1~1,000)、datacenterもIP数(5~5,000)。 |
concurrency任意 | integer | unlimited のみ: 200、500、1000、2000。 |
bandwidth任意 | integer | unlimited のみ、Mbps単位: 100、200、500、1000。 |
months任意 | integer | isp と datacenter のみ: 1、3、6、12。 |
country任意 | string | isp と datacenter のみ: jp のような2文字のコード。有効なコードは /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": 6.97,
"unit": "day",
"total_usd": 209.1
}注文の作成
POST/api/v1/ordersAPIキー
合計額を残高から差し引き、注文を作成します。状態は pending(開通中)から始まり、準備ができると active になります。開通に失敗すると refunded になり、全額が残高に戻ります。残高が足りない場合は402が返ります。
| フィールド | 型 | 意味 |
|---|---|---|
product必須 | string | residential、unlimited、isp、datacenter のいずれか。 |
quantity必須 | integer | residentialはGB(5~5,000)、unlimitedは日数(1~365)、ispはIP数(1~1,000)、datacenterもIP数(5~5,000)。 |
concurrency任意 | integer | unlimited のみ: 200、500、1000、2000。 |
bandwidth任意 | integer | unlimited のみ、Mbps単位: 100、200、500、1000。 |
months任意 | integer | isp と datacenter のみ: 1、3、6、12。 |
country任意 | string | isp と datacenter のみ: jp のような2文字のコード。有効なコードは /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": 6.97,
"total_usd": 209.1,
"status": "pending",
"created_at": "2026-10-31T09:12:44.120Z",
"updated_at": "2026-10-31T09:12:44.120Z"
},
"balance_usd": 1090.9
}注文の一覧
GET/api/v1/ordersAPIキー
アカウントの最新100件の注文を、新しい順に返します。
| フィールド | 型 | 意味 |
|---|---|---|
status任意 | string | 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": 6.97,
"total_usd": 209.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必須 | string | 注文の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": 6.97,
"total_usd": 209.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任意 | string | residential、unlimited、isp、datacenter のいずれか。省略時は unlimited。 |
country任意 | string | 2文字の国コード(例: jp)。 |
city任意 | string | /countries で取得した都市の値(例: tokyo)。country が必要です。 |
session任意 | string | 1~32文字の英字か数字。同じ session のリクエストは1つのIPを維持します。 |
ttl任意 | integer | セッションが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を通してリクエストを送ります。
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())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 は実際のキーに置き換えてください。