Residential Proxies
Operations for residential proxies
Purchase additional traffic (Residential)
https://user-api.shardx.com/user/api/orders/{id}/add-bandwidthBearer authentication header of the form Bearer <token>.
Optional. A unique identifier of the logical operation (1-128 characters of [A-Za-z0-9_.:-]), for example a UUID.
Send the SAME key when retrying a request whose outcome you do not know (timeout, dropped connection): a request that already completed is NOT executed again, its original response is returned.
Accepted on EVERY mutating endpoint (POST/PUT/PATCH/DELETE) of this API: purchase, renewal, bandwidth top-up, add-ons and any endpoint added later; it is listed explicitly on the money-moving ones.
All endpoints except sub-user operations: the stored response is replayed with the `Idempotency-Replayed: true` header for 7 days. `409`: a request with this key is still running (`idempotency_state: in_progress`) or never completed and its outcome must be verified manually (`idempotency_state: unknown`; it is never re-executed). `422`: the key was already used with a different request. A `429` from the rate limiter does not consume the key, so retry with the same one.
Sub-user endpoints (create, data/add, data/subtract): the key is forwarded to the proxy provider, and a retry within 24 hours cannot change the quota twice. 409: the operation is still in progress or the key was used with a different payload.
Without the header, requests run as usual, without these guarantees.
Amount in GB (1 GB = 1 073 741 824 bytes), up to 100 000
200Successapplication/json
400Invalid request; the reason is in message. Most checks answer with JSON (ApiError), a few answer with a plain-text body (Content-Type: text/plain): Invalid proxy type, User don't have active order with this proxy type, User resident not set for user (residential endpoints), Addon not available for this product, Invalid addons_json and the add-on quantity checks (add-on endpoints, purchase and calculation with add-ons), and errors returned by the proxy server on signature/set and del-np/set.application/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
409A request with this Idempotency-Key is still running (idempotency_state: in_progress), or it never completed and its outcome must be checked manually (idempotency_state: unknown)application/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
422The Idempotency-Key was already used with a different requestapplication/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
429More than one request per 3 seconds from the account. The body is plain text (Too many requests, retry in <N>s), and the x-ratelimit-after header has the wait in seconds. The Idempotency-Key is not consumed: retry with the same one.text/plain
500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
502The traffic could not be added after payment; order_id and refunded tell whether the payment was returnedapplication/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
/user/api/orders/1/add-bandwidthPOST /user/api/orders/1/add-bandwidth HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Idempotency-Key: text
Content-Type: application/json
Accept: */*
{
"amount": 1,
"promo_code": "text"
}curl -X POST 'https://user-api.shardx.com/user/api/orders/1/add-bandwidth' \
-H 'Authorization: Bearer YOUR_SECRET_TOKEN' \
-H 'Idempotency-Key: text' \
-H 'Content-Type: application/json' \
-d '{"amount":1,"promo_code":"text"}'import requests
# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"
url = "https://user-api.shardx.com/user/api/orders/1/add-bandwidth"
headers = {
"Authorization": f"Bearer {token}",
"Idempotency-Key": "text",
}
payload = {
"amount": 1,
"promo_code": "text",
}
response = requests.post(url, headers=headers, json=payload, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";
const url = "https://user-api.shardx.com/user/api/orders/1/add-bandwidth";
const payload = {
"amount": 1,
"promo_code": "text"
};
const response = await fetch(url, {
method: "POST",
headers: {
"Authorization": `Bearer ${token}`,
"Idempotency-Key": "text",
"Content-Type": "application/json",
},
body: JSON.stringify(payload),
});
console.log(response.status);
console.log(await response.text());package main
import (
"bytes"
"fmt"
"io"
"log"
"net/http"
)
func main() {
// API token — see Authorizations above.
token := "YOUR_SECRET_TOKEN"
url := "https://user-api.shardx.com/user/api/orders/1/add-bandwidth"
body := bytes.NewBufferString(`{
"amount": 1,
"promo_code": "text"
}`)
req, err := http.NewRequest("POST", url, body)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("Idempotency-Key", "text")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
out, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(resp.Status)
fmt.Println(string(out))
}// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }, serde_json = "1"
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// API token — see Authorizations above.
let token = "YOUR_SECRET_TOKEN";
let client = reqwest::Client::new();
let response = client
.post("https://user-api.shardx.com/user/api/orders/1/add-bandwidth")
.header("Authorization", format!("Bearer {token}"))
.header("Idempotency-Key", "text")
.json(&serde_json::json!({
"amount": 1,
"promo_code": "text"
}))
.send()
.await?;
println!("{}", response.status());
println!("{}", response.text().await?);
Ok(())
}using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
// API token — see Authorizations above.
var token = "YOUR_SECRET_TOKEN";
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var request = new HttpRequestMessage(HttpMethod.Post, "https://user-api.shardx.com/user/api/orders/1/add-bandwidth");
request.Headers.Add("Idempotency-Key", "text");
request.Content = new StringContent("""
{
"amount": 1,
"promo_code": "text"
}
""", Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>
#include <iostream>
#include <string>
static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
return size * nmemb;
}
int main() {
// API token — see Authorizations above.
const std::string token = "YOUR_SECRET_TOKEN";
curl_global_init(CURL_GLOBAL_DEFAULT);
CURL *curl = curl_easy_init();
if (!curl) {
std::cerr << "curl_easy_init failed\n";
curl_global_cleanup();
return 1;
}
struct curl_slist *headers = nullptr;
headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());
headers = curl_slist_append(headers, "Idempotency-Key: text");
headers = curl_slist_append(headers, "Content-Type: application/json");
const std::string body = R"json({
"amount": 1,
"promo_code": "text"
})json";
std::string response;
curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/orders/1/add-bandwidth");
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, body.c_str());
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, static_cast<long>(body.size()));
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
const CURLcode rc = curl_easy_perform(curl);
if (rc != CURLE_OK) {
std::cerr << curl_easy_strerror(rc) << "\n";
} else {
long status = 0;
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
std::cout << status << "\n" << response << "\n";
}
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
curl_global_cleanup();
return rc == CURLE_OK ? 0 : 1;
}{
"success": true,
"message": "Order paid successfully"
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}"Too many requests, retry in 2s"{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}Account owner traffic
https://user-api.shardx.com/user/api/proxies/profileReturns the parent account's own total and remaining data for the given proxy type, aggregated across the parent's orders. Unlike the sub-user endpoints, this reflects the data of the account owner, not a sub-user.
Bearer authentication header of the form Bearer <token>.
Proxy type (standart | premium | unlimited)
200Successapplication/json
Total allocated data in bytes
Remaining data in bytes
Consumed data in bytes
Parent account's proxy password
400Invalid request; the reason is in message. Most checks answer with JSON (ApiError), a few answer with a plain-text body (Content-Type: text/plain): Invalid proxy type, User don't have active order with this proxy type, User resident not set for user (residential endpoints), Addon not available for this product, Invalid addons_json and the add-on quantity checks (add-on endpoints, purchase and calculation with add-ons), and errors returned by the proxy server on signature/set and del-np/set.application/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
502The proxy provider failed or answered with an error (Upstream error: <status>)application/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
/user/api/proxies/profile?proxy_type=textGET /user/api/proxies/profile?proxy_type=text HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*curl -X GET 'https://user-api.shardx.com/user/api/proxies/profile?proxy_type=text' \
-H 'Authorization: Bearer YOUR_SECRET_TOKEN'import requests
# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"
url = "https://user-api.shardx.com/user/api/proxies/profile"
params = {
"proxy_type": "text",
}
headers = {
"Authorization": f"Bearer {token}",
}
response = requests.get(url, params=params, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";
const url = "https://user-api.shardx.com/user/api/proxies/profile?proxy_type=text";
const response = await fetch(url, {
method: "GET",
headers: {
"Authorization": `Bearer ${token}`,
},
});
console.log(response.status);
console.log(await response.text());package main
import (
"fmt"
"io"
"log"
"net/http"
)
func main() {
// API token — see Authorizations above.
token := "YOUR_SECRET_TOKEN"
url := "https://user-api.shardx.com/user/api/proxies/profile?proxy_type=text"
req, err := http.NewRequest("GET", url, nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
out, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(resp.Status)
fmt.Println(string(out))
}// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// API token — see Authorizations above.
let token = "YOUR_SECRET_TOKEN";
let client = reqwest::Client::new();
let response = client
.get("https://user-api.shardx.com/user/api/proxies/profile?proxy_type=text")
.header("Authorization", format!("Bearer {token}"))
.send()
.await?;
println!("{}", response.status());
println!("{}", response.text().await?);
Ok(())
}using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
// API token — see Authorizations above.
var token = "YOUR_SECRET_TOKEN";
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var request = new HttpRequestMessage(HttpMethod.Get, "https://user-api.shardx.com/user/api/proxies/profile?proxy_type=text");
var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>
#include <iostream>
#include <string>
static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
return size * nmemb;
}
int main() {
// API token — see Authorizations above.
const std::string token = "YOUR_SECRET_TOKEN";
curl_global_init(CURL_GLOBAL_DEFAULT);
CURL *curl = curl_easy_init();
if (!curl) {
std::cerr << "curl_easy_init failed\n";
curl_global_cleanup();
return 1;
}
struct curl_slist *headers = nullptr;
headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());
std::string response;
curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/proxies/profile?proxy_type=text");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
const CURLcode rc = curl_easy_perform(curl);
if (rc != CURLE_OK) {
std::cerr << curl_easy_strerror(rc) << "\n";
} else {
long status = 0;
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
std::cout << status << "\n" << response << "\n";
}
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
curl_global_cleanup();
return rc == CURLE_OK ? 0 : 1;
}{
"success": true,
"data": 1,
"data_remain": 1,
"data_spent": 1,
"proxy_password": "text"
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}Account analytics
https://user-api.shardx.com/user/api/proxies/analytics/{kind}Traffic statistics of the account itself.
kind:
overall: traffic and requests bucketed over the period;domains: traffic and requests per destination hostname over the period;connections: connections open right now (no period).
By default only the account's own traffic is counted. Pass include_sub_users=true to add every sub-user of the account.
Bearer authentication header of the form Bearer <token>.
overall | domains | connections
overalldomainsconnectionsProxy type (standart | premium | unlimited)
Inclusive start of the window (ISO 8601, YYYY-MM-DD HH:MM:SS or Unix timestamp). Ignored for connections.
Exclusive end of the window; defaults to now. Ignored for connections.
IANA timezone for bucket boundaries, UTC by default
Count the account together with all of its sub-users (false by default)
Page size
Number of results to skip
200Successapplication/json
The provider's answer, passed through unchanged. Its shape depends on kind:
`overall`: `results` are time buckets `{timestamp, data, requests}`, empty intervals included as zeros; buckets are hourly on a short window and daily on a long one;
domains: results are hostnames {hostname, data, requests}, sorted by data descending; there is no count;
* connections: results are open connections {user_id, package_id, server_ip, connections} right now; there is no period (timezone, start, end).
Total number of results (overall)
Link to the next page
Link to the previous page
resultsobject[]optionalShow propertiesHide properties
Start of the bucket (overall)
Destination host (domains)
Bytes (overall, domains)
Requests (overall, domains)
Account or sub-user id (connections)
Package id (connections)
IP of the gateway that holds the connections (connections)
Open connections (connections)
400Invalid request; the reason is in message. Most checks answer with JSON (ApiError), a few answer with a plain-text body (Content-Type: text/plain): Invalid proxy type, User don't have active order with this proxy type, User resident not set for user (residential endpoints), Addon not available for this product, Invalid addons_json and the add-on quantity checks (add-on endpoints, purchase and calculation with add-ons), and errors returned by the proxy server on signature/set and del-np/set.application/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
502The proxy provider failed or answered with an error (Upstream error: <status>)application/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
/user/api/proxies/analytics/overall?proxy_type=textGET /user/api/proxies/analytics/overall?proxy_type=text HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*curl -X GET 'https://user-api.shardx.com/user/api/proxies/analytics/overall?proxy_type=text' \
-H 'Authorization: Bearer YOUR_SECRET_TOKEN'import requests
# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"
url = "https://user-api.shardx.com/user/api/proxies/analytics/overall"
params = {
"proxy_type": "text",
}
headers = {
"Authorization": f"Bearer {token}",
}
response = requests.get(url, params=params, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";
const url = "https://user-api.shardx.com/user/api/proxies/analytics/overall?proxy_type=text";
const response = await fetch(url, {
method: "GET",
headers: {
"Authorization": `Bearer ${token}`,
},
});
console.log(response.status);
console.log(await response.text());package main
import (
"fmt"
"io"
"log"
"net/http"
)
func main() {
// API token — see Authorizations above.
token := "YOUR_SECRET_TOKEN"
url := "https://user-api.shardx.com/user/api/proxies/analytics/overall?proxy_type=text"
req, err := http.NewRequest("GET", url, nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
out, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(resp.Status)
fmt.Println(string(out))
}// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// API token — see Authorizations above.
let token = "YOUR_SECRET_TOKEN";
let client = reqwest::Client::new();
let response = client
.get("https://user-api.shardx.com/user/api/proxies/analytics/overall?proxy_type=text")
.header("Authorization", format!("Bearer {token}"))
.send()
.await?;
println!("{}", response.status());
println!("{}", response.text().await?);
Ok(())
}using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
// API token — see Authorizations above.
var token = "YOUR_SECRET_TOKEN";
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var request = new HttpRequestMessage(HttpMethod.Get, "https://user-api.shardx.com/user/api/proxies/analytics/overall?proxy_type=text");
var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>
#include <iostream>
#include <string>
static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
return size * nmemb;
}
int main() {
// API token — see Authorizations above.
const std::string token = "YOUR_SECRET_TOKEN";
curl_global_init(CURL_GLOBAL_DEFAULT);
CURL *curl = curl_easy_init();
if (!curl) {
std::cerr << "curl_easy_init failed\n";
curl_global_cleanup();
return 1;
}
struct curl_slist *headers = nullptr;
headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());
std::string response;
curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/proxies/analytics/overall?proxy_type=text");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
const CURLcode rc = curl_easy_perform(curl);
if (rc != CURLE_OK) {
std::cerr << curl_easy_strerror(rc) << "\n";
} else {
long status = 0;
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
std::cout << status << "\n" << response << "\n";
}
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
curl_global_cleanup();
return rc == CURLE_OK ? 0 : 1;
}{
"count": 1,
"next": "text",
"previous": "text",
"timezone": "text",
"start": "2026-01-01T00:00:00Z",
"end": "2026-01-01T00:00:00Z",
"results": [
{
"timestamp": "2026-01-01T00:00:00Z",
"hostname": "text",
"data": 1,
"requests": 1,
"user_id": "text",
"package_id": "text",
"server_ip": "text",
"connections": 1
}
]
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}Sub-user analytics
https://user-api.shardx.com/user/api/proxies/sub-user/{user_id}/analytics/{kind}The same statistics for a single sub-user of the account. Access is enforced by the provider: the request is made on behalf of the account, which can only read its own sub-users.
Bearer authentication header of the form Bearer <token>.
Sub-user id at the provider
overall | domains | connections
overalldomainsconnectionsProxy type (standart | premium | unlimited)
Inclusive start of the window (ISO 8601, YYYY-MM-DD HH:MM:SS or Unix timestamp). Ignored for connections.
Exclusive end of the window; defaults to now. Ignored for connections.
IANA timezone for bucket boundaries, UTC by default
Page size
Number of results to skip
200Successapplication/json
The provider's answer, passed through unchanged. Its shape depends on kind:
`overall`: `results` are time buckets `{timestamp, data, requests}`, empty intervals included as zeros; buckets are hourly on a short window and daily on a long one;
domains: results are hostnames {hostname, data, requests}, sorted by data descending; there is no count;
* connections: results are open connections {user_id, package_id, server_ip, connections} right now; there is no period (timezone, start, end).
Total number of results (overall)
Link to the next page
Link to the previous page
resultsobject[]optionalShow propertiesHide properties
Start of the bucket (overall)
Destination host (domains)
Bytes (overall, domains)
Requests (overall, domains)
Account or sub-user id (connections)
Package id (connections)
IP of the gateway that holds the connections (connections)
Open connections (connections)
400Invalid request; the reason is in message. Most checks answer with JSON (ApiError), a few answer with a plain-text body (Content-Type: text/plain): Invalid proxy type, User don't have active order with this proxy type, User resident not set for user (residential endpoints), Addon not available for this product, Invalid addons_json and the add-on quantity checks (add-on endpoints, purchase and calculation with add-ons), and errors returned by the proxy server on signature/set and del-np/set.application/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
502The proxy provider failed or answered with an error (Upstream error: <status>)application/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
/user/api/proxies/sub-user/text/analytics/overall?proxy_type=textGET /user/api/proxies/sub-user/text/analytics/overall?proxy_type=text HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*curl -X GET 'https://user-api.shardx.com/user/api/proxies/sub-user/text/analytics/overall?proxy_type=text' \
-H 'Authorization: Bearer YOUR_SECRET_TOKEN'import requests
# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"
url = "https://user-api.shardx.com/user/api/proxies/sub-user/text/analytics/overall"
params = {
"proxy_type": "text",
}
headers = {
"Authorization": f"Bearer {token}",
}
response = requests.get(url, params=params, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";
const url = "https://user-api.shardx.com/user/api/proxies/sub-user/text/analytics/overall?proxy_type=text";
const response = await fetch(url, {
method: "GET",
headers: {
"Authorization": `Bearer ${token}`,
},
});
console.log(response.status);
console.log(await response.text());package main
import (
"fmt"
"io"
"log"
"net/http"
)
func main() {
// API token — see Authorizations above.
token := "YOUR_SECRET_TOKEN"
url := "https://user-api.shardx.com/user/api/proxies/sub-user/text/analytics/overall?proxy_type=text"
req, err := http.NewRequest("GET", url, nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
out, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(resp.Status)
fmt.Println(string(out))
}// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// API token — see Authorizations above.
let token = "YOUR_SECRET_TOKEN";
let client = reqwest::Client::new();
let response = client
.get("https://user-api.shardx.com/user/api/proxies/sub-user/text/analytics/overall?proxy_type=text")
.header("Authorization", format!("Bearer {token}"))
.send()
.await?;
println!("{}", response.status());
println!("{}", response.text().await?);
Ok(())
}using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
// API token — see Authorizations above.
var token = "YOUR_SECRET_TOKEN";
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var request = new HttpRequestMessage(HttpMethod.Get, "https://user-api.shardx.com/user/api/proxies/sub-user/text/analytics/overall?proxy_type=text");
var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>
#include <iostream>
#include <string>
static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
return size * nmemb;
}
int main() {
// API token — see Authorizations above.
const std::string token = "YOUR_SECRET_TOKEN";
curl_global_init(CURL_GLOBAL_DEFAULT);
CURL *curl = curl_easy_init();
if (!curl) {
std::cerr << "curl_easy_init failed\n";
curl_global_cleanup();
return 1;
}
struct curl_slist *headers = nullptr;
headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());
std::string response;
curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/proxies/sub-user/text/analytics/overall?proxy_type=text");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
const CURLcode rc = curl_easy_perform(curl);
if (rc != CURLE_OK) {
std::cerr << curl_easy_strerror(rc) << "\n";
} else {
long status = 0;
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
std::cout << status << "\n" << response << "\n";
}
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
curl_global_cleanup();
return rc == CURLE_OK ? 0 : 1;
}{
"count": 1,
"next": "text",
"previous": "text",
"timezone": "text",
"start": "2026-01-01T00:00:00Z",
"end": "2026-01-01T00:00:00Z",
"results": [
{
"timestamp": "2026-01-01T00:00:00Z",
"hostname": "text",
"data": 1,
"requests": 1,
"user_id": "text",
"package_id": "text",
"server_ip": "text",
"connections": 1
}
]
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}Sub-user list
https://user-api.shardx.com/user/api/proxies/sub-usersBearer authentication header of the form Bearer <token>.
Proxy type (standart | premium | unlimited)
Provider-side search by sub-user name or login
200Successapplication/json
Total sub-users before pagination
dataobject[]optionalShow propertiesHide properties
400Invalid request; the reason is in message. Most checks answer with JSON (ApiError), a few answer with a plain-text body (Content-Type: text/plain): Invalid proxy type, User don't have active order with this proxy type, User resident not set for user (residential endpoints), Addon not available for this product, Invalid addons_json and the add-on quantity checks (add-on endpoints, purchase and calculation with add-ons), and errors returned by the proxy server on signature/set and del-np/set.application/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
502The proxy provider failed or answered with an error (Upstream error: <status>)application/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
/user/api/proxies/sub-users?proxy_type=textGET /user/api/proxies/sub-users?proxy_type=text HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*curl -X GET 'https://user-api.shardx.com/user/api/proxies/sub-users?proxy_type=text' \
-H 'Authorization: Bearer YOUR_SECRET_TOKEN'import requests
# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"
url = "https://user-api.shardx.com/user/api/proxies/sub-users"
params = {
"proxy_type": "text",
}
headers = {
"Authorization": f"Bearer {token}",
}
response = requests.get(url, params=params, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";
const url = "https://user-api.shardx.com/user/api/proxies/sub-users?proxy_type=text";
const response = await fetch(url, {
method: "GET",
headers: {
"Authorization": `Bearer ${token}`,
},
});
console.log(response.status);
console.log(await response.text());package main
import (
"fmt"
"io"
"log"
"net/http"
)
func main() {
// API token — see Authorizations above.
token := "YOUR_SECRET_TOKEN"
url := "https://user-api.shardx.com/user/api/proxies/sub-users?proxy_type=text"
req, err := http.NewRequest("GET", url, nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
out, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(resp.Status)
fmt.Println(string(out))
}// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// API token — see Authorizations above.
let token = "YOUR_SECRET_TOKEN";
let client = reqwest::Client::new();
let response = client
.get("https://user-api.shardx.com/user/api/proxies/sub-users?proxy_type=text")
.header("Authorization", format!("Bearer {token}"))
.send()
.await?;
println!("{}", response.status());
println!("{}", response.text().await?);
Ok(())
}using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
// API token — see Authorizations above.
var token = "YOUR_SECRET_TOKEN";
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var request = new HttpRequestMessage(HttpMethod.Get, "https://user-api.shardx.com/user/api/proxies/sub-users?proxy_type=text");
var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>
#include <iostream>
#include <string>
static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
return size * nmemb;
}
int main() {
// API token — see Authorizations above.
const std::string token = "YOUR_SECRET_TOKEN";
curl_global_init(CURL_GLOBAL_DEFAULT);
CURL *curl = curl_easy_init();
if (!curl) {
std::cerr << "curl_easy_init failed\n";
curl_global_cleanup();
return 1;
}
struct curl_slist *headers = nullptr;
headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());
std::string response;
curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/proxies/sub-users?proxy_type=text");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
const CURLcode rc = curl_easy_perform(curl);
if (rc != CURLE_OK) {
std::cerr << curl_easy_strerror(rc) << "\n";
} else {
long status = 0;
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
std::cout << status << "\n" << response << "\n";
}
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
curl_global_cleanup();
return rc == CURLE_OK ? 0 : 1;
}{
"success": true,
"count": 1,
"data": [
{
"user_id": "text",
"first_name": "text",
"proxy_password": "text",
"data": 1,
"data_spent": 1,
"data_remain": 1
}
]
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}Get sub-user by ID
https://user-api.shardx.com/user/api/proxies/sub-user/{user_id}Bearer authentication header of the form Bearer <token>.
Proxy type (standart | premium | unlimited)
200Successapplication/json
dataobject[]optionalEmpty when the sub-user does not exist
Show propertiesHide properties
Empty when the sub-user does not exist
400Invalid request; the reason is in message. Most checks answer with JSON (ApiError), a few answer with a plain-text body (Content-Type: text/plain): Invalid proxy type, User don't have active order with this proxy type, User resident not set for user (residential endpoints), Addon not available for this product, Invalid addons_json and the add-on quantity checks (add-on endpoints, purchase and calculation with add-ons), and errors returned by the proxy server on signature/set and del-np/set.application/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
502Provider error (the sub-user may still exist, retry)application/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
/user/api/proxies/sub-user/text?proxy_type=textGET /user/api/proxies/sub-user/text?proxy_type=text HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*curl -X GET 'https://user-api.shardx.com/user/api/proxies/sub-user/text?proxy_type=text' \
-H 'Authorization: Bearer YOUR_SECRET_TOKEN'import requests
# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"
url = "https://user-api.shardx.com/user/api/proxies/sub-user/text"
params = {
"proxy_type": "text",
}
headers = {
"Authorization": f"Bearer {token}",
}
response = requests.get(url, params=params, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";
const url = "https://user-api.shardx.com/user/api/proxies/sub-user/text?proxy_type=text";
const response = await fetch(url, {
method: "GET",
headers: {
"Authorization": `Bearer ${token}`,
},
});
console.log(response.status);
console.log(await response.text());package main
import (
"fmt"
"io"
"log"
"net/http"
)
func main() {
// API token — see Authorizations above.
token := "YOUR_SECRET_TOKEN"
url := "https://user-api.shardx.com/user/api/proxies/sub-user/text?proxy_type=text"
req, err := http.NewRequest("GET", url, nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
out, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(resp.Status)
fmt.Println(string(out))
}// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// API token — see Authorizations above.
let token = "YOUR_SECRET_TOKEN";
let client = reqwest::Client::new();
let response = client
.get("https://user-api.shardx.com/user/api/proxies/sub-user/text?proxy_type=text")
.header("Authorization", format!("Bearer {token}"))
.send()
.await?;
println!("{}", response.status());
println!("{}", response.text().await?);
Ok(())
}using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
// API token — see Authorizations above.
var token = "YOUR_SECRET_TOKEN";
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var request = new HttpRequestMessage(HttpMethod.Get, "https://user-api.shardx.com/user/api/proxies/sub-user/text?proxy_type=text");
var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>
#include <iostream>
#include <string>
static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
return size * nmemb;
}
int main() {
// API token — see Authorizations above.
const std::string token = "YOUR_SECRET_TOKEN";
curl_global_init(CURL_GLOBAL_DEFAULT);
CURL *curl = curl_easy_init();
if (!curl) {
std::cerr << "curl_easy_init failed\n";
curl_global_cleanup();
return 1;
}
struct curl_slist *headers = nullptr;
headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());
std::string response;
curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/proxies/sub-user/text?proxy_type=text");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
const CURLcode rc = curl_easy_perform(curl);
if (rc != CURLE_OK) {
std::cerr << curl_easy_strerror(rc) << "\n";
} else {
long status = 0;
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
std::cout << status << "\n" << response << "\n";
}
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
curl_global_cleanup();
return rc == CURLE_OK ? 0 : 1;
}{
"success": true,
"data": [
{
"user_id": "text",
"first_name": "text",
"proxy_password": "text",
"data": 1,
"data_spent": 1,
"data_remain": 1
}
]
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}Delete sub-user
https://user-api.shardx.com/user/api/proxies/sub-user/{user_id}Bearer authentication header of the form Bearer <token>.
200Successapplication/json
400Invalid request; the reason is in message. Most checks answer with JSON (ApiError), a few answer with a plain-text body (Content-Type: text/plain): Invalid proxy type, User don't have active order with this proxy type, User resident not set for user (residential endpoints), Addon not available for this product, Invalid addons_json and the add-on quantity checks (add-on endpoints, purchase and calculation with add-ons), and errors returned by the proxy server on signature/set and del-np/set.application/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
502The provider did not delete the sub-user (it still exists). Deleting an already deleted sub-user is a success.application/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
/user/api/proxies/sub-user/textDELETE /user/api/proxies/sub-user/text HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*curl -X DELETE 'https://user-api.shardx.com/user/api/proxies/sub-user/text' \
-H 'Authorization: Bearer YOUR_SECRET_TOKEN'import requests
# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"
url = "https://user-api.shardx.com/user/api/proxies/sub-user/text"
headers = {
"Authorization": f"Bearer {token}",
}
response = requests.delete(url, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";
const url = "https://user-api.shardx.com/user/api/proxies/sub-user/text";
const response = await fetch(url, {
method: "DELETE",
headers: {
"Authorization": `Bearer ${token}`,
},
});
console.log(response.status);
console.log(await response.text());package main
import (
"fmt"
"io"
"log"
"net/http"
)
func main() {
// API token — see Authorizations above.
token := "YOUR_SECRET_TOKEN"
url := "https://user-api.shardx.com/user/api/proxies/sub-user/text"
req, err := http.NewRequest("DELETE", url, nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
out, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(resp.Status)
fmt.Println(string(out))
}// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// API token — see Authorizations above.
let token = "YOUR_SECRET_TOKEN";
let client = reqwest::Client::new();
let response = client
.delete("https://user-api.shardx.com/user/api/proxies/sub-user/text")
.header("Authorization", format!("Bearer {token}"))
.send()
.await?;
println!("{}", response.status());
println!("{}", response.text().await?);
Ok(())
}using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
// API token — see Authorizations above.
var token = "YOUR_SECRET_TOKEN";
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var request = new HttpRequestMessage(HttpMethod.Delete, "https://user-api.shardx.com/user/api/proxies/sub-user/text");
var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>
#include <iostream>
#include <string>
static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
return size * nmemb;
}
int main() {
// API token — see Authorizations above.
const std::string token = "YOUR_SECRET_TOKEN";
curl_global_init(CURL_GLOBAL_DEFAULT);
CURL *curl = curl_easy_init();
if (!curl) {
std::cerr << "curl_easy_init failed\n";
curl_global_cleanup();
return 1;
}
struct curl_slist *headers = nullptr;
headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());
std::string response;
curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/proxies/sub-user/text");
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
const CURLcode rc = curl_easy_perform(curl);
if (rc != CURLE_OK) {
std::cerr << curl_easy_strerror(rc) << "\n";
} else {
long status = 0;
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
std::cout << status << "\n" << response << "\n";
}
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
curl_global_cleanup();
return rc == CURLE_OK ? 0 : 1;
}{
"success": true,
"message": "Sub user deleted successfully"
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}Edit sub-user (name/package)
https://user-api.shardx.com/user/api/proxies/sub-user/{user_id}Bearer authentication header of the form Bearer <token>.
Proxy type (standart | premium | unlimited)
200Successapplication/json
400Invalid request; the reason is in message. Most checks answer with JSON (ApiError), a few answer with a plain-text body (Content-Type: text/plain): Invalid proxy type, User don't have active order with this proxy type, User resident not set for user (residential endpoints), Addon not available for this product, Invalid addons_json and the add-on quantity checks (add-on endpoints, purchase and calculation with add-ons), and errors returned by the proxy server on signature/set and del-np/set.application/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
/user/api/proxies/sub-user/text?proxy_type=textPATCH /user/api/proxies/sub-user/text?proxy_type=text HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
{
"name": "text"
}curl -X PATCH 'https://user-api.shardx.com/user/api/proxies/sub-user/text?proxy_type=text' \
-H 'Authorization: Bearer YOUR_SECRET_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"name":"text"}'import requests
# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"
url = "https://user-api.shardx.com/user/api/proxies/sub-user/text"
params = {
"proxy_type": "text",
}
headers = {
"Authorization": f"Bearer {token}",
}
payload = {
"name": "text",
}
response = requests.patch(url, params=params, headers=headers, json=payload, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";
const url = "https://user-api.shardx.com/user/api/proxies/sub-user/text?proxy_type=text";
const payload = {
"name": "text"
};
const response = await fetch(url, {
method: "PATCH",
headers: {
"Authorization": `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify(payload),
});
console.log(response.status);
console.log(await response.text());package main
import (
"bytes"
"fmt"
"io"
"log"
"net/http"
)
func main() {
// API token — see Authorizations above.
token := "YOUR_SECRET_TOKEN"
url := "https://user-api.shardx.com/user/api/proxies/sub-user/text?proxy_type=text"
body := bytes.NewBufferString(`{
"name": "text"
}`)
req, err := http.NewRequest("PATCH", url, body)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
out, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(resp.Status)
fmt.Println(string(out))
}// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }, serde_json = "1"
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// API token — see Authorizations above.
let token = "YOUR_SECRET_TOKEN";
let client = reqwest::Client::new();
let response = client
.patch("https://user-api.shardx.com/user/api/proxies/sub-user/text?proxy_type=text")
.header("Authorization", format!("Bearer {token}"))
.json(&serde_json::json!({
"name": "text"
}))
.send()
.await?;
println!("{}", response.status());
println!("{}", response.text().await?);
Ok(())
}using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
// API token — see Authorizations above.
var token = "YOUR_SECRET_TOKEN";
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var request = new HttpRequestMessage(HttpMethod.Patch, "https://user-api.shardx.com/user/api/proxies/sub-user/text?proxy_type=text");
request.Content = new StringContent("""
{
"name": "text"
}
""", Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>
#include <iostream>
#include <string>
static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
return size * nmemb;
}
int main() {
// API token — see Authorizations above.
const std::string token = "YOUR_SECRET_TOKEN";
curl_global_init(CURL_GLOBAL_DEFAULT);
CURL *curl = curl_easy_init();
if (!curl) {
std::cerr << "curl_easy_init failed\n";
curl_global_cleanup();
return 1;
}
struct curl_slist *headers = nullptr;
headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());
headers = curl_slist_append(headers, "Content-Type: application/json");
const std::string body = R"json({
"name": "text"
})json";
std::string response;
curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/proxies/sub-user/text?proxy_type=text");
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, body.c_str());
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, static_cast<long>(body.size()));
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
const CURLcode rc = curl_easy_perform(curl);
if (rc != CURLE_OK) {
std::cerr << curl_easy_strerror(rc) << "\n";
} else {
long status = 0;
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
std::cout << status << "\n" << response << "\n";
}
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
curl_global_cleanup();
return rc == CURLE_OK ? 0 : 1;
}{
"success": true,
"message": "Sub user edited successfully"
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}Create sub-user
https://user-api.shardx.com/user/api/proxies/sub-userThe quota is a virtual cap on top of the account's shared traffic pool: assigning it does not debit the pool; traffic is consumed only when the sub-user actually uses the proxy.
Bearer authentication header of the form Bearer <token>.
Proxy type (standart | premium | unlimited)
Optional. A unique identifier of the logical operation (1-128 characters of [A-Za-z0-9_.:-]), for example a UUID.
Send the SAME key when retrying a request whose outcome you do not know (timeout, dropped connection): a request that already completed is NOT executed again, its original response is returned.
Accepted on EVERY mutating endpoint (POST/PUT/PATCH/DELETE) of this API: purchase, renewal, bandwidth top-up, add-ons and any endpoint added later; it is listed explicitly on the money-moving ones.
All endpoints except sub-user operations: the stored response is replayed with the `Idempotency-Replayed: true` header for 7 days. `409`: a request with this key is still running (`idempotency_state: in_progress`) or never completed and its outcome must be verified manually (`idempotency_state: unknown`; it is never re-executed). `422`: the key was already used with a different request. A `429` from the rate limiter does not consume the key, so retry with the same one.
Sub-user endpoints (create, data/add, data/subtract): the key is forwarded to the proxy provider, and a retry within 24 hours cannot change the quota twice. 409: the operation is still in progress or the key was used with a different payload.
Without the header, requests run as usual, without these guarantees.
Amount in GB (1 GB = 1 073 741 824 bytes), up to 100 000
Amount in bytes (exact; takes precedence over data), up to 100 000 GB
200Successapplication/json
dataobject[]optionalShow propertiesHide properties
400Validation error, or the provider rejected the request (rejected: true); nothing was createdapplication/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
409A request with this Idempotency-Key is in progress or was used with a different payloadapplication/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
502Provider unreachable: the outcome is UNKNOWN; retry with the same Idempotency-Keyapplication/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
/user/api/proxies/sub-user?proxy_type=textPOST /user/api/proxies/sub-user?proxy_type=text HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Idempotency-Key: text
Content-Type: application/json
Accept: */*
{
"name": "text",
"data": 1,
"data_bytes": 1
}curl -X POST 'https://user-api.shardx.com/user/api/proxies/sub-user?proxy_type=text' \
-H 'Authorization: Bearer YOUR_SECRET_TOKEN' \
-H 'Idempotency-Key: text' \
-H 'Content-Type: application/json' \
-d '{"name":"text","data":1,"data_bytes":1}'import requests
# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"
url = "https://user-api.shardx.com/user/api/proxies/sub-user"
params = {
"proxy_type": "text",
}
headers = {
"Authorization": f"Bearer {token}",
"Idempotency-Key": "text",
}
payload = {
"name": "text",
"data": 1,
"data_bytes": 1,
}
response = requests.post(url, params=params, headers=headers, json=payload, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";
const url = "https://user-api.shardx.com/user/api/proxies/sub-user?proxy_type=text";
const payload = {
"name": "text",
"data": 1,
"data_bytes": 1
};
const response = await fetch(url, {
method: "POST",
headers: {
"Authorization": `Bearer ${token}`,
"Idempotency-Key": "text",
"Content-Type": "application/json",
},
body: JSON.stringify(payload),
});
console.log(response.status);
console.log(await response.text());package main
import (
"bytes"
"fmt"
"io"
"log"
"net/http"
)
func main() {
// API token — see Authorizations above.
token := "YOUR_SECRET_TOKEN"
url := "https://user-api.shardx.com/user/api/proxies/sub-user?proxy_type=text"
body := bytes.NewBufferString(`{
"name": "text",
"data": 1,
"data_bytes": 1
}`)
req, err := http.NewRequest("POST", url, body)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("Idempotency-Key", "text")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
out, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(resp.Status)
fmt.Println(string(out))
}// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }, serde_json = "1"
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// API token — see Authorizations above.
let token = "YOUR_SECRET_TOKEN";
let client = reqwest::Client::new();
let response = client
.post("https://user-api.shardx.com/user/api/proxies/sub-user?proxy_type=text")
.header("Authorization", format!("Bearer {token}"))
.header("Idempotency-Key", "text")
.json(&serde_json::json!({
"name": "text",
"data": 1,
"data_bytes": 1
}))
.send()
.await?;
println!("{}", response.status());
println!("{}", response.text().await?);
Ok(())
}using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
// API token — see Authorizations above.
var token = "YOUR_SECRET_TOKEN";
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var request = new HttpRequestMessage(HttpMethod.Post, "https://user-api.shardx.com/user/api/proxies/sub-user?proxy_type=text");
request.Headers.Add("Idempotency-Key", "text");
request.Content = new StringContent("""
{
"name": "text",
"data": 1,
"data_bytes": 1
}
""", Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>
#include <iostream>
#include <string>
static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
return size * nmemb;
}
int main() {
// API token — see Authorizations above.
const std::string token = "YOUR_SECRET_TOKEN";
curl_global_init(CURL_GLOBAL_DEFAULT);
CURL *curl = curl_easy_init();
if (!curl) {
std::cerr << "curl_easy_init failed\n";
curl_global_cleanup();
return 1;
}
struct curl_slist *headers = nullptr;
headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());
headers = curl_slist_append(headers, "Idempotency-Key: text");
headers = curl_slist_append(headers, "Content-Type: application/json");
const std::string body = R"json({
"name": "text",
"data": 1,
"data_bytes": 1
})json";
std::string response;
curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/proxies/sub-user?proxy_type=text");
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, body.c_str());
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, static_cast<long>(body.size()));
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
const CURLcode rc = curl_easy_perform(curl);
if (rc != CURLE_OK) {
std::cerr << curl_easy_strerror(rc) << "\n";
} else {
long status = 0;
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
std::cout << status << "\n" << response << "\n";
}
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
curl_global_cleanup();
return rc == CURLE_OK ? 0 : 1;
}{
"success": true,
"data": [
{
"user_id": "text",
"first_name": "text",
"proxy_password": "text",
"data": 1,
"data_spent": 1,
"data_remain": 1
}
]
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}Add traffic to sub-user
https://user-api.shardx.com/user/api/proxies/sub-user/{user_id}/data/addBearer authentication header of the form Bearer <token>.
Proxy type (standart | premium | unlimited)
Optional. A unique identifier of the logical operation (1-128 characters of [A-Za-z0-9_.:-]), for example a UUID.
Send the SAME key when retrying a request whose outcome you do not know (timeout, dropped connection): a request that already completed is NOT executed again, its original response is returned.
Accepted on EVERY mutating endpoint (POST/PUT/PATCH/DELETE) of this API: purchase, renewal, bandwidth top-up, add-ons and any endpoint added later; it is listed explicitly on the money-moving ones.
All endpoints except sub-user operations: the stored response is replayed with the `Idempotency-Replayed: true` header for 7 days. `409`: a request with this key is still running (`idempotency_state: in_progress`) or never completed and its outcome must be verified manually (`idempotency_state: unknown`; it is never re-executed). `422`: the key was already used with a different request. A `429` from the rate limiter does not consume the key, so retry with the same one.
Sub-user endpoints (create, data/add, data/subtract): the key is forwarded to the proxy provider, and a retry within 24 hours cannot change the quota twice. 409: the operation is still in progress or the key was used with a different payload.
Without the header, requests run as usual, without these guarantees.
Amount in GB (1 GB = 1 073 741 824 bytes), up to 100 000
Amount in bytes (exact; takes precedence over data), up to 100 000 GB
200Successapplication/json
orderobject · SubUserOrderState· nullableoptionalSub-user quota state AFTER the operation (null when the provider returned no order object)
Show propertiesHide properties
Sub-user quota state AFTER the operation (null when the provider returned no order object)
Total assigned quota in bytes
Consumed bytes
Remaining bytes (may be negative on overdraft)
400Validation error, or the provider rejected the operation (rejected: true); the quota did NOT changeapplication/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
409A request with this Idempotency-Key is in progress or was used with a different payloadapplication/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
502Provider unreachable: the outcome is UNKNOWN; retry with the same Idempotency-Keyapplication/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
/user/api/proxies/sub-user/text/data/add?proxy_type=textPOST /user/api/proxies/sub-user/text/data/add?proxy_type=text HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Idempotency-Key: text
Content-Type: application/json
Accept: */*
{
"data": 1,
"data_bytes": 1
}curl -X POST 'https://user-api.shardx.com/user/api/proxies/sub-user/text/data/add?proxy_type=text' \
-H 'Authorization: Bearer YOUR_SECRET_TOKEN' \
-H 'Idempotency-Key: text' \
-H 'Content-Type: application/json' \
-d '{"data":1,"data_bytes":1}'import requests
# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"
url = "https://user-api.shardx.com/user/api/proxies/sub-user/text/data/add"
params = {
"proxy_type": "text",
}
headers = {
"Authorization": f"Bearer {token}",
"Idempotency-Key": "text",
}
payload = {
"data": 1,
"data_bytes": 1,
}
response = requests.post(url, params=params, headers=headers, json=payload, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";
const url = "https://user-api.shardx.com/user/api/proxies/sub-user/text/data/add?proxy_type=text";
const payload = {
"data": 1,
"data_bytes": 1
};
const response = await fetch(url, {
method: "POST",
headers: {
"Authorization": `Bearer ${token}`,
"Idempotency-Key": "text",
"Content-Type": "application/json",
},
body: JSON.stringify(payload),
});
console.log(response.status);
console.log(await response.text());package main
import (
"bytes"
"fmt"
"io"
"log"
"net/http"
)
func main() {
// API token — see Authorizations above.
token := "YOUR_SECRET_TOKEN"
url := "https://user-api.shardx.com/user/api/proxies/sub-user/text/data/add?proxy_type=text"
body := bytes.NewBufferString(`{
"data": 1,
"data_bytes": 1
}`)
req, err := http.NewRequest("POST", url, body)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("Idempotency-Key", "text")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
out, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(resp.Status)
fmt.Println(string(out))
}// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }, serde_json = "1"
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// API token — see Authorizations above.
let token = "YOUR_SECRET_TOKEN";
let client = reqwest::Client::new();
let response = client
.post("https://user-api.shardx.com/user/api/proxies/sub-user/text/data/add?proxy_type=text")
.header("Authorization", format!("Bearer {token}"))
.header("Idempotency-Key", "text")
.json(&serde_json::json!({
"data": 1,
"data_bytes": 1
}))
.send()
.await?;
println!("{}", response.status());
println!("{}", response.text().await?);
Ok(())
}using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
// API token — see Authorizations above.
var token = "YOUR_SECRET_TOKEN";
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var request = new HttpRequestMessage(HttpMethod.Post, "https://user-api.shardx.com/user/api/proxies/sub-user/text/data/add?proxy_type=text");
request.Headers.Add("Idempotency-Key", "text");
request.Content = new StringContent("""
{
"data": 1,
"data_bytes": 1
}
""", Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>
#include <iostream>
#include <string>
static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
return size * nmemb;
}
int main() {
// API token — see Authorizations above.
const std::string token = "YOUR_SECRET_TOKEN";
curl_global_init(CURL_GLOBAL_DEFAULT);
CURL *curl = curl_easy_init();
if (!curl) {
std::cerr << "curl_easy_init failed\n";
curl_global_cleanup();
return 1;
}
struct curl_slist *headers = nullptr;
headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());
headers = curl_slist_append(headers, "Idempotency-Key: text");
headers = curl_slist_append(headers, "Content-Type: application/json");
const std::string body = R"json({
"data": 1,
"data_bytes": 1
})json";
std::string response;
curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/proxies/sub-user/text/data/add?proxy_type=text");
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, body.c_str());
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, static_cast<long>(body.size()));
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
const CURLcode rc = curl_easy_perform(curl);
if (rc != CURLE_OK) {
std::cerr << curl_easy_strerror(rc) << "\n";
} else {
long status = 0;
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
std::cout << status << "\n" << response << "\n";
}
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
curl_global_cleanup();
return rc == CURLE_OK ? 0 : 1;
}{
"success": true,
"message": "Traffic added to sub user successfully",
"order": {
"proxy_password": "text",
"data": 1,
"data_spent": 1,
"data_remain": 1
}
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}Subtract traffic from sub-user
https://user-api.shardx.com/user/api/proxies/sub-user/{user_id}/data/subtractBearer authentication header of the form Bearer <token>.
Proxy type (standart | premium | unlimited)
Optional. A unique identifier of the logical operation (1-128 characters of [A-Za-z0-9_.:-]), for example a UUID.
Send the SAME key when retrying a request whose outcome you do not know (timeout, dropped connection): a request that already completed is NOT executed again, its original response is returned.
Accepted on EVERY mutating endpoint (POST/PUT/PATCH/DELETE) of this API: purchase, renewal, bandwidth top-up, add-ons and any endpoint added later; it is listed explicitly on the money-moving ones.
All endpoints except sub-user operations: the stored response is replayed with the `Idempotency-Replayed: true` header for 7 days. `409`: a request with this key is still running (`idempotency_state: in_progress`) or never completed and its outcome must be verified manually (`idempotency_state: unknown`; it is never re-executed). `422`: the key was already used with a different request. A `429` from the rate limiter does not consume the key, so retry with the same one.
Sub-user endpoints (create, data/add, data/subtract): the key is forwarded to the proxy provider, and a retry within 24 hours cannot change the quota twice. 409: the operation is still in progress or the key was used with a different payload.
Without the header, requests run as usual, without these guarantees.
Amount in GB (1 GB = 1 073 741 824 bytes), up to 100 000
Amount in bytes (exact; takes precedence over data), up to 100 000 GB
200Successapplication/json
orderobject · SubUserOrderState· nullableoptionalSub-user quota state AFTER the operation (null when the provider returned no order object)
Show propertiesHide properties
Sub-user quota state AFTER the operation (null when the provider returned no order object)
Total assigned quota in bytes
Consumed bytes
Remaining bytes (may be negative on overdraft)
400Validation error, or the provider rejected the operation (rejected: true); the quota did NOT changeapplication/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
409A request with this Idempotency-Key is in progress or was used with a different payloadapplication/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
502Provider unreachable: the outcome is UNKNOWN; retry with the same Idempotency-Keyapplication/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
/user/api/proxies/sub-user/text/data/subtract?proxy_type=textPOST /user/api/proxies/sub-user/text/data/subtract?proxy_type=text HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Idempotency-Key: text
Content-Type: application/json
Accept: */*
{
"data": 1,
"data_bytes": 1
}curl -X POST 'https://user-api.shardx.com/user/api/proxies/sub-user/text/data/subtract?proxy_type=text' \
-H 'Authorization: Bearer YOUR_SECRET_TOKEN' \
-H 'Idempotency-Key: text' \
-H 'Content-Type: application/json' \
-d '{"data":1,"data_bytes":1}'import requests
# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"
url = "https://user-api.shardx.com/user/api/proxies/sub-user/text/data/subtract"
params = {
"proxy_type": "text",
}
headers = {
"Authorization": f"Bearer {token}",
"Idempotency-Key": "text",
}
payload = {
"data": 1,
"data_bytes": 1,
}
response = requests.post(url, params=params, headers=headers, json=payload, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";
const url = "https://user-api.shardx.com/user/api/proxies/sub-user/text/data/subtract?proxy_type=text";
const payload = {
"data": 1,
"data_bytes": 1
};
const response = await fetch(url, {
method: "POST",
headers: {
"Authorization": `Bearer ${token}`,
"Idempotency-Key": "text",
"Content-Type": "application/json",
},
body: JSON.stringify(payload),
});
console.log(response.status);
console.log(await response.text());package main
import (
"bytes"
"fmt"
"io"
"log"
"net/http"
)
func main() {
// API token — see Authorizations above.
token := "YOUR_SECRET_TOKEN"
url := "https://user-api.shardx.com/user/api/proxies/sub-user/text/data/subtract?proxy_type=text"
body := bytes.NewBufferString(`{
"data": 1,
"data_bytes": 1
}`)
req, err := http.NewRequest("POST", url, body)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("Idempotency-Key", "text")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
out, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(resp.Status)
fmt.Println(string(out))
}// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }, serde_json = "1"
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// API token — see Authorizations above.
let token = "YOUR_SECRET_TOKEN";
let client = reqwest::Client::new();
let response = client
.post("https://user-api.shardx.com/user/api/proxies/sub-user/text/data/subtract?proxy_type=text")
.header("Authorization", format!("Bearer {token}"))
.header("Idempotency-Key", "text")
.json(&serde_json::json!({
"data": 1,
"data_bytes": 1
}))
.send()
.await?;
println!("{}", response.status());
println!("{}", response.text().await?);
Ok(())
}using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
// API token — see Authorizations above.
var token = "YOUR_SECRET_TOKEN";
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var request = new HttpRequestMessage(HttpMethod.Post, "https://user-api.shardx.com/user/api/proxies/sub-user/text/data/subtract?proxy_type=text");
request.Headers.Add("Idempotency-Key", "text");
request.Content = new StringContent("""
{
"data": 1,
"data_bytes": 1
}
""", Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>
#include <iostream>
#include <string>
static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
return size * nmemb;
}
int main() {
// API token — see Authorizations above.
const std::string token = "YOUR_SECRET_TOKEN";
curl_global_init(CURL_GLOBAL_DEFAULT);
CURL *curl = curl_easy_init();
if (!curl) {
std::cerr << "curl_easy_init failed\n";
curl_global_cleanup();
return 1;
}
struct curl_slist *headers = nullptr;
headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());
headers = curl_slist_append(headers, "Idempotency-Key: text");
headers = curl_slist_append(headers, "Content-Type: application/json");
const std::string body = R"json({
"data": 1,
"data_bytes": 1
})json";
std::string response;
curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/proxies/sub-user/text/data/subtract?proxy_type=text");
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, body.c_str());
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, static_cast<long>(body.size()));
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
const CURLcode rc = curl_easy_perform(curl);
if (rc != CURLE_OK) {
std::cerr << curl_easy_strerror(rc) << "\n";
} else {
long status = 0;
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
std::cout << status << "\n" << response << "\n";
}
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
curl_global_cleanup();
return rc == CURLE_OK ? 0 : 1;
}{
"success": true,
"message": "Traffic subtracted from sub user successfully",
"order": {
"proxy_password": "text",
"data": 1,
"data_spent": 1,
"data_remain": 1
}
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}Change sub-user password
https://user-api.shardx.com/user/api/proxies/sub-user/{user_id}/passwordBearer authentication header of the form Bearer <token>.
Proxy type (standart | premium | unlimited)
200Successapplication/json
The new proxy password
400Invalid request; the reason is in message. Most checks answer with JSON (ApiError), a few answer with a plain-text body (Content-Type: text/plain): Invalid proxy type, User don't have active order with this proxy type, User resident not set for user (residential endpoints), Addon not available for this product, Invalid addons_json and the add-on quantity checks (add-on endpoints, purchase and calculation with add-ons), and errors returned by the proxy server on signature/set and del-np/set.application/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
502The provider did not rotate the password (the old one is still valid)application/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
/user/api/proxies/sub-user/text/password?proxy_type=textPOST /user/api/proxies/sub-user/text/password?proxy_type=text HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*curl -X POST 'https://user-api.shardx.com/user/api/proxies/sub-user/text/password?proxy_type=text' \
-H 'Authorization: Bearer YOUR_SECRET_TOKEN'import requests
# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"
url = "https://user-api.shardx.com/user/api/proxies/sub-user/text/password"
params = {
"proxy_type": "text",
}
headers = {
"Authorization": f"Bearer {token}",
}
response = requests.post(url, params=params, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";
const url = "https://user-api.shardx.com/user/api/proxies/sub-user/text/password?proxy_type=text";
const response = await fetch(url, {
method: "POST",
headers: {
"Authorization": `Bearer ${token}`,
},
});
console.log(response.status);
console.log(await response.text());package main
import (
"fmt"
"io"
"log"
"net/http"
)
func main() {
// API token — see Authorizations above.
token := "YOUR_SECRET_TOKEN"
url := "https://user-api.shardx.com/user/api/proxies/sub-user/text/password?proxy_type=text"
req, err := http.NewRequest("POST", url, nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
out, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(resp.Status)
fmt.Println(string(out))
}// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// API token — see Authorizations above.
let token = "YOUR_SECRET_TOKEN";
let client = reqwest::Client::new();
let response = client
.post("https://user-api.shardx.com/user/api/proxies/sub-user/text/password?proxy_type=text")
.header("Authorization", format!("Bearer {token}"))
.send()
.await?;
println!("{}", response.status());
println!("{}", response.text().await?);
Ok(())
}using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
// API token — see Authorizations above.
var token = "YOUR_SECRET_TOKEN";
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var request = new HttpRequestMessage(HttpMethod.Post, "https://user-api.shardx.com/user/api/proxies/sub-user/text/password?proxy_type=text");
var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>
#include <iostream>
#include <string>
static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
return size * nmemb;
}
int main() {
// API token — see Authorizations above.
const std::string token = "YOUR_SECRET_TOKEN";
curl_global_init(CURL_GLOBAL_DEFAULT);
CURL *curl = curl_easy_init();
if (!curl) {
std::cerr << "curl_easy_init failed\n";
curl_global_cleanup();
return 1;
}
struct curl_slist *headers = nullptr;
headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());
std::string response;
curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/proxies/sub-user/text/password?proxy_type=text");
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
const CURLcode rc = curl_easy_perform(curl);
if (rc != CURLE_OK) {
std::cerr << curl_easy_strerror(rc) << "\n";
} else {
long status = 0;
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
std::cout << status << "\n" << response << "\n";
}
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
curl_global_cleanup();
return rc == CURLE_OK ? 0 : 1;
}{
"success": true,
"message": "Sub user password changed successfully",
"proxy_password": "text"
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}Country list
https://user-api.shardx.com/user/api/proxies/countriesBearer authentication header of the form Bearer <token>.
Proxy type (standart | premium | unlimited)
200Successapplication/json
resultsobject · Country[]requiredShow propertiesHide properties
ISO country code
Country name
400Invalid request; the reason is in message. Most checks answer with JSON (ApiError), a few answer with a plain-text body (Content-Type: text/plain): Invalid proxy type, User don't have active order with this proxy type, User resident not set for user (residential endpoints), Addon not available for this product, Invalid addons_json and the add-on quantity checks (add-on endpoints, purchase and calculation with add-ons), and errors returned by the proxy server on signature/set and del-np/set.application/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
/user/api/proxies/countries?proxy_type=textGET /user/api/proxies/countries?proxy_type=text HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*curl -X GET 'https://user-api.shardx.com/user/api/proxies/countries?proxy_type=text' \
-H 'Authorization: Bearer YOUR_SECRET_TOKEN'import requests
# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"
url = "https://user-api.shardx.com/user/api/proxies/countries"
params = {
"proxy_type": "text",
}
headers = {
"Authorization": f"Bearer {token}",
}
response = requests.get(url, params=params, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";
const url = "https://user-api.shardx.com/user/api/proxies/countries?proxy_type=text";
const response = await fetch(url, {
method: "GET",
headers: {
"Authorization": `Bearer ${token}`,
},
});
console.log(response.status);
console.log(await response.text());package main
import (
"fmt"
"io"
"log"
"net/http"
)
func main() {
// API token — see Authorizations above.
token := "YOUR_SECRET_TOKEN"
url := "https://user-api.shardx.com/user/api/proxies/countries?proxy_type=text"
req, err := http.NewRequest("GET", url, nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
out, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(resp.Status)
fmt.Println(string(out))
}// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// API token — see Authorizations above.
let token = "YOUR_SECRET_TOKEN";
let client = reqwest::Client::new();
let response = client
.get("https://user-api.shardx.com/user/api/proxies/countries?proxy_type=text")
.header("Authorization", format!("Bearer {token}"))
.send()
.await?;
println!("{}", response.status());
println!("{}", response.text().await?);
Ok(())
}using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
// API token — see Authorizations above.
var token = "YOUR_SECRET_TOKEN";
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var request = new HttpRequestMessage(HttpMethod.Get, "https://user-api.shardx.com/user/api/proxies/countries?proxy_type=text");
var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>
#include <iostream>
#include <string>
static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
return size * nmemb;
}
int main() {
// API token — see Authorizations above.
const std::string token = "YOUR_SECRET_TOKEN";
curl_global_init(CURL_GLOBAL_DEFAULT);
CURL *curl = curl_easy_init();
if (!curl) {
std::cerr << "curl_easy_init failed\n";
curl_global_cleanup();
return 1;
}
struct curl_slist *headers = nullptr;
headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());
std::string response;
curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/proxies/countries?proxy_type=text");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
const CURLcode rc = curl_easy_perform(curl);
if (rc != CURLE_OK) {
std::cerr << curl_easy_strerror(rc) << "\n";
} else {
long status = 0;
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
std::cout << status << "\n" << response << "\n";
}
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
curl_global_cleanup();
return rc == CURLE_OK ? 0 : 1;
}{
"count": 1,
"results": [
{
"code": "text",
"name": "text"
}
]
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}Region list
https://user-api.shardx.com/user/api/proxies/regionsBearer authentication header of the form Bearer <token>.
Proxy type (standart | premium | unlimited)
ISO country code
200Successapplication/json
resultsobject · Region[]requiredShow propertiesHide properties
Region or state code
Region or state name
countryobject · CountryrequiredShow propertiesHide properties
ISO country code
Country name
400Invalid request; the reason is in message. Most checks answer with JSON (ApiError), a few answer with a plain-text body (Content-Type: text/plain): Invalid proxy type, User don't have active order with this proxy type, User resident not set for user (residential endpoints), Addon not available for this product, Invalid addons_json and the add-on quantity checks (add-on endpoints, purchase and calculation with add-ons), and errors returned by the proxy server on signature/set and del-np/set.application/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
/user/api/proxies/regions?proxy_type=text&country_code=textGET /user/api/proxies/regions?proxy_type=text&country_code=text HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*curl -X GET 'https://user-api.shardx.com/user/api/proxies/regions?proxy_type=text&country_code=text' \
-H 'Authorization: Bearer YOUR_SECRET_TOKEN'import requests
# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"
url = "https://user-api.shardx.com/user/api/proxies/regions"
params = {
"proxy_type": "text",
"country_code": "text",
}
headers = {
"Authorization": f"Bearer {token}",
}
response = requests.get(url, params=params, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";
const url = "https://user-api.shardx.com/user/api/proxies/regions?proxy_type=text&country_code=text";
const response = await fetch(url, {
method: "GET",
headers: {
"Authorization": `Bearer ${token}`,
},
});
console.log(response.status);
console.log(await response.text());package main
import (
"fmt"
"io"
"log"
"net/http"
)
func main() {
// API token — see Authorizations above.
token := "YOUR_SECRET_TOKEN"
url := "https://user-api.shardx.com/user/api/proxies/regions?proxy_type=text&country_code=text"
req, err := http.NewRequest("GET", url, nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
out, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(resp.Status)
fmt.Println(string(out))
}// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// API token — see Authorizations above.
let token = "YOUR_SECRET_TOKEN";
let client = reqwest::Client::new();
let response = client
.get("https://user-api.shardx.com/user/api/proxies/regions?proxy_type=text&country_code=text")
.header("Authorization", format!("Bearer {token}"))
.send()
.await?;
println!("{}", response.status());
println!("{}", response.text().await?);
Ok(())
}using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
// API token — see Authorizations above.
var token = "YOUR_SECRET_TOKEN";
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var request = new HttpRequestMessage(HttpMethod.Get, "https://user-api.shardx.com/user/api/proxies/regions?proxy_type=text&country_code=text");
var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>
#include <iostream>
#include <string>
static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
return size * nmemb;
}
int main() {
// API token — see Authorizations above.
const std::string token = "YOUR_SECRET_TOKEN";
curl_global_init(CURL_GLOBAL_DEFAULT);
CURL *curl = curl_easy_init();
if (!curl) {
std::cerr << "curl_easy_init failed\n";
curl_global_cleanup();
return 1;
}
struct curl_slist *headers = nullptr;
headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());
std::string response;
curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/proxies/regions?proxy_type=text&country_code=text");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
const CURLcode rc = curl_easy_perform(curl);
if (rc != CURLE_OK) {
std::cerr << curl_easy_strerror(rc) << "\n";
} else {
long status = 0;
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
std::cout << status << "\n" << response << "\n";
}
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
curl_global_cleanup();
return rc == CURLE_OK ? 0 : 1;
}{
"count": 1,
"results": [
{
"code": "text",
"name": "text",
"country": {
"code": "text",
"name": "text"
}
}
]
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}City list
https://user-api.shardx.com/user/api/proxies/citiesBearer authentication header of the form Bearer <token>.
Proxy type (standart | premium | unlimited)
ISO country code
Region or state code
200Successapplication/json
resultsobject · City[]requiredShow propertiesHide properties
City code, usually a slug
City name
countryobject · CountryrequiredShow propertiesHide properties
ISO country code
Country name
regionobject· nullableoptionalShow propertiesHide properties
Region code
Region name
400Invalid request; the reason is in message. Most checks answer with JSON (ApiError), a few answer with a plain-text body (Content-Type: text/plain): Invalid proxy type, User don't have active order with this proxy type, User resident not set for user (residential endpoints), Addon not available for this product, Invalid addons_json and the add-on quantity checks (add-on endpoints, purchase and calculation with add-ons), and errors returned by the proxy server on signature/set and del-np/set.application/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
/user/api/proxies/cities?proxy_type=text&country_code=text®ion_code=textGET /user/api/proxies/cities?proxy_type=text&country_code=text®ion_code=text HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*curl -X GET 'https://user-api.shardx.com/user/api/proxies/cities?proxy_type=text&country_code=text®ion_code=text' \
-H 'Authorization: Bearer YOUR_SECRET_TOKEN'import requests
# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"
url = "https://user-api.shardx.com/user/api/proxies/cities"
params = {
"proxy_type": "text",
"country_code": "text",
"region_code": "text",
}
headers = {
"Authorization": f"Bearer {token}",
}
response = requests.get(url, params=params, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";
const url = "https://user-api.shardx.com/user/api/proxies/cities?proxy_type=text&country_code=text®ion_code=text";
const response = await fetch(url, {
method: "GET",
headers: {
"Authorization": `Bearer ${token}`,
},
});
console.log(response.status);
console.log(await response.text());package main
import (
"fmt"
"io"
"log"
"net/http"
)
func main() {
// API token — see Authorizations above.
token := "YOUR_SECRET_TOKEN"
url := "https://user-api.shardx.com/user/api/proxies/cities?proxy_type=text&country_code=text®ion_code=text"
req, err := http.NewRequest("GET", url, nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
out, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(resp.Status)
fmt.Println(string(out))
}// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// API token — see Authorizations above.
let token = "YOUR_SECRET_TOKEN";
let client = reqwest::Client::new();
let response = client
.get("https://user-api.shardx.com/user/api/proxies/cities?proxy_type=text&country_code=text®ion_code=text")
.header("Authorization", format!("Bearer {token}"))
.send()
.await?;
println!("{}", response.status());
println!("{}", response.text().await?);
Ok(())
}using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
// API token — see Authorizations above.
var token = "YOUR_SECRET_TOKEN";
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var request = new HttpRequestMessage(HttpMethod.Get, "https://user-api.shardx.com/user/api/proxies/cities?proxy_type=text&country_code=text®ion_code=text");
var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>
#include <iostream>
#include <string>
static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
return size * nmemb;
}
int main() {
// API token — see Authorizations above.
const std::string token = "YOUR_SECRET_TOKEN";
curl_global_init(CURL_GLOBAL_DEFAULT);
CURL *curl = curl_easy_init();
if (!curl) {
std::cerr << "curl_easy_init failed\n";
curl_global_cleanup();
return 1;
}
struct curl_slist *headers = nullptr;
headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());
std::string response;
curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/proxies/cities?proxy_type=text&country_code=text®ion_code=text");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
const CURLcode rc = curl_easy_perform(curl);
if (rc != CURLE_OK) {
std::cerr << curl_easy_strerror(rc) << "\n";
} else {
long status = 0;
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
std::cout << status << "\n" << response << "\n";
}
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
curl_global_cleanup();
return rc == CURLE_OK ? 0 : 1;
}{
"count": 1,
"results": [
{
"code": "text",
"name": "text",
"country": {
"code": "text",
"name": "text"
},
"region": {
"code": "text",
"name": "text"
}
}
]
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}List ISPs
https://user-api.shardx.com/user/api/proxies/ispsInternet providers available inside a city; the fourth targeting level after country, region and city. Unlike the other location endpoints this one needs the full chain: country_code, region_code AND city_code are all required, because upstream ISPs are bound to a city. Premium package only: the ISP catalogue is not maintained for the standart and unlimited packages, and any other proxy_type is rejected with 400. ISPs are listed for major cities only, so an empty results with count: 0 is a normal answer for a smaller city.
Bearer authentication header of the form Bearer <token>.
Must be premium; ISP targeting is premium-only
premiumISO country code
Region or state code
City code from GET /user/api/proxies/cities
200Successapplication/json
resultsobject · Isp[]requiredShow propertiesHide properties
ISP code, usually a slug
ISP name
countryobject · CountryrequiredShow propertiesHide properties
ISO country code
Country name
regionobject· nullableoptionalShow propertiesHide properties
Region code
Region name
400Invalid request; the reason is in message. Most checks answer with JSON (ApiError), a few answer with a plain-text body (Content-Type: text/plain): Invalid proxy type, User don't have active order with this proxy type, User resident not set for user (residential endpoints), Addon not available for this product, Invalid addons_json and the add-on quantity checks (add-on endpoints, purchase and calculation with add-ons), and errors returned by the proxy server on signature/set and del-np/set.application/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
Sub-user operations: true when the provider rejected the operation and nothing changed
Only in a 409 from the Idempotency-Key check
in_progressunknownOnly in a 502 from purchase and add-bandwidth: the order that was paid for
Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support
/user/api/proxies/isps?proxy_type=premium&country_code=text®ion_code=text&city_code=textGET /user/api/proxies/isps?proxy_type=premium&country_code=text®ion_code=text&city_code=text HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*curl -X GET 'https://user-api.shardx.com/user/api/proxies/isps?proxy_type=premium&country_code=text®ion_code=text&city_code=text' \
-H 'Authorization: Bearer YOUR_SECRET_TOKEN'import requests
# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"
url = "https://user-api.shardx.com/user/api/proxies/isps"
params = {
"proxy_type": "premium",
"country_code": "text",
"region_code": "text",
"city_code": "text",
}
headers = {
"Authorization": f"Bearer {token}",
}
response = requests.get(url, params=params, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";
const url = "https://user-api.shardx.com/user/api/proxies/isps?proxy_type=premium&country_code=text®ion_code=text&city_code=text";
const response = await fetch(url, {
method: "GET",
headers: {
"Authorization": `Bearer ${token}`,
},
});
console.log(response.status);
console.log(await response.text());package main
import (
"fmt"
"io"
"log"
"net/http"
)
func main() {
// API token — see Authorizations above.
token := "YOUR_SECRET_TOKEN"
url := "https://user-api.shardx.com/user/api/proxies/isps?proxy_type=premium&country_code=text®ion_code=text&city_code=text"
req, err := http.NewRequest("GET", url, nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
out, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(resp.Status)
fmt.Println(string(out))
}// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// API token — see Authorizations above.
let token = "YOUR_SECRET_TOKEN";
let client = reqwest::Client::new();
let response = client
.get("https://user-api.shardx.com/user/api/proxies/isps?proxy_type=premium&country_code=text®ion_code=text&city_code=text")
.header("Authorization", format!("Bearer {token}"))
.send()
.await?;
println!("{}", response.status());
println!("{}", response.text().await?);
Ok(())
}using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
// API token — see Authorizations above.
var token = "YOUR_SECRET_TOKEN";
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var request = new HttpRequestMessage(HttpMethod.Get, "https://user-api.shardx.com/user/api/proxies/isps?proxy_type=premium&country_code=text®ion_code=text&city_code=text");
var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>
#include <iostream>
#include <string>
static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
return size * nmemb;
}
int main() {
// API token — see Authorizations above.
const std::string token = "YOUR_SECRET_TOKEN";
curl_global_init(CURL_GLOBAL_DEFAULT);
CURL *curl = curl_easy_init();
if (!curl) {
std::cerr << "curl_easy_init failed\n";
curl_global_cleanup();
return 1;
}
struct curl_slist *headers = nullptr;
headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());
std::string response;
curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/proxies/isps?proxy_type=premium&country_code=text®ion_code=text&city_code=text");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
const CURLcode rc = curl_easy_perform(curl);
if (rc != CURLE_OK) {
std::cerr << curl_easy_strerror(rc) << "\n";
} else {
long status = 0;
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
std::cout << status << "\n" << response << "\n";
}
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
curl_global_cleanup();
return rc == CURLE_OK ? 0 : 1;
}{
"count": 1,
"results": [
{
"code": "text",
"name": "text",
"country": {
"code": "text",
"name": "text"
},
"region": {
"code": "text",
"name": "text"
}
}
]
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}{
"success": true,
"message": "text",
"rejected": true,
"idempotency_state": "in_progress",
"order_id": 1,
"refunded": true
}Last updated on