on-org / onlineproxy-api
php onlineproxy api client
1.0.1
2024-11-29 13:44 UTC
Requires
- php: >=7.1|8.1|8.2|8.3|8.4
- ext-json: *
Requires (Dev)
- larapack/dd: 1.*
- phpunit/phpunit: ^9.0
- vlucas/phpdotenv: ^4.1
README
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
$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
$balance = $client->getUserBalance(); print_r($balance);
🔄 rotateProxy
$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
$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
$tariffs = $client->getProxyTariffs(); print_r($tariffs);
📚 Additional Resources
- OnlineProxy.io: Official website for managing proxies.
- GitHub Repository: View the source code and contribute to the project.
- Documentation: Comprehensive API documentation.
🐞 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
!