Residential Proxies

Операции для резидентских прокси

Купить дополнительный трафик (Residential)

POSThttps://user-api.proxyshard.com/user/api/orders/{id}/add-bandwidth
Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Path parameters
idintegerrequired
Body
application/json
amountintegerrequired

Объём в ГБ

promo_codestring· nullableoptional
Responses
200Успешноapplication/json
successbooleanrequired
messagestringrequired
POST/user/api/orders/1/add-bandwidth
POST /user/api/orders/1/add-bandwidth HTTP/1.1
Host: user-api.proxyshard.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*

{
  "amount": 1,
  "promo_code": "text"
}
curl -X POST 'https://user-api.proxyshard.com/user/api/orders/1/add-bandwidth' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  -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.proxyshard.com/user/api/orders/1/add-bandwidth"
headers = {
    "Authorization": f"Bearer {token}",
}
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.proxyshard.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}`,
    "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.proxyshard.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("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.proxyshard.com/user/api/orders/1/add-bandwidth")
        .header("Authorization", format!("Bearer {token}"))
        .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.proxyshard.com/user/api/orders/1/add-bandwidth");
        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, "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.proxyshard.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;
}
200Успешно
{
  "success": true,
  "message": "Order paid successfully"
}

Трафик владельца аккаунта

GEThttps://user-api.proxyshard.com/user/api/proxies/profile

Возвращает общие и оставшиеся данные родительского аккаунта для данного типа прокси, агрегированные по родительским заказам. В отличие от конечных точек субпользователя, здесь отражаются данные владельца учетной записи, а не субпользователя.

Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Query parameters
proxy_typestringrequired

Тип прокси (стандарт | премиум)

Responses
200Успехapplication/json
successbooleanrequired
dataintegerrequired

Общее количество выделенных данных в байтах

data_remainintegerrequired

Оставшиеся данные в байтах

data_spentintegerrequired

Потребляемые данные в байтах

proxy_passwordstringrequired

Пароль прокси-сервера родительской учетной записи

400Резидент пользователя не установлен/неверный тип проксиapplication/json
successbooleanrequired
messagestringrequired
401Требуется авторизацияapplication/json
successbooleanrequired
messagestringrequired
GET/user/api/proxies/profile?proxy_type=text
GET /user/api/proxies/profile?proxy_type=text HTTP/1.1
Host: user-api.proxyshard.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
curl -X GET 'https://user-api.proxyshard.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.proxyshard.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.proxyshard.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.proxyshard.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.proxyshard.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.proxyshard.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.proxyshard.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"
}
{
  "success": true,
  "message": "text"
}

Список саб-пользователей

GEThttps://user-api.proxyshard.com/user/api/proxies/sub-users
Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Query parameters
proxy_typestringrequired

Тип прокси (standart | premium)

offsetintegeroptional
limitintegeroptional
Responses
200Успешноapplication/json
successbooleanoptional
countintegeroptional

Всего подпользователей до разбиения на страницы

dataobject[]optional
Show propertiesHide properties
user_idstringrequired
first_namestringrequired
proxy_passwordstringrequired
dataintegerrequired
data_spentintegerrequired
data_remainintegerrequired
GET/user/api/proxies/sub-users?proxy_type=text
GET /user/api/proxies/sub-users?proxy_type=text HTTP/1.1
Host: user-api.proxyshard.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
curl -X GET 'https://user-api.proxyshard.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.proxyshard.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.proxyshard.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.proxyshard.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.proxyshard.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.proxyshard.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.proxyshard.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;
}
200Успешно
{
  "success": true,
  "count": 1,
  "data": [
    {
      "user_id": "text",
      "first_name": "text",
      "proxy_password": "text",
      "data": 1,
      "data_spent": 1,
      "data_remain": 1
    }
  ]
}

Получить саб-пользователя по ID

GEThttps://user-api.proxyshard.com/user/api/proxies/sub-user/{user_id}
Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Path parameters
user_idstringrequired
Query parameters
proxy_typestringrequired

Тип прокси (standart | premium)

Responses
200Успешноapplication/json
successbooleanoptional
dataobject[]optional
Show propertiesHide properties
first_namestringrequired
proxy_passwordstringrequired
dataintegerrequired
data_spentintegerrequired
GET/user/api/proxies/sub-user/text?proxy_type=text
GET /user/api/proxies/sub-user/text?proxy_type=text HTTP/1.1
Host: user-api.proxyshard.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
curl -X GET 'https://user-api.proxyshard.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.proxyshard.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.proxyshard.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.proxyshard.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.proxyshard.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.proxyshard.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.proxyshard.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;
}
200Успешно
{
  "success": true,
  "data": [
    {
      "first_name": "text",
      "proxy_password": "text",
      "data": 1,
      "data_spent": 1
    }
  ]
}

Удалить саб-пользователя

DELhttps://user-api.proxyshard.com/user/api/proxies/sub-user/{user_id}
Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Path parameters
user_idstringrequired
Responses
200Успешноapplication/json
successbooleanrequired
messagestringrequired
DEL/user/api/proxies/sub-user/text
DELETE /user/api/proxies/sub-user/text HTTP/1.1
Host: user-api.proxyshard.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
curl -X DELETE 'https://user-api.proxyshard.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.proxyshard.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.proxyshard.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.proxyshard.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.proxyshard.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.proxyshard.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.proxyshard.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;
}
200Успешно
{
  "success": true,
  "message": "Sub user deleted successfully"
}

Редактировать саб-пользователя (имя/пакет)

PATCHhttps://user-api.proxyshard.com/user/api/proxies/sub-user/{user_id}
Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Path parameters
user_idstringrequired
Query parameters
proxy_typestringrequired

Тип прокси (standart | premium)

Body
application/json
namestringrequired
Responses
200Успешноapplication/json
successbooleanrequired
messagestringrequired
PATCH/user/api/proxies/sub-user/text?proxy_type=text
PATCH /user/api/proxies/sub-user/text?proxy_type=text HTTP/1.1
Host: user-api.proxyshard.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*

{
  "name": "text"
}
curl -X PATCH 'https://user-api.proxyshard.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.proxyshard.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.proxyshard.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.proxyshard.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.proxyshard.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.proxyshard.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.proxyshard.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;
}
200Успешно
{
  "success": true,
  "message": "Sub user edited successfully"
}

Создать саб-пользователя

POSThttps://user-api.proxyshard.com/user/api/proxies/sub-user
Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Query parameters
proxy_typestringrequired

Тип прокси (standart | premium)

Body
application/json
namestringrequired
dataintegerrequired
Responses
200Успешноapplication/json
successbooleanoptional
dataobject[]optional
Show propertiesHide properties
user_idstringrequired
first_namestringrequired
proxy_passwordstringrequired
dataintegerrequired
data_spentintegerrequired
POST/user/api/proxies/sub-user?proxy_type=text
POST /user/api/proxies/sub-user?proxy_type=text HTTP/1.1
Host: user-api.proxyshard.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*

{
  "name": "text",
  "data": 1
}
curl -X POST 'https://user-api.proxyshard.com/user/api/proxies/sub-user?proxy_type=text' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"name":"text","data":1}'
import requests

# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"

url = "https://user-api.proxyshard.com/user/api/proxies/sub-user"
params = {
    "proxy_type": "text",
}
headers = {
    "Authorization": f"Bearer {token}",
}
payload = {
    "name": "text",
    "data": 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.proxyshard.com/user/api/proxies/sub-user?proxy_type=text";
const payload = {
  "name": "text",
  "data": 1
};

const response = await fetch(url, {
  method: "POST",
  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.proxyshard.com/user/api/proxies/sub-user?proxy_type=text"
	body := bytes.NewBufferString(`{
  "name": "text",
  "data": 1
}`)

	req, err := http.NewRequest("POST", 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
        .post("https://user-api.proxyshard.com/user/api/proxies/sub-user?proxy_type=text")
        .header("Authorization", format!("Bearer {token}"))
        .json(&serde_json::json!({
          "name": "text",
          "data": 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.proxyshard.com/user/api/proxies/sub-user?proxy_type=text");
        request.Content = new StringContent("""
            {
              "name": "text",
              "data": 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, "Content-Type: application/json");

    const std::string body = R"json({
  "name": "text",
  "data": 1
})json";

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.proxyshard.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;
}
200Успешно
{
  "success": true,
  "data": [
    {
      "user_id": "text",
      "first_name": "text",
      "proxy_password": "text",
      "data": 1,
      "data_spent": 1
    }
  ]
}

Добавить трафик саб-пользователю

POSThttps://user-api.proxyshard.com/user/api/proxies/sub-user/{user_id}/data/add
Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Path parameters
user_idstringrequired
Query parameters
proxy_typestringrequired

Тип прокси (standart | premium)

Body
application/json
dataintegerrequired

Объём в ГБ

Responses
200Успешноapplication/json
successbooleanrequired
messagestringrequired
POST/user/api/proxies/sub-user/text/data/add?proxy_type=text
POST /user/api/proxies/sub-user/text/data/add?proxy_type=text HTTP/1.1
Host: user-api.proxyshard.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*

{
  "data": 1
}
curl -X POST 'https://user-api.proxyshard.com/user/api/proxies/sub-user/text/data/add?proxy_type=text' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"data":1}'
import requests

# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"

url = "https://user-api.proxyshard.com/user/api/proxies/sub-user/text/data/add"
params = {
    "proxy_type": "text",
}
headers = {
    "Authorization": f"Bearer {token}",
}
payload = {
    "data": 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.proxyshard.com/user/api/proxies/sub-user/text/data/add?proxy_type=text";
const payload = {
  "data": 1
};

const response = await fetch(url, {
  method: "POST",
  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.proxyshard.com/user/api/proxies/sub-user/text/data/add?proxy_type=text"
	body := bytes.NewBufferString(`{
  "data": 1
}`)

	req, err := http.NewRequest("POST", 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
        .post("https://user-api.proxyshard.com/user/api/proxies/sub-user/text/data/add?proxy_type=text")
        .header("Authorization", format!("Bearer {token}"))
        .json(&serde_json::json!({
          "data": 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.proxyshard.com/user/api/proxies/sub-user/text/data/add?proxy_type=text");
        request.Content = new StringContent("""
            {
              "data": 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, "Content-Type: application/json");

    const std::string body = R"json({
  "data": 1
})json";

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.proxyshard.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;
}
200Успешно
{
  "success": true,
  "message": "Traffic added to sub user successfully"
}

Списать трафик у саб-пользователя

POSThttps://user-api.proxyshard.com/user/api/proxies/sub-user/{user_id}/data/subtract
Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Path parameters
user_idstringrequired
Query parameters
proxy_typestringrequired

Тип прокси (standart | premium)

Body
application/json
dataintegerrequired

Объём в ГБ

Responses
200Успешноapplication/json
successbooleanrequired
messagestringrequired
POST/user/api/proxies/sub-user/text/data/subtract?proxy_type=text
POST /user/api/proxies/sub-user/text/data/subtract?proxy_type=text HTTP/1.1
Host: user-api.proxyshard.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*

{
  "data": 1
}
curl -X POST 'https://user-api.proxyshard.com/user/api/proxies/sub-user/text/data/subtract?proxy_type=text' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"data":1}'
import requests

# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"

url = "https://user-api.proxyshard.com/user/api/proxies/sub-user/text/data/subtract"
params = {
    "proxy_type": "text",
}
headers = {
    "Authorization": f"Bearer {token}",
}
payload = {
    "data": 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.proxyshard.com/user/api/proxies/sub-user/text/data/subtract?proxy_type=text";
const payload = {
  "data": 1
};

const response = await fetch(url, {
  method: "POST",
  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.proxyshard.com/user/api/proxies/sub-user/text/data/subtract?proxy_type=text"
	body := bytes.NewBufferString(`{
  "data": 1
}`)

	req, err := http.NewRequest("POST", 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
        .post("https://user-api.proxyshard.com/user/api/proxies/sub-user/text/data/subtract?proxy_type=text")
        .header("Authorization", format!("Bearer {token}"))
        .json(&serde_json::json!({
          "data": 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.proxyshard.com/user/api/proxies/sub-user/text/data/subtract?proxy_type=text");
        request.Content = new StringContent("""
            {
              "data": 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, "Content-Type: application/json");

    const std::string body = R"json({
  "data": 1
})json";

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.proxyshard.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;
}
200Успешно
{
  "success": true,
  "message": "Traffic subtracted from sub user successfully"
}

Сменить пароль саб-пользователя

POSThttps://user-api.proxyshard.com/user/api/proxies/sub-user/{user_id}/password
Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Path parameters
user_idstringrequired
Query parameters
proxy_typestringrequired

Тип прокси (standart | premium)

Responses
200Успешноapplication/json
successbooleanrequired
messagestringrequired
POST/user/api/proxies/sub-user/text/password?proxy_type=text
POST /user/api/proxies/sub-user/text/password?proxy_type=text HTTP/1.1
Host: user-api.proxyshard.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
curl -X POST 'https://user-api.proxyshard.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.proxyshard.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.proxyshard.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.proxyshard.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.proxyshard.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.proxyshard.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.proxyshard.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;
}
200Успешно
{
  "success": true,
  "message": "Sub user password changed successfully"
}

Список стран

GEThttps://user-api.proxyshard.com/user/api/proxies/countries
Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Query parameters
proxy_typestringrequired

Тип прокси (standart | premium)

Responses
200Успешноapplication/json
countintegerrequired
resultsobject · Country[]required
Show propertiesHide properties
codestring· max length: 10required

Код страны ISO

namestring· max length: 255required

Название страны

GET/user/api/proxies/countries?proxy_type=text
GET /user/api/proxies/countries?proxy_type=text HTTP/1.1
Host: user-api.proxyshard.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
curl -X GET 'https://user-api.proxyshard.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.proxyshard.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.proxyshard.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.proxyshard.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.proxyshard.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.proxyshard.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.proxyshard.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;
}
200Успешно
{
  "count": 1,
  "results": [
    {
      "code": "text",
      "name": "text"
    }
  ]
}

Список регионов

GEThttps://user-api.proxyshard.com/user/api/proxies/regions
Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Query parameters
proxy_typestringrequired

Тип прокси (standart | premium)

country_codestringrequired

ISO код страны

Responses
200Успешноapplication/json
countintegerrequired
resultsobject · Region[]required
Show propertiesHide properties
codestring· max length: 10required

Код региона или штата

namestring· max length: 255required

Название региона или штата

countryobject · Countryrequired
Show propertiesHide properties
codestring· max length: 10required

Код страны ISO

namestring· max length: 255required

Название страны

GET/user/api/proxies/regions?proxy_type=text&country_code=text
GET /user/api/proxies/regions?proxy_type=text&country_code=text HTTP/1.1
Host: user-api.proxyshard.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
curl -X GET 'https://user-api.proxyshard.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.proxyshard.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.proxyshard.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.proxyshard.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.proxyshard.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.proxyshard.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.proxyshard.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;
}
200Успешно
{
  "count": 1,
  "results": [
    {
      "code": "text",
      "name": "text",
      "country": {
        "code": "text",
        "name": "text"
      }
    }
  ]
}

Список городов

GEThttps://user-api.proxyshard.com/user/api/proxies/cities
Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Query parameters
proxy_typestringrequired

Тип прокси (standart | premium)

country_codestringrequired

ISO код страны

region_codestringrequired

Код региона (штата/провинции)

Responses
200Успешноapplication/json
countintegerrequired
resultsobject · City[]required
Show propertiesHide properties
codestring· max length: 50required

Код города, обычно в формате slug

namestring· max length: 255required

Название города

countryobject · Countryrequired
Show propertiesHide properties
codestring· max length: 10required

Код страны ISO

namestring· max length: 255required

Название страны

regionobject· nullableoptional
Show propertiesHide properties
codestring· max length: 10required

Код региона

namestring· max length: 255required

Название региона

GET/user/api/proxies/cities?proxy_type=text&country_code=text&region_code=text
GET /user/api/proxies/cities?proxy_type=text&country_code=text&region_code=text HTTP/1.1
Host: user-api.proxyshard.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
curl -X GET 'https://user-api.proxyshard.com/user/api/proxies/cities?proxy_type=text&country_code=text&region_code=text' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN'
import requests

# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"

url = "https://user-api.proxyshard.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.proxyshard.com/user/api/proxies/cities?proxy_type=text&country_code=text&region_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.proxyshard.com/user/api/proxies/cities?proxy_type=text&country_code=text&region_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.proxyshard.com/user/api/proxies/cities?proxy_type=text&country_code=text&region_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.proxyshard.com/user/api/proxies/cities?proxy_type=text&country_code=text&region_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.proxyshard.com/user/api/proxies/cities?proxy_type=text&country_code=text&region_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;
}
200Успешно
{
  "count": 1,
  "results": [
    {
      "code": "text",
      "name": "text",
      "country": {
        "code": "text",
        "name": "text"
      },
      "region": {
        "code": "text",
        "name": "text"
      }
    }
  ]
}

Список интернет-провайдеров

GEThttps://user-api.proxyshard.com/user/api/proxies/isps

Интернет-провайдеры, доступные внутри города; четвертый уровень таргетинга после страны, региона и города. В отличие от других конечных точек местоположения, для этой требуется полная цепочка: country_code, region_code и city_code необходимы, поскольку вышестоящие интернет-провайдеры привязаны к городу. Только пакет «Премиум»: каталог интернет-провайдеров не поддерживается для стандартных и безлимитных пакетов, а любой другой proxy_type отклоняется с кодом 400. Интернет-провайдеры указаны только для крупных городов, поэтому пустой results с count: 0 является нормальным ответом для меньшего города.

Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Query parameters
proxy_typestring · enumrequired

Должно быть premium; Таргетинг на интернет-провайдеров доступен только для премиум-класса.

Possible values:premium
country_codestringrequired

Код страны ISO

region_codestringrequired

Код региона или штата

city_codestringrequired

Код города из GET /user/api/proxy/cities.

Responses
200Успехapplication/json
countintegerrequired
resultsobject · Isp[]required
Show propertiesHide properties
codestringrequired

Код интернет-провайдера, обычно в формате slug

namestringrequired

Имя интернет-провайдера

countryobject · Countryrequired
Show propertiesHide properties
codestring· max length: 10required

Код страны ISO

namestring· max length: 255required

Название страны

regionobject· nullableoptional
Show propertiesHide properties
codestringrequired

Код региона

namestringrequired

Название региона

400proxy_type не `premium`, резидентность пользователя не установлена ​​или у пользователя нет активного заказа на пакет.application/json
successbooleanrequired
messagestringrequired
401Требуется авторизацияapplication/json
successbooleanrequired
messagestringrequired
GET/user/api/proxies/isps?proxy_type=premium&country_code=text&region_code=text&city_code=text
GET /user/api/proxies/isps?proxy_type=premium&country_code=text&region_code=text&city_code=text HTTP/1.1
Host: user-api.proxyshard.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
curl -X GET 'https://user-api.proxyshard.com/user/api/proxies/isps?proxy_type=premium&country_code=text&region_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.proxyshard.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.proxyshard.com/user/api/proxies/isps?proxy_type=premium&country_code=text&region_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.proxyshard.com/user/api/proxies/isps?proxy_type=premium&country_code=text&region_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.proxyshard.com/user/api/proxies/isps?proxy_type=premium&country_code=text&region_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.proxyshard.com/user/api/proxies/isps?proxy_type=premium&country_code=text&region_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.proxyshard.com/user/api/proxies/isps?proxy_type=premium&country_code=text&region_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": false,
  "message": "ISP targeting is available for the premium package only"
}
{
  "success": true,
  "message": "text"
}

Обновлено

На этой странице