Skip to content
royalproxy
Get started

Proxy API reference

What the dashboard does with orders can also be done from code. The API returns your balance and proxy login, prices and countries, takes orders paid from the balance and builds usernames with options.

Getting started

  1. 1Create an account and sign in to the dashboard.
  2. 2In Connect, create an API key. It is shown in full only once, so store it right away.
  3. 3Put the key in the Authorization header of each request that needs one.
  4. 4Call /account to confirm the key works, then use /orders to buy.

Authentication

Endpoints tied to your account (account, orders, proxy-user) need an API key, sent as a Bearer token in the Authorization header. Prices, countries and quotes are public and work without a key.

Only a hash of the key is stored. If you lose it, make a new key in the dashboard, and the old one stops working immediately. Never put the key in browser code or a public repository.

HTTP header
Authorization: Bearer rpk_your_api_key

Base URL and data format

Base URL
https://royalproxy.online/api/v1
Request and response body
application/json
Money
Amounts in USD as numbers, e.g. 807.90
Time
ISO 8601 (UTC)

Rate limits

An API key may send 60 requests a minute, and public endpoints allow 60 a minute per IP. Going over returns HTTP 429. Wait one minute and retry.

Error responses

An error comes with an HTTP status code and a JSON body holding a short code and a message.

Example
{
  "error": {
    "code": "insufficient_balance",
    "message": "Your balance is too low for this order. Top up in the dashboard."
  }
}
code
bad_requestHTTP 400A required value is missing, or a value is not valid for this product.
unauthorizedHTTP 401No API key was sent, or the key is not valid.
insufficient_balanceHTTP 402The order costs more than your balance. You were not charged.
not_foundHTTP 404Your account has no order with this id.
rate_limitedHTTP 429The per minute request limit was reached.
server_errorHTTP 500Something failed on our side. You were not charged.

Endpoints

Account details

GET/api/v1/accountAPI key

Your balance, proxy host and ports, proxy username and password, and allowed IPs.

Request
curl https://royalproxy.online/api/v1/account \
  -H "Authorization: Bearer rpk_your_api_key"
Response
{
  "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"
  ]
}

Products and prices

GET/api/v1/productsNo key needed

All products with their limits, price steps and discounts, read from the same table as the pricing page.

Request
curl https://royalproxy.online/api/v1/products
Response
{
  "currency": "USD",
  "prices_as_of": "2026-11-28",
  "products": [
    {
      "id": "unlimited",
      "unit": "day",
      "quantity": {
        "meaning": "days",
        "min": 1,
        "max": 365
      },
      "...": "..."
    },
    {
      "id": "residential",
      "unit": "gb",
      "...": "..."
    }
  ]
}

Countries and cities

GET/api/v1/countriesNo key needed

Countries available for one product, plus the city values that go into the proxy username.

FieldMeaning
productOptionalOne of residential, unlimited, isp, datacenter. Defaults to residential.
Request
curl "https://royalproxy.online/api/v1/countries?product=datacenter"
Response
{
  "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"
        }
      ]
    }
  ]
}

Quote an order

POST/api/v1/quoteNo key needed

Works out an order total and charges nothing. The body is the same as for placing an order.

FieldMeaning
productRequiredOne of residential, unlimited, isp, datacenter.
quantityRequiredGB for residential (5~5,000), days for unlimited (1~365), IPs for isp (1~1,000) and for datacenter (5~5,000).
concurrencyOptionalOnly for unlimited: 200, 500, 1000 or 2000.
bandwidthOptionalOnly for unlimited, in Mbps: 100, 200, 500 or 1000.
monthsOptionalOnly for isp and datacenter: 1, 3, 6 or 12.
countryOptionalOnly for isp and datacenter: a two letter code such as jp. Valid codes come from /countries.
Request
curl -X POST https://royalproxy.online/api/v1/quote \
  -H "Content-Type: application/json" \
  -d '{"product":"unlimited","quantity":30,"concurrency":1000,"bandwidth":200}'
Response
{
  "product": "unlimited",
  "quantity": 30,
  "unit_price_usd": 6.97,
  "unit": "day",
  "total_usd": 209.1
}

Create an order

POST/api/v1/ordersAPI key

Charges the total to your balance and creates the order. It starts as pending (activating) and turns active when ready. If activation fails, it becomes refunded and the whole amount returns to the balance. A balance that is too low returns 402.

FieldMeaning
productRequiredOne of residential, unlimited, isp, datacenter.
quantityRequiredGB for residential (5~5,000), days for unlimited (1~365), IPs for isp (1~1,000) and for datacenter (5~5,000).
concurrencyOptionalOnly for unlimited: 200, 500, 1000 or 2000.
bandwidthOptionalOnly for unlimited, in Mbps: 100, 200, 500 or 1000.
monthsOptionalOnly for isp and datacenter: 1, 3, 6 or 12.
countryOptionalOnly for isp and datacenter: a two letter code such as jp. Valid codes come from /countries.
Request
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}'
Response
{
  "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
}

Your orders

GET/api/v1/ordersAPI key

The latest 100 orders on your account, newest first.

FieldMeaning
statusOptionalpending, active or refunded. Omit it to list all of them.
Request
curl "https://royalproxy.online/api/v1/orders?status=pending" \
  -H "Authorization: Bearer rpk_your_api_key"
Response
{
  "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"
    }
  ]
}

One order

GET/api/v1/orders/{id}API key

A single order by id, handy for checking whether it is active yet.

FieldMeaning
idRequiredOrder id, such as RP-7KQ2M-X4HTD.
Request
curl https://royalproxy.online/api/v1/orders/RP-7KQ2M-X4HTD \
  -H "Authorization: Bearer rpk_your_api_key"
Response
{
  "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"
  }
}

Proxy username builder

GET/api/v1/proxy-userAPI key

Builds a proxy username from your options and returns HTTP and SOCKS5 proxy URLs ready to use. Leave session empty and the IP rotates per request.

FieldMeaning
productOptionalOne of residential, unlimited, isp, datacenter. Defaults to unlimited.
countryOptionalTwo letter country code, such as jp.
cityOptionalA city value from /countries, such as tokyo. Requires country.
sessionOptional1~32 letters or digits. Requests sharing a session keep one IP.
ttlOptionalMinutes the session keeps its IP, 1~60. Defaults to 30.
Request
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"
Response
{
  "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"
}

Complete examples

Quote a price, buy from the balance and send a request through a Japanese 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 orders are the same as dashboard orders and show up in History. Swap rpk_your_api_key for your real key.

Use RoyalProxy from your own code

Sign up, then create an API key in the dashboard.