A small, dependency-free PHP client for the Freeproxy API. Focused on clear, typed models and a fluent QueryBuilder API.
A small, dependency-free PHP client for the Freeproxy API. Focused on clear, typed models and a fluent QueryBuilder API.
- PHP 8.0+
- cURL extension
Install via Composer:
composer require getfreeproxy/sdkOr include this repository in your project and run composer dump-autoload.
require 'vendor/autoload.php';
use Getfreeproxy\Sdk\Client;
$client = new Client(getenv('FREEPROXY_API_KEY'));
$proxies = $client->query();
foreach ($proxies as $p) {
echo $p->proxyUrl . PHP_EOL;
}use Getfreeproxy\Sdk\QueryBuilder;
$qb = QueryBuilder::create()->country('US')->protocol('https')->page(1);
$proxies = $client->query($qb);Getfreeproxy\Sdk\Exception\ApiExceptionGetfreeproxy\Sdk\Exception\UnauthorizedExceptionGetfreeproxy\Sdk\Exception\InvalidParameterException
These wrap API errors and network problems. Inspect getApiErrorCode() on ApiException for the provider's error code when available.
- The client uses cURL by default and supports a
timeoutoption via the constructor. - The API requires a Bearer token set as the constructor
apiKeyor viaFREEPROXY_API_KEYenvironment variable in examples.
See the examples/usage.php for a quick demonstration.
MIT License - see LICENSE file for details
For API documentation, visit: https://developer.getfreeproxy.com/docs