Quick start

From an API key to your first request through the gateway.

You need an account in the dashboard with data or credit on it. Under Purchase, choose a monthly subscription (a fixed amount of GB every month) or a pay-as-you-go package, or add credit by card or PayPal to buy packages over the API.

1. Create an API key

In the dashboard, open API keys and create a key. The full key (prx_live_…) is shown once, so store it right away. Send it in the X-API-Key header:

export BOXAFOX_KEY="prx_live_…"

curl https://api.boxafox.com/v1/me -H "X-API-Key: $BOXAFOX_KEY"

The answer is your account: credit, the data balance of each network, your limits and the gateway address.

2. Buy data

Prices and limits per product are public:

curl https://api.boxafox.com/v1/products

GET /v1/pricing returns the same products with their package sizes: for each size the monthly plan price and the pay-as-you-go price (20% more), in US cents.

Price a cart first if you want to see the total, then buy. gb must be one of the product's package_sizes_gb (1, 5, 20, 50, 100, 200, 500 or 1000). Buying takes the amount from your credit and needs an Idempotency-Key header, so a retry never charges twice:

curl -X POST https://api.boxafox.com/v1/checkout \
  -H "X-API-Key: $BOXAFOX_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{ "items": [{ "product_code": "residential_gb", "gb": 5 }] }'

The answer is 201 with the order. Its status moves from paid to active once the data is on your balance; check it with GET /v1/orders/{id} or GET /v1/residential/summary.

3. Get proxy strings

curl "https://api.boxafox.com/v1/residential/list?count=3&country=de&session=sticky&ttl=10m" \
  -H "X-API-Key: $BOXAFOX_KEY"

data is a list of ready-to-use strings in the form host:port:username:password. Without proxy_user_id they use your default proxy user. Add format=http to get http://username:password@host:port instead.

You can also build the string yourself: see Connection strings.

4. Send a request through the gateway

curl -x "http://USERNAME_net_res_c_de:PASSWORD@gw.boxafox.com:8000" https://ipinfo.io/json

Every request without a session gets a new IP. To keep one IP for a while, add a session: Sticky sessions.

Next

  • Targeting: country, state, city, ASN, ZIP and OS.
  • Errors: what the API and the gateway answer when something is wrong.
  • Code examples: the same steps in Python and Node.js.

On this page