PHP code example of on-org / onlineproxy-api

1. Go to this page and download the library: Download on-org/onlineproxy-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

on-org / onlineproxy-api example snippets




use onOrg\OnlineProxyApi\OnlineProxyApi;

$apiKey = 'your_api_key_here';
$locale = 'en'; // 'en', 'ru', or null for default
$devId = null;  // Optional developer ID

$client = new OnlineProxyApi($apiKey, $locale, $devId);

$proxies = $client->getProxyList();
print_r($proxies);

$proxyId = 'proxy_id_here';
$proxy = $client->getProxy($proxyId);
print_r($proxy);

$balance = $client->getUserBalance();
print_r($balance);

$rotationResult = $client->rotateProxy();
print_r($rotationResult);

$proxyId = 'proxy_id_here';
$comment = 'New comment';
$result = $client->createOrUpdateProxyComment($proxyId, $comment);
print_r($result);

$availableProxies = $client->getAvailableProxiesForOrder();
print_r($availableProxies);

$orderData = [
    'proxyType' => 'HTTP',
    'quantity' => 1,
    'location' => 'USA',
];
$orderResult = $client->orderProxy($orderData);
print_r($orderResult);

$tariffs = $client->getProxyTariffs();
print_r($tariffs);