Proxy API
The proxy API provides everything you need to integrate proxies into your application or automation pipeline. You'll find detailed technical documentation for each proxy type, along with ready-to-use code samples, integration walkthroughs, and recommended third-party tools.
Whether you're just getting started or building a production-scale scraper, this guide walks you through every step — from your first request to advanced session management and IP rotation.
Need support? Reach out at [email protected] or open a ticket — we're here to help.
The 2prx proxy network offers real user IPs from 220+ countries and regions, perfect for web scraping, data collection, and bypassing geo-restrictions. Our residential proxies use IPs assigned by ISPs and tied to real devices at city or country level — making them ideal for simulating human behavior and avoiding blocks.
All 2prx proxies are fully equipped, auto-rotating, and easy to deploy. This API documentation covers everything you need to work with both residential and rotating proxy integrations.
API Methods
The 2prx API offers a set of simple, reliable methods to manage your proxy configurations and retrieve information about available proxy resources.
Below is a list of supported endpoints and their functionality:
- Account Management:
-
Available Locations:
-
Whitelist Management:
- generate_white_list_connections - generate IP addresses for secure connections
Account
This method returns key details about your 2prx account, including current status, total used traffic, and your list of whitelisted IP addresses.
API Endpoint: https://api.2prx.com/proxy?key=<API_KEY>
Method: GET
Request Parameters:
Parameter | Required | Description |
---|---|---|
key |
Yes | Your API key |
Request example:
https://api.2prx.com/proxy?key=1abc234de56fab7c89012d34e56fa7b8
Response example:
{
"status": "OK",
"data": {
"username": "u2135p19s84m750n5",
"status": 1,
"total_flow": 1000,
"use_flow": 925.679,
"last_flow": 925.679,
"ip_white": [
"203.0.113.42"
]
}
}
Balance
This method allows you to retrieve the current account balance.
API Endpoint: https://api.2prx.com/proxy/balance?key=<API_KEY>
Method: GET
Request Parameters:
Parameter | Required | Description |
---|---|---|
key |
Yes | Your API key |
Request example:
https://api.2prx.com/proxy/balance?key=1abc234de56fab7c89012d34e56fa7b8
Response example:
{
"status": "OK",
"balance": 1000
}
Countries
This method retrieves a list of countries where 2prx proxies are available.
API Endpoint: https://api.2prx.com/proxy/locations/countries?key=<API_KEY>&page=0
Method: GET
Request Parameters:
Parameter | Required | Description |
---|---|---|
key |
Yes | Your API key |
page |
No | Page number |
Request example:
https://api.2prx.com/proxy/locations/countries?key=1abc234de56fab7c89012d34e56fa7b8&page=0
Response example:
{
"status": "OK",
"data": [
{
"id": 231,
"code": "ae",
"title": "United Arab Emirates"
},
{
"id": 232,
"code": "gb",
"title": "United Kingdom"
},
{
"id": 233,
"code": "us",
"title": "United States"
},
...
],
"total": 208
}
Regions
This method retrieves a list of regions where 2prx proxies are available, along with their corresponding countries.
API Endpoint: https://api.2prx.com/proxy/locations/regions?key=<API_KEY>&page=0
Method: GET
Request Parameters:
Parameter | Required | Description |
---|---|---|
key |
Yes | Your API key |
page |
No | Page number |
Request example:
https://api.2prx.com/proxy/locations/regions?key=1abc234de56fab7c89012d34e56fa7b8&page=0
Response example:
{
"status": "OK",
"data": [
{
"id": 3391,
"countryId": 231,
"region": "dubai"
},
{
"id": 2336,
"countryId": 232,
"region": "england"
},
{
"id": 1450,
"countryId": 233,
"region": "colorado"
},
...
],
"total": 967
}
Cities
This method retrieves a list of cities where 2prx proxies are available, along with their corresponding regions and country codes.
API Endpoint: https://api.2prx.com/proxy/locations/cities?key=<API_KEY>&page=0
Method: GET
Request Parameters:
Parameter | Required | Description |
---|---|---|
key |
Yes | Your API key |
page |
No | Page number |
Request example:
https://api.2prx.com/proxy/locations/cities?key=1abc234de56fab7c89012d34e56fa7b8&page=0
Response example:
{
"status": "OK",
"data": [
{
"id": 39364,
"city": "amiens",
"regionId": 4828,
"region": "hautsdefrance",
"countryCode": "fr"
},
{
"id": 63141,
"city": "amman",
"regionId": 965,
"region": "amman",
"countryCode": "jo"
},
{
"id": 76411,
"city": "ampang",
"regionId": 1944,
"region": "selangor",
"countryCode": "my"
},
...
],
"total": 3145
}
List of ASNs
This method retrieves a list of Autonomous Systems (ASNs) through which 2prx proxies are provided. Each Autonomous System belongs to a specific Internet Service Provider (ISP) and has a unique ASN number.
API Endpoint: https://api.2prx.com/proxy/locations/asns?key=<API_KEY>&page=0
Method: GET
Request Parameters:
Parameter | Required | Description |
---|---|---|
key |
Yes | Your API key |
page |
No | Page number |
Request example:
https://api.2prx.com/proxy/locations/asns?key=1abc234de56fab7c89012d34e56fa7b8&page=0
Response example:
{
"status": "OK",
"data": [
{
"id": 4463,
"title": "Sprint",
"countryCode": "us",
"code": "AS1239"
},
{
"id": 1943,
"title": "KCOM GROUP LIMITED",
"countryCode": "gb",
"code": "AS12390"
},
{
"id": 2749,
"title": "Brutele SC",
"countryCode": "be",
"code": "AS12392"
},
...
],
"total": 9830
}
Whitelist
This method retrieves a list of IP addresses in the ip:port
format that can be used without authentication but only from the specified IP address.
You can select a specific country when generating the list to ensure that all your traffic is routed through proxies in the chosen location.
If no country is specified, the system will automatically assign random IP addresses from different countries (mix). In this case, the connection country may change over time.
API Endpoint: https://api.2prx.com/proxy/generate_white_list_connections?key=<API_KEY>&country=au&protocol=http&connection_count=2000&ip=<WHITE_LIST_IP>
Method: GET
Request Parameters:
Parameter | Required | Description |
---|---|---|
key |
Yes | Your API key |
ip |
Yes | The IPv4 address must be added to the whitelist beforehand. |
protocol |
Yes | Connection protocol. Supported protocols: http , https , socks5 |
country |
No | Country code. Important: The list of countries for whitelist connections differs from the general list of countries. The current list of available countries is displayed on the ip-whitelist page in the connection generator. Default: A random country (mix), which will change automatically over time. |
connection_count |
No | Number of generated connections (from 1 to 2000 ).Default: 1 |
Request example:
https://api.2prx.com/proxy/generate_white_list_connections?key=1abc234de56fab7c89012d34e56fa7b8&country=au&protocol=http&connection_count=5&ip=203.0.113.42
Response example:
{
"status": "OK",
"data": [
"192.0.2.103:24008",
"198.51.100.179:16679",
"203.0.113.95:30507",
"192.0.2.96:37614",
"198.51.100.163:25494"
]
}