API for residential proxies

We provide pay-per-traffic residential proxies. For the correct operation of the API, it is necessary buy residential proxy traffic. If your traffic is over, then some requests will not work.


API requests

A key is required to work with the API. You can find it on the page Profile.

General view of the request:

https://thesafety.us/api?key=[API key]&act=[request name]


Remaining traffic

To check the remaining traffic use act=traffic

https://thesafety.us/api?key=[API key]&act=traffic

The response will be in the form of XML.

The field auth = true if the API key is correct.

The resident-traffic-in-mb field shows the remaining traffic in Megabytes.



List of countries, cities, states

The actual list can be obtained using act=countries

https://thesafety.us/api?key=[API key]&act=countries

The response will be in the form of XML.

The field auth = true if the API key is correct.

The resident field contains the labels country (full name of the country) and code (country code). For API, you must specify code (country code).

For some countries, cities are indicated in the city tag and states in the state tag. Cities and states are specified as a list, separated by a comma.



Proxy list generation

The list of proxies can be obtained via act=getresproxy

https://thesafety.us/api?key=[API key]&act=getresproxy

The answer will be in the form of text/plain. This query will return a proxy for any country with a dynamic IP address. The country and IP address will be randomly selected on each request.


Extra options:

Option Comment
&type= Proxy type:
http = HTTP/HTTPS proxy
socks5 = Socks5 proxy
If type is not specified, http is used by default.
$list= Proxy list format:
hpup = hostname:port:username:password
hp@up = hostname:port@username:password
uphp = username:password:hostname:port
up@hp = username:password@hostname:port
If list is not specified, hpup is used by default.
Select country, city, state
&country= 2-letter country code [code parameter from request act=countries]
&city= City name [city parameter from act=countries query]
The system will try to give out IP addresses in the specified location, but this is not guaranteed.
Do not use with &state=
Only works together with &country=
&state= State name [state parameter from act=countries query]
The system will try to give out IP addresses in the specified location, but this is not guaranteed.
Do not use with &city=
Only works together with &country=
Obtaining a static IP address
&session=1 Specifies to use a static IP address, which is formed in the proxy password through the session parameter.
If session is not specified, then 1 proxy is always issued with a dynamic IP address that changes with each request. Changing the IP address is implemented on a proxy server and does not require additional settings from the user.
&amount= Specifies the required number of proxies to generate.
Possible values ​​are from 1 to 1000.
Works only with the parameter &session=1
&lifetime= The time after which the static IP address is replaced with a new one.
Possible parameters in seconds, minutes and hours: 5-59s, 1-59m, 1-24h
For example:
30s - change IP address every 30 seconds
10m - change IP address every 10 minutes
6h - change IP address every 6 hours
The system will try to work according to the specified parameter, but this is not guaranteed.
Works only with the parameter &session=1


Request examples:

List of 10 HTTP/HTTPS proxies with a static Germany IP address in format up@hp

https://thesafety.us/api?key=[API key]&act=getresproxy&country=de&type=http$list=up@hp&session=1&amount=10

Socks5 proxy with dynamic US IP address in format hpup

https://thesafety.us/api?key=[API key]&act=getresproxy&country=us&type=socks5$list=hpup

HTTP/HTTPS proxy with dynamic IP address in USA, state Utah

https://thesafety.us/api?key=[API key]&act=getresproxy&country=us&state=utah

HTTP/HTTPS proxy with dynamic IP address in Canada, city Montreal

https://thesafety.us/api?key=[API key]&act=getresproxy&country=ca&city=montreal



Any suggestions for improving the API? Contact us.




Ask your question