BuyProxy logo
Log inSign up

Concepts

Sticky sessions

A sticky session keeps your traffic on the same IP instead of rotating on every request. You switch it on when you generate lines: send stickyMinutesand each returned line is its own session, identified by a session ID inside the line's username. Reuse the same line to stay in that session. Generate a new line and you get a new session.

Setting session duration

On Premium Residentialyou choose how long the session lasts, from 3 minutes to 24 hours, and the IP stays the same for that length. The duration is written into the username so it can't be ignored:

curl -X POST https://www.buyproxy.org/v1/plans/PLAN_ID/generate   -H "X-API-Key: YOUR_KEY" -H "Content-Type: application/json"   -d '{ "count": 1, "country": "US", "stickyMinutes": 15 }'

# returned line (username shortened):
# premium.buyproxy.org:10000:USER-type-residential-country-us-session-abc123-lifetime-15:PASSWORD

Each plan lists its own limits in generate on GET /v1/plans: maxStickyMinutes is the longest session and 0 means the product has no sticky sessions at all. A value outside the allowed range returns a 400 that states the range.

Core Residential

Sticky is on or off on Core Residential, with no duration you can choose. The line carries a session ID and takes no duration, so sending stickyMinutes: 15 turns sticky on without setting 15 minutes. It usually keeps the same IP for around 10 minutes, and a longer session can move to another IP. The response includes a note saying so. For one IP for a set time, use Premium Residential, where you choose the length from 3 minutes to 24 hours.

# Core Residential sticky line (no duration in the username):
# gw.buyproxy.org:6969:USER-country-us-session-655a1fee:PASSWORD

Keeping and ending a session

Keep using the exact line you generated for the rest of the session. When a session ends, the line may no longer hold the same address, so generate a new line for a fresh session rather than assuming the old one is pinned. Design your retry logic for an IP that changes.

Was this page helpful?