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 and you keep the same IP. 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 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

Core Residential supports sticky sessions, but not a chosen duration. The line carries a session ID and takes no duration, so sending stickyMinutes: 15 turns sticky on without setting 15 minutes: the address holds for as long as the line keeps being used. The response includes a note saying so. If you need a session of a specific length, use Premium Residential.

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

Keeping and ending a session

Hold on to the exact line you generated for as long as you need that IP. 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?