You can use the link API. It has the free version and the version.
The way to capture for both versions is the same and only changes one parameter in the URL.
To capture a proxy, just make a request for https://gimmeproxy.com/api/getProxy
with some of the parameters below:
-
api_key=<your-key>
: Your key (if it is the paid version)
-
get=true
: For proxy with GET request support
-
post=true
: For proxy with POST request support
-
supportsHttps=true
: For proxy with HTTPS support
-
country:BR,US
: For proxy for certain countries. Separate by comma
-
minSpeed
: Minimum speed in Kbps of proxy
For more parameters, go to the above website.
To make the capture in PHP, just use the library cURL
or file_get_contetns
.
Example:
$proxy = json_decode( file_get_contents("https://gimmeproxy.com/api/getProxy") );
var_dump( $proxy );
With parameters
$proxy = json_decode( file_get_contents("https://gimmeproxy.com/api/getProxy?supportsHttp=true&get=true") );
var_dump( $proxy );
To save these proxy in a txt
file, just use file_put_contents
:
$proxy = file_get_contents("https://gimmeproxy.com/api/getProxy?supportsHttp=true&get=true");
file_put_contents( "ips.txt", print_r($proxy, true), FILE_APPEND )
└───┬───┘ └─────────┬──────────┘ └─────┬─────┘
│ │ └──────── Utilize esse parâmetro para não sobrescrever o arquivo.
│ └─────────────────────────── Conteúdo do arquivo
└──────────────────────────────────────────── Nome do arquivo