Subscriptions API
Manage your proxy subscriptions programmatically.
List Subscriptions
Get all active subscriptions for your account.
GET /api/v1/subscriptions
Parameters
| Parameter | Type | Description |
|---|---|---|
status | string | Filter by status: active, suspended, expired |
product_type | string | Filter by type: residential, datacenter |
page | integer | Page number |
per_page | integer | Items per page (max 100) |
Example Request
curl -X GET "https://api.weproxies.com/api/v1/subscriptions?status=active" \
-H "Authorization: Bearer YOUR_API_TOKEN"
Example Response
{
"data": [
{
"id": "sub_abc123",
"product": {
"id": "prod_res_1gb",
"name": "Residential 1GB",
"type": "residential"
},
"status": "active",
"traffic_limit_gb": 1.0,
"traffic_used_gb": 0.45,
"traffic_remaining_gb": 0.55,
"expires_at": "2024-12-31T23:59:59Z",
"created_at": "2024-01-15T10:30:00Z",
"credentials": {
"username": "wp_abc123xyz",
"password": "********"
}
}
],
"pagination": {
"page": 1,
"per_page": 20,
"total": 1,
"total_pages": 1
},
"success": true
}
Get Subscription
Get details for a specific subscription.
GET /api/v1/subscriptions/{subscription_id}
Example Request
curl -X GET "https://api.weproxies.com/api/v1/subscriptions/sub_abc123" \
-H "Authorization: Bearer YOUR_API_TOKEN"
Example Response
{
"data": {
"id": "sub_abc123",
"product": {
"id": "prod_res_1gb",
"name": "Residential 1GB",
"type": "residential",
"price": "10.00"
},
"status": "active",
"traffic_limit_gb": 1.0,
"traffic_used_gb": 0.45,
"traffic_remaining_gb": 0.55,
"expires_at": "2024-12-31T23:59:59Z",
"created_at": "2024-01-15T10:30:00Z",
"credentials": {
"username": "wp_abc123xyz",
"password": "your-password",
"proxy_host": "proxy.weproxies.com",
"proxy_port": 1080
},
"connection_string": {
"http": "http://wp_abc123xyz:password@proxy.weproxies.com:1080"
}
},
"success": true
}
Get Subscription Usage
Get detailed usage statistics for a subscription.
GET /api/v1/subscriptions/{subscription_id}/usage
Parameters
| Parameter | Type | Description |
|---|---|---|
start_date | string | Start date (ISO 8601) |
end_date | string | End date (ISO 8601) |
granularity | string | hourly, daily, weekly |
Example Request
curl -X GET "https://api.weproxies.com/api/v1/subscriptions/sub_abc123/usage?granularity=daily" \
-H "Authorization: Bearer YOUR_API_TOKEN"
Example Response
{
"data": {
"subscription_id": "sub_abc123",
"period": {
"start": "2024-01-01T00:00:00Z",
"end": "2024-01-31T23:59:59Z"
},
"summary": {
"total_bytes": 483729408,
"total_gb": 0.45,
"total_requests": 15234,
"success_rate": 98.5
},
"daily": [
{
"date": "2024-01-15",
"bytes": 107374182,
"requests": 3500,
"success_rate": 99.1
},
{
"date": "2024-01-16",
"bytes": 85899346,
"requests": 2800,
"success_rate": 98.2
}
]
},
"success": true
}
Get Credentials
Retrieve proxy credentials for a subscription.
GET /api/v1/subscriptions/{subscription_id}/credentials
Example Response
{
"data": {
"username": "wp_abc123xyz",
"password": "your-secure-password",
"proxy_host": "proxy.weproxies.com",
"proxy_port": 1080,
"protocols": ["http", "https"],
"connection_examples": {
"http": "http://wp_abc123xyz:password@proxy.weproxies.com:1080",
"with_country": "http://wp_abc123xyz-country-US:password@proxy.weproxies.com:1080",
"with_session": "http://wp_abc123xyz-session-abc123:password@proxy.weproxies.com:1080"
}
},
"success": true
}
Regenerate Password
Generate a new password for subscription credentials.
POST /api/v1/subscriptions/{subscription_id}/regenerate-password
Example Request
curl -X POST "https://api.weproxies.com/api/v1/subscriptions/sub_abc123/regenerate-password" \
-H "Authorization: Bearer YOUR_API_TOKEN"
Example Response
{
"data": {
"username": "wp_abc123xyz",
"password": "new-secure-password",
"message": "Password regenerated successfully"
},
"success": true
}
warning
Regenerating the password will immediately invalidate the old password. Update your applications accordingly.
Subscription Statuses
| Status | Description |
|---|---|
active | Subscription is active and usable |
suspended | Temporarily suspended (payment issue) |
cancelled | User cancelled, active until period end |
expired | Subscription period ended |
Code Examples
Python - List Active Subscriptions
import requests
API_TOKEN = "your_api_token"
BASE_URL = "https://api.weproxies.com"
headers = {"Authorization": f"Bearer {API_TOKEN}"}
response = requests.get(
f"{BASE_URL}/api/v1/subscriptions",
headers=headers,
params={"status": "active"}
)
subscriptions = response.json()["data"]
for sub in subscriptions:
print(f"{sub['product']['name']}: {sub['traffic_remaining_gb']} GB remaining")
Node.js - Get Usage Stats
const axios = require('axios');
const API_TOKEN = 'your_api_token';
const client = axios.create({
baseURL: 'https://api.weproxies.com',
headers: { 'Authorization': `Bearer ${API_TOKEN}` }
});
async function getUsage(subscriptionId) {
const response = await client.get(`/api/v1/subscriptions/${subscriptionId}/usage`);
return response.data.data;
}
getUsage('sub_abc123').then(usage => {
console.log(`Used: ${usage.summary.total_gb} GB`);
console.log(`Requests: ${usage.summary.total_requests}`);
});