BuyProxy API
BuyProxy API: introduction
The base URL for every endpoint below is:
https://www.buyproxy.org/v1This is the same self-service API that powers your dashboard, exposed for programmatic use. Sign up, verify your email, create a key, and you can add money to your wallet, buy bandwidth and generate proxies without ever opening a browser again.
Authentication
Every request except GET /v1/products needs an X-API-Key header. Create a key from Personal API keys once you have an account — see Authentication for the full signup-to-key flow, including the two calls needed to create an account by API alone.
curl https://www.buyproxy.org/v1/account \
-H "X-API-Key: bp_key_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# {"email":"you@example.com","name":"you","plan":"free","planExpiresAt":null,"balanceGb":4.2,"createdAt":"..."}Prefer a typed client? The official Go SDK wraps the calls below (the wallet calls need v1.1.0 or later).
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /v1/products | Every product, its productKey, smallest order (minGb: 1 GB, 2 GB for Premium Residential) and live per-GB price, plus the $5 deposit minimum (minTopupCents). No key needed. |
| GET | /v1/account | Your email, plan and plan expiry. |
| GET | /v1/balances | Spendable GB per product, including GB still being added after a payment. |
| GET | /v1/plans | Your active plans, data left on each, and what each plan's generate call accepts. |
| POST | /v1/plans/{planId}/generate | Generate one or more proxy connection lines against a plan. |
| GET | /v1/geo/{kind} | The countries, states, cities or ASNs you can target, as JSON or CSV. Add ?product= (for example ?product=isp) to see another product's list. |
| POST | /v1/topup/card | Start a plan subscription by card (kind "plan"). Returns a payment link. Bandwidth is bought from your wallet instead: the old bandwidth body (kind "topup") returns 410. |
| GET | /v1/wallet | Your wallet balance (in cents) and recent wallet activity. |
| POST | /v1/wallet/topup | Add money to your wallet by card or crypto: $5 minimum, $2,000 maximum per deposit. Returns a payment link. This is the only way to pay for bandwidth. |
| POST | /v1/wallet/purchase | Buy bandwidth (any product), Scraper API credit or a dedicated rental from your wallet balance. Send an Idempotency-Key header so a retry is charged once. For a dedicated rental, check the price in the dashboard first. |
| GET | /v1/transactions | Your payment history. |
| GET | /v1/transactions/{id} | One payment's status. Poll this after a wallet top-up until it's succeeded. |
A typical flow
# 1. Pick a product and see its price
curl https://www.buyproxy.org/v1/products
# 2. Add $20 to your wallet, then open payUrl to pay (use "method":"crypto" for a crypto invoice)
curl -X POST https://www.buyproxy.org/v1/wallet/topup \
-H "X-API-Key: $KEY" -H "Content-Type: application/json" \
-d '{"method":"card","amountCents":2000}'
# {"payUrl":"https://...","transactionId":"st_..."}
# 3. Wait for the payment to settle: the money is in your wallet once it's succeeded
curl https://www.buyproxy.org/v1/transactions/st_... -H "X-API-Key: $KEY"
# {"id":"st_...","kind":"wallet","status":"succeeded",...}
# 4. Buy 10 GB of Core Residential from the wallet. It is yours straight away.
# Reuse the same Idempotency-Key if you retry, and you are charged once.
curl -X POST https://www.buyproxy.org/v1/wallet/purchase \
-H "X-API-Key: $KEY" -H "Content-Type: application/json" \
-H "Idempotency-Key: order-1042" \
-d '{"kind":"gb","productKey":"residential","gb":10}'
# {"ok":true,"summary":"10 GB Core Residential","amountCents":990,"balanceCents":1010}
# 5. Find the plan and generate a US proxy
curl https://www.buyproxy.org/v1/balances -H "X-API-Key: $KEY"
curl -X POST https://www.buyproxy.org/v1/plans/PLAN_ID/generate \
-H "X-API-Key: $KEY" -H "Content-Type: application/json" \
-d '{"country":"US","count":5}'
# {"lines":["user-country-us:pass@gw.buyproxy.org:6969", ...]}
# 6. Send a request through one of the lines
curl -x "http://user-country-us:pass@gw.buyproxy.org:6969" https://api.ipify.orgA generate response can also carry notes, a list of plain-language remarks about the lines, for example that stickyMinutes turned sticky on without setting a length on Core Residential. It's left out when there is nothing to say.
The full machine-readable spec is at /openapi.yaml.
Reselling to your own customers instead of using proxies yourself? See the Reseller API — a separate key type for managing sub-customers.
Errors
Every error response is {"error": "message"} with one of these status codes:
400Malformed or invalid request body.
401Missing or invalid X-API-Key.
402The plan has no bandwidth left, or the wallet doesn't cover a purchase (the body carries shortfallCents).
403The account behind this key is suspended.
404Plan or transaction not found.
409This Idempotency-Key is in use. Either the first purchase with it is still being processed (repeat later with the same key to get its result), or it already ended without a purchase (the body says so; send a new key to try again).
410A retired call, such as the old per-product top-ups, including POST /v1/topup/card with a bandwidth body (kind: "topup"). The message names the wallet call to use.
422This Idempotency-Key was already used with a different request body. Use a new key for a new purchase.
429Rate limit exceeded. Wait the number of seconds in the Retry-After header (a full minute if the response has none), then retry (see Rate limits).
502A temporary error on our side; reads are safe to retry. On a purchase, a 502 with a JSON error is final: delivery failed and the amount went back to your wallet (unless the message says the refund needs checking). Send a new key if you still want to buy.
503BuyProxy, or one of its payment methods, is temporarily unavailable. On a purchase, a 503 means nothing was delivered. Usually your wallet wasn't charged either, so repeat the purchase with the same Idempotency-Key. If the message says the money is back in your wallet, that key is used up: send a new one to buy again. If it says the purchase couldn't be confirmed, wait about 10 minutes, then repeat it with the same key (until then that key gets a 409).
Something wrong or missing on this page?
Suggest edits