Read remaining GB by product with the Proxare API, estimate the next browser batch from a pilot, and pause the job if its traffic budget is too small.
Your browser agent has 60 regional product pages to check. Its proxy account has 2 GB left. Is that enough? Not necessarily: if most of those bytes belong to a different provider, the selected pool can run dry halfway through the job. Use the remaining GB for the product the browser will actually use, not the account total.
Read the product balance with one API call
Use a Proxare API key with the read permission, stored in your runner's secret settings as PROXARE_API_KEY. The following shell example uses curl and jq. Set PRODUCT to the ID your runner uses. It prints a single number, not the full account response:
PRODUCT=geonode
curl -fsS https://www.proxare.com/v1/subaccounts/ \
-H "Authorization: Bearer $PROXARE_API_KEY" |
jq -en --arg id "$PRODUCT" 'input.subaccounts[]
| select(.id == $id and (.error | not))
| .leftGb | numbers'
A printed 0 means an empty pool. No matching product, a failed request or a missing reading means unknown. In a runner, require a successful command and a numeric reading before starting the browser. If you prefer MCP, ask my_account for the named product's leftGb, not totalLeftGb. Both interfaces are in the Proxare API reference.
Turn a short pilot into a start-or-pause decision
Here's a worked example using illustrative readings. With other workers stopped, run ten representative page checks through the chosen pool. Include the images and redirects your real test needs. If the meter hasn't updated, wait for a fresh reading rather than counting an unchanged balance as free traffic.
- Measure: 0.84 GB before the pilot minus 0.79 GB after it = 0.05 GB for ten checks.
- Project: 60 more checks at 0.005 GB each would use about 0.30 GB.
- Set a margin: with 25% headroom, require at least 0.375 GB before queuing the batch. This margin is your decision, not a provider guarantee.
With 0.79 GB left in that pool, start. With 0.32 GB, pause or send a smaller batch. With an unreadable balance, report “balance unknown” rather than asking the operator to buy more. A failed lookup and a shortfall need different fixes.
When another worker uses the same pack
A balance read is a snapshot, not a reservation. Two workers can each see 0.40 GB, approve themselves for 0.375 GB and exhaust the pack together. Let one scheduler allocate the next batch, then check again between batches. Keep extra room for image-heavy pages or retries; if the test requires full-page screenshots, stripping images to save data would invalidate the test.
When the pool really is short, report the product ID, measured GB left and estimated GB needed. A person can then review a fresh proxy quote. The balance check itself neither orders traffic nor charges a wallet.