BuyProxy logo
Log inSign up

SDKs

Official SDKs

BuyProxy publishes an open-source Go SDK. It wraps the same REST API with typed requests and responses, automatic retries, typed errors and helpers for Go's HTTP client, so generating a proxy, topping up bandwidth or running a reseller business is a few lines of Go. It's MIT-licensed. From any other language, call the REST API directly, for example with curl.

Choose your language

Before you start

A BuyProxy account has two kinds of API key. Both go in the X-API-Key header, and every SDK sends it for you.

KeyLooks likeCreate itUnlocks
Personalbp_key_…Dashboard → API keysYour own bandwidth: account, balances, plans, generating proxies, top-ups, payments
Resellerbp_live_…Dashboard → Reseller → API keys (Business plan or higher)Your customers: create and fund sub-accounts, the reseller pool, generating on their behalf, payments

Keys are shown once when you create them — store them in a secrets manager or environment variable, never in source control or in a browser. Revoke a key from the same page at any time. Requests with a suspended account's key return 403, and a reseller key stops working if the account drops below the Business plan.

The catalog (products) and account creation (signup, verify otp) work without a key.

The Go SDK reads BUYPROXY_API_KEY from the environment, so in most programs you never pass the key at all:

bash
export BUYPROXY_API_KEY=bp_key_xxxxxxxxxxxxxxxxxxxxxxxx

Product keys

Every top-up and allocation call takes a product key. Live prices come from the catalog call, so you never hard-code a rate.

KeyProductMin orderBest for
residentialCore Residential6 GBEveryday rotating residential IPs with country targeting
premiumPremium Residential2 GBState, city and ASN targeting, and sticky sessions with a length you set
ispISP Rotating4 GBRotating ISP-registered IPs on datacenter infrastructure (currently US only)
mobileMobile Proxies2 GBReal carrier IPs for mobile-only targets
ipv4Datacenter IPv46 GBWorkloads compatible with datacenter IPv4 network addresses (currently US only)
ipv6IPv6 Proxies18 GBWorkloads that support IPv6 addressing and require an IPv6-compatible connection (currently US only)

Min order is the fewest whole GB that reach the $5 minimum top-up at each product's rate. Pay-as-you-go top-ups of 100 GB or more include a 10% volume bonus, and a single order is capped at 10,000 GB.

Generating proxies

Generation is free and instant — bandwidth is only consumed when traffic flows through a proxy. Every parameter is optional; omit one and the API's default applies. (Names follow each language's conventions, e.g. stickyMinutes / sticky_minutes / StickyMinutes.)

ParameterTypeWhat it does
protocol"http" \"socks5"Proxy protocol. Default http (which also carries HTTPS). Check plan.generate.protocols for what a product supports
countinteger 1–1000How many proxy lines to return. Default 1
countryISO 3166-1 alpha-2e.g. US, DE, JP. Omit for a worldwide IP
statestringState or region, where the product supports it
citystringCity, where the product supports it
ispstringNetwork / carrier, where the product supports it
stickyMinutesintegerSticky session: on Premium Residential it sets the length (3 minutes to 24 hours), and on Core Residential it turns sticky on. Omit for a fresh IP on every request. The maximum is plan.generate.maxStickyMinutes; 0 there means the product has no sticky sessions

Each returned line is username:password@host:port with your targeting encoded in the username. Lines are on-demand and not persistent — generate fresh ones when you need them instead of storing them, because credentials can rotate when the pool moves.

Retries & rate limits

Every SDK retries for you, with the same rules:

  • Rate limits (`429`) are always retried, waiting for the Retry-After the API sends (capped at 30 s) or an exponential back-off with jitter.
  • Reads (GET) are also retried on 502/503/504 and on network failures.
  • Writes are not retried on server errors — a repeated checkout or allocation must never double-charge — unless you attach an idempotency key (see below), which makes the retry provably safe.
  • The default is 2 retries; set it to 0 to turn retries off. After the last attempt you get the typed error.

The API allows 60 requests per minute per key. Batch with count (up to 1000 lines per call) rather than looping over single-proxy calls.

Idempotency

Allocating bandwidth to a customer moves real GB, so it accepts an idempotency key. Send the same key twice and the second call moves nothing and returns alreadyApplied: true with the same result — safe to retry after a timeout or crash.

Use a value you can derive again from your own data (an order id, an invoice number), not a random value created per attempt. Keys are scoped to your account and may be up to 200 characters.

At a glance

LanguagePackageRuntimeDependenciesCallsProxy helpers
Go…/buyproxy-go1.21+nonecontext*http.Client, env, curl

The Go SDK's source is at github.com/DishantSinghDev2/buyproxy-go. Building something bigger? Start at the developer hub.

Was this page helpful?