Skip to content

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.

txt
test
test-country-us
test_1-country-us-sessiontime-10
test-country-us-f-1

Common rules:

  • country targets a country-level exit, such as test-country-us.
  • sessionid is written after the underscore in the account name. In test_1, the sessionid is 1. It is not a -sessionid-xxx parameter.
  • Different sessionid values are independent sessions and map to different IPs. The maximum length is 32 characters.
  • sessiontime sets how long the session should be kept. The unit is minutes, and the supported range is 1-120 minutes.
  • -f-1 gives 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

ScenarioRecommended Username
Default rotating exittest
US exittest-country-us
Keep one workflow for 10 minutestest_1-country-us-sessiontime-10
Run two independent exitstest_1-country-us-sessiontime-10, test_2-country-us-sessiontime-10
New IP for every requesttest-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:

bash
curl -x socks5h://username:password@proxy-domain:port http://ip123.in/ip.json

HTTP proxy:

bash
curl -x http://username:password@proxy-domain:port http://ip123.in/ip.json

If 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:

  • Python - Python proxy integration example
  • Go - Go proxy integration example
  • Java - Java proxy integration example
  • PHP - PHP proxy integration example

Professional IP Proxy Service Platform