on-org/onlineproxy-api

php onlineproxy api client

1.0.1 2024-11-29 13:44 UTC

This package is auto-updated.

Last update: 2024-11-29 13:44:29 UTC


README

Packagist

A PHP wrapper for managing proxies from OnlineProxy.io.

🌟 Features

  • 🌐 Proxy Management: Easily manage proxies from OnlineProxy.io in your PHP projects.
  • 🛠️ Simple Integration: Straightforward setup and usage with clear, concise methods.
  • 📚 Comprehensive API Support: Access to a wide range of API functionalities, including managing proxies, fetching user balance, and ordering proxies.
  • 🐞 Bug Reporting: Quickly report issues through GitHub.

✨ Introduction

OnlineProxy PHP API simplifies the integration of proxy management services into PHP applications. Its intuitive methods and straightforward design allow developers to focus on building applications without worrying about low-level HTTP integrations.

⚙️ Installation

To use the library in your PHP project, simply include the classes manually or through a PSR-4 autoloader (e.g., Composer):

composer require on-org/onlineproxy-php-api

🗂 Quick Setup

Initialize the API Client

require 'vendor/autoload.php';

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);

🛠️ Methods

🌍 getProxyList

  • Description: Retrieves a list of all available proxies.
  • Documentation: [ru] [en].
  • Example:
$proxies = $client->getProxyList();
print_r($proxies);

🌐 getProxy

  • Description: Retrieves details about a specific proxy by its ID.
  • Documentation: [ru] [en].
  • Parameters:
    • id (string): The ID of the proxy.
  • Example:
$proxyId = 'proxy_id_here';
$proxy = $client->getProxy($proxyId);
print_r($proxy);

💰 getUserBalance

  • Description: Retrieves the current user balance.
  • Documentation: [ru] [en].
  • Example:
$balance = $client->getUserBalance();
print_r($balance);

🔄 rotateProxy

  • Description: Rotates the IP address of an active proxy.
  • Documentation: [ru] [en].
  • Example:
$rotationResult = $client->rotateProxy();
print_r($rotationResult);

💬 createOrUpdateProxyComment

  • Description: Adds or updates a comment for a specific proxy.
  • Documentation: [ru] [en].
  • Parameters:
    • id (string): The ID of the proxy.
    • comment (string): The comment to add or update.
  • Example:
$proxyId = 'proxy_id_here';
$comment = 'New comment';
$result = $client->createOrUpdateProxyComment($proxyId, $comment);
print_r($result);

📋 getAvailableProxiesForOrder

  • Description: Fetches a list of proxies available for order.
  • Documentation: [ru] [en].
  • Example:
$availableProxies = $client->getAvailableProxiesForOrder();
print_r($availableProxies);

🛒 orderProxy

  • Description: Orders a new proxy.
  • Documentation: [ru] [en].
  • Parameters:
    • orderData (array): An array of order details.
  • Example:
$orderData = [
    'proxyType' => 'HTTP',
    'quantity' => 1,
    'location' => 'USA',
];
$orderResult = $client->orderProxy($orderData);
print_r($orderResult);

📊 getProxyTariffs

  • Description: Retrieves available proxy tariffs.
  • Documentation: [ru] [en].
  • Example:
$tariffs = $client->getProxyTariffs();
print_r($tariffs);

📚 Additional Resources

🐞 Reporting Issues

If you encounter any issues or have suggestions for improvements, please create an issue on our GitHub repository.

Happy coding with OnlineProxy PHP API!