Getting started v1.0.0
Install and use the WebShare Proxy PHP wrapper.
PHP wrapper for the WebShare Proxy API with rate-limit retries, GET response caching, filtering, pagination iterators, and typed request helpers.
Requirements
- PHP >= 8.3
- Composer
- WebShare API key
Installation
composer require devcraftclub/webshare-io-api-wrapperConfiguration
export API_KEY="your_webshare_api_key"Or .env:
API_KEY=your_webshare_api_key
API_URL=https://proxy.webshare.io/api/
API_VERSION=v2
CACHE_ENABLED=1
CACHE_LIFETIME=3600
CACHE_DIRECTORY=./cache
ITERATE_MAX_PAGES=100
DEBUG=0use Devcraft\Webshare\Classes\App;
App::init();
// or App::init('your_webshare_api_key');App::Client() returns the shared HTTP client. App::Requests('Profile'|'Notification'|…) auto-discovers request classes.
Quick start
<?php
require_once 'vendor/autoload.php';
use Devcraft\Webshare\Classes\App;
use Devcraft\Webshare\Enums\FilterOperator;
App::init();
/** @var \Devcraft\Webshare\Requests\ProxyRequest $proxies */
$proxies = App::Requests('Proxy');
$proxies->query()
->withFilter('mode', 'direct')
->withPageSize(25)
->withFilter('country_code', ['US', 'DE'], FilterOperator::IN);
$list = $proxies->getList();
foreach ($proxies->iterate() as $proxy) {
echo $proxy->getConnectionString(backbone: true), "\n";
}Request surface
| App::Requests key | Coverage |
|---|---|
Proxy | list, iterate, download, refresh |
Profile | profile + preferences |
Notification | list/retrieve/dismiss/restore |
ProxyReplacement | list/retrieve/create (v3) |
ReplacedProxy | list/download |
ProxyConfig | config/status/listStats/update (v3) |
IpAuthorization | list/iterate/CRUD + whatsMyIp |
ProxyStats | list/aggregate/activities/download |
DownloadToken | get/reset token by scope |
ApiKey | list/iterate/CRUD |
SubUser | list/iterate/CRUD/refresh + masqueradeAs() |
Proxy Connection is not a REST resource — use Proxy::getConnectionString() (backbone/direct).
Domain glossary
| Term | Meaning |
|---|---|
| Proxy | Single proxy endpoint from a list |
| ProxyList | Paginated collection of Proxies |
| ProxyConfig | Plan-level proxy configuration |
| IpAuthorization | Allowlisted source IP |
| SubUser | Child account under the parent plan |
| X-Subuser | Header to masquerade as a SubUser |
| DownloadToken | Time-limited download key |
| PageIterator | Walks paginated pages until next is null |
| BackboneConnection / DirectConnection | Connection modes via getConnectionString() |