Box’a’Fox

Quick start

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

You need an account in the dashboard with credit on it. Adding credit is done in the dashboard under Billing.

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

Price a cart first if you want to see the total, then buy. 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