Code Integration Overview
📋 Access Notes
Code integration uses the proxy connection details generated in the dashboard. Before writing code, make sure you have:
- Host
- Port
- Username
- Password
If IP whitelist is enabled, add the public IP of the server or device running your code to the whitelist first. Otherwise the proxy connection will be rejected.
Username Parameters
The username in your code can be the basic account name, or it can include location, session, and rotation parameters.
test
test-country-us
test_1-country-us-sessiontime-10
test-country-us-f-1Common rules:
countrytargets a country-level exit, such astest-country-us.sessionidis written after the underscore in the account name. Intest_1, thesessionidis1. It is not a-sessionid-xxxparameter.- Different
sessionidvalues are independent sessions and map to different IPs. The maximum length is 32 characters. sessiontimesets how long the session should be kept. The unit is minutes, and the supported range is 1-120 minutes.-f-1gives every request a new IP. It is suitable for scraping, bulk access, and other stateless tasks.
WARNING
Rotating Residential supports country, state, and city. Rotating Datacenter and Mobile IP currently support country only, and do not support state-level or city-level targeting.
Also, Rotating Datacenter and Mobile IP account names need a _dc or _mobile marker respectively, placed before the sessionid — e.g. test_dc-country-us, test_mobile_1-country-us-sessiontime-10. Rotating Residential needs no marker. The examples above are shown for Rotating Residential.
Session and Rotation Strategy
| Scenario | Recommended Username |
|---|---|
| Default rotating exit | test |
| US exit | test-country-us |
| Keep one workflow for 10 minutes | test_1-country-us-sessiontime-10 |
| Run two independent exits | test_1-country-us-sessiontime-10, test_2-country-us-sessiontime-10 |
| New IP for every request | test-country-us-f-1 |
For login, registration, checkout, form submission, and other continuous workflows, use a fixed sessionid and sessiontime. For scraping, bulk access, API checks, and other tasks that do not need login-state continuity, use -f-1.
Test the Request
Before putting the proxy into business code, use curl to verify that the connection works.
SOCKS5 proxy:
curl -x socks5h://username:password@proxy-domain:port http://ip123.in/ip.jsonHTTP proxy:
curl -x http://username:password@proxy-domain:port http://ip123.in/ip.jsonIf the response returns JSON with the exit IP, country, and location details, the proxy connection is working.
🔌 Code Integration Examples
Select your programming language to view detailed examples: