Datacenter & ISP Proxies

Operations for datacenter and ISP proxies

Get active proxies by order

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

Bearer authentication header of the form Bearer <token>.

Query parameters
order_idintegerrequired
Responses
200Proxy listapplication/json
successbooleanrequired
dataobject · ActiveProxyItem[]required
Show propertiesHide properties
ipstringrequired
usernamestringrequired
passwordstringrequired
http_portintegerrequired
socks_portintegerrequired
untilstringrequired

ISO 8601 date string

statusstringrequired
signaturestring· nullableoptional

p0f signature assigned to the IP, null when not set

order_tagstring· nullableoptional
403Method is unavailable for this orderapplication/json
successbooleanrequired
messagestringrequired
GET/user/api/proxies/active?order_id=1
GET /user/api/proxies/active?order_id=1 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/active?order_id=1' \
  -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/active"
params = {
    "order_id": "1",
}
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/active?order_id=1";

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/active?order_id=1"

	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/active?order_id=1")
        .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/active?order_id=1");

        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/active?order_id=1");
    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": [
    {
      "ip": "text",
      "username": "text",
      "password": "text",
      "http_port": 1,
      "socks_port": 1,
      "until": "text",
      "status": "text",
      "signature": "text"
    }
  ],
  "order_tag": "text"
}
{
  "success": true,
  "message": "text"
}

Set per-IP deletion (del-np)

POSThttps://user-api.proxyshard.com/user/api/orders/{order_id}/del-np/set

Only for Datacenter & ISP proxies. After updating, the order quantity and price_paid are recalculated.

Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Path parameters
order_idintegerrequired
Body
application/json
itemsobject[]required
Show propertiesHide properties
ipstringrequired
valuebooleanrequired
Responses
200Successapplication/json
successbooleanoptional
messagestringoptional
400Validation error / not DC-ISP / keep=0application/json
successbooleanrequired
messagestringrequired
POST/user/api/orders/1/del-np/set
POST /user/api/orders/1/del-np/set HTTP/1.1
Host: user-api.proxyshard.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*

{
  "items": [
    {
      "ip": "text",
      "value": true
    }
  ]
}
curl -X POST 'https://user-api.proxyshard.com/user/api/orders/1/del-np/set' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"items":[{"ip":"text","value":true}]}'
import requests

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

url = "https://user-api.proxyshard.com/user/api/orders/1/del-np/set"
headers = {
    "Authorization": f"Bearer {token}",
}
payload = {
    "items": [
        {
            "ip": "text",
            "value": True,
        },
    ],
}

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/del-np/set";
const payload = {
  "items": [
    {
      "ip": "text",
      "value": true
    }
  ]
};

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/del-np/set"
	body := bytes.NewBufferString(`{
  "items": [
    {
      "ip": "text",
      "value": true
    }
  ]
}`)

	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/del-np/set")
        .header("Authorization", format!("Bearer {token}"))
        .json(&serde_json::json!({
          "items": [
            {
              "ip": "text",
              "value": true
            }
          ]
        }))
        .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/del-np/set");
        request.Content = new StringContent("""
            {
              "items": [
                {
                  "ip": "text",
                  "value": true
                }
              ]
            }
            """, 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({
  "items": [
    {
      "ip": "text",
      "value": true
    }
  ]
})json";

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.proxyshard.com/user/api/orders/1/del-np/set");
    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": "text"
}
{
  "success": true,
  "message": "text"
}

Set the IP OS fingerprint

POSThttps://user-api.proxyshard.com/user/api/orders/{order_id}/signature/set

Sets the OS-fingerprint signature for one or more proxy IPs.
Requires the p0f_slots add-on to be active on the order.

Each IP that receives a signature permanently occupies one slot. Changing the OS value on an IP that already has a signature does not consume an extra slot.

Available signature values:

ValueOS
iosiOS
macosmacOS
androidAndroid
linuxLinux
win10Windows 10
win11Windows 11
Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Path parameters
order_idintegerrequired
Body
application/json
itemsobject[]required
Show propertiesHide properties
ipstringrequired
signaturestring · enumrequired

OS identifier to spoof.

Possible values:iosmacosandroidlinuxwin10win11
Responses
200Successapplication/json
successbooleanoptional
messagestringoptional
updatedintegeroptional

Number of IPs updated

400Validation error or not enough slotsapplication/json
successbooleanrequired
messagestringrequired
POST/user/api/orders/1/signature/set
POST /user/api/orders/1/signature/set HTTP/1.1
Host: user-api.proxyshard.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*

{
  "items": [
    {
      "ip": "text",
      "signature": "ios"
    }
  ]
}
curl -X POST 'https://user-api.proxyshard.com/user/api/orders/1/signature/set' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"items":[{"ip":"text","signature":"ios"}]}'
import requests

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

url = "https://user-api.proxyshard.com/user/api/orders/1/signature/set"
headers = {
    "Authorization": f"Bearer {token}",
}
payload = {
    "items": [
        {
            "ip": "text",
            "signature": "ios",
        },
    ],
}

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/signature/set";
const payload = {
  "items": [
    {
      "ip": "text",
      "signature": "ios"
    }
  ]
};

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/signature/set"
	body := bytes.NewBufferString(`{
  "items": [
    {
      "ip": "text",
      "signature": "ios"
    }
  ]
}`)

	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/signature/set")
        .header("Authorization", format!("Bearer {token}"))
        .json(&serde_json::json!({
          "items": [
            {
              "ip": "text",
              "signature": "ios"
            }
          ]
        }))
        .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/signature/set");
        request.Content = new StringContent("""
            {
              "items": [
                {
                  "ip": "text",
                  "signature": "ios"
                }
              ]
            }
            """, 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({
  "items": [
    {
      "ip": "text",
      "signature": "ios"
    }
  ]
})json";

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.proxyshard.com/user/api/orders/1/signature/set");
    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": "text",
  "updated": 1
}
{
  "success": true,
  "message": "text"
}

Calculate add-on cost

GEThttps://user-api.proxyshard.com/user/api/orders/{order_id}/addons/calculate

Returns the price preview for purchasing additional units of a given add-on for an active datacenter/ISP order. Currently the only supported add-on key is p0f_slots; OS-fingerprint signature slots.

Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Path parameters
order_idintegerrequired

Order ID

Query parameters
addon_keystringrequired

Add-on identifier (e.g. p0f_slots)

add_qtyinteger· min: 1required

Number of units to add

Responses
200Price previewapplication/json
successbooleanoptional
addon_keystringoptional
catalog_idintegeroptional
price_per_unitintegeroptional

Price per unit in cents

current_qtyintegeroptional
add_qtyintegeroptional
new_qtyintegeroptional
add_totalintegeroptional

Total charge for this purchase in cents

GET/user/api/orders/1/addons/calculate?addon_key=text&add_qty=1
GET /user/api/orders/1/addons/calculate?addon_key=text&add_qty=1 HTTP/1.1
Host: user-api.proxyshard.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
curl -X GET 'https://user-api.proxyshard.com/user/api/orders/1/addons/calculate?addon_key=text&add_qty=1' \
  -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/orders/1/addons/calculate"
params = {
    "addon_key": "text",
    "add_qty": "1",
}
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/orders/1/addons/calculate?addon_key=text&add_qty=1";

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/orders/1/addons/calculate?addon_key=text&add_qty=1"

	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/orders/1/addons/calculate?addon_key=text&add_qty=1")
        .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/orders/1/addons/calculate?addon_key=text&add_qty=1");

        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/orders/1/addons/calculate?addon_key=text&add_qty=1");
    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;
}
200Price preview
{
  "success": true,
  "addon_key": "text",
  "catalog_id": 1,
  "price_per_unit": 1,
  "current_qty": 1,
  "add_qty": 1,
  "new_qty": 1,
  "add_total": 1
}

Purchase an add-on

POSThttps://user-api.proxyshard.com/user/api/orders/{order_id}/addons/purchase

Immediately charges the wallet and adds the requested number of add-on units to the order. The order must be active. The only currently available add-on key is p0f_slots.

Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Path parameters
order_idintegerrequired

Order ID

Body
application/json
addon_keystringrequired
add_qtyinteger· min: 1required
Responses
200Add-on purchasedapplication/json
successbooleanoptional
messagestringoptional
addons_price_paidintegeroptional

Cumulative add-on cost for this order (cents)

addonsobject · AddonLine[]optional

Updated add-on list stored on the order

Show propertiesHide properties
addon_keystringoptional
catalog_idintegeroptional
qtyintegeroptional

Units active in the current period

price_per_unitintegeroptional

Unit price in cents at purchase time

pendingobject· nullableoptional

Change scheduled for the next renewal, or null

Show propertiesHide properties
actionstring · enumoptional
Possible values:canceldowngrade
next_qtyintegeroptional

Target quantity after downgrade

POST/user/api/orders/1/addons/purchase
POST /user/api/orders/1/addons/purchase HTTP/1.1
Host: user-api.proxyshard.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*

{
  "addon_key": "text",
  "add_qty": 1
}
curl -X POST 'https://user-api.proxyshard.com/user/api/orders/1/addons/purchase' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"addon_key":"text","add_qty":1}'
import requests

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

url = "https://user-api.proxyshard.com/user/api/orders/1/addons/purchase"
headers = {
    "Authorization": f"Bearer {token}",
}
payload = {
    "addon_key": "text",
    "add_qty": 1,
}

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/addons/purchase";
const payload = {
  "addon_key": "text",
  "add_qty": 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/orders/1/addons/purchase"
	body := bytes.NewBufferString(`{
  "addon_key": "text",
  "add_qty": 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/orders/1/addons/purchase")
        .header("Authorization", format!("Bearer {token}"))
        .json(&serde_json::json!({
          "addon_key": "text",
          "add_qty": 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/orders/1/addons/purchase");
        request.Content = new StringContent("""
            {
              "addon_key": "text",
              "add_qty": 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({
  "addon_key": "text",
  "add_qty": 1
})json";

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.proxyshard.com/user/api/orders/1/addons/purchase");
    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;
}
200Add-on purchased
{
  "success": true,
  "message": "text",
  "addons_price_paid": 1,
  "addons": [
    {
      "addon_key": "text",
      "catalog_id": 1,
      "qty": 1,
      "price_per_unit": 1,
      "pending": {
        "action": "cancel",
        "next_qty": 1
      }
    }
  ]
}

Schedule an add-on downgrade

POSThttps://user-api.proxyshard.com/user/api/orders/{order_id}/addons/schedule

Schedules a downgrade of an add-on to take effect on the next renewal cycle. The new quantity must be lower than the current one. The change is stored as a pending marker and applied automatically when the order renews.

Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Path parameters
order_idintegerrequired

Order ID

Body
application/json
addon_keystringrequired
actionstring · enumrequired
Possible values:downgrade
next_qtyinteger· min: 1required

Target quantity after renewal. Must be less than current qty.

Responses
200Downgrade scheduledapplication/json
successbooleanoptional
messagestringoptional
addonsobject · AddonLine[]optional
Show propertiesHide properties
addon_keystringoptional
catalog_idintegeroptional
qtyintegeroptional

Units active in the current period

price_per_unitintegeroptional

Unit price in cents at purchase time

pendingobject· nullableoptional

Change scheduled for the next renewal, or null

Show propertiesHide properties
actionstring · enumoptional
Possible values:canceldowngrade
next_qtyintegeroptional

Target quantity after downgrade

POST/user/api/orders/1/addons/schedule
POST /user/api/orders/1/addons/schedule HTTP/1.1
Host: user-api.proxyshard.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*

{
  "addon_key": "text",
  "action": "downgrade",
  "next_qty": 1
}
curl -X POST 'https://user-api.proxyshard.com/user/api/orders/1/addons/schedule' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"addon_key":"text","action":"downgrade","next_qty":1}'
import requests

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

url = "https://user-api.proxyshard.com/user/api/orders/1/addons/schedule"
headers = {
    "Authorization": f"Bearer {token}",
}
payload = {
    "addon_key": "text",
    "action": "downgrade",
    "next_qty": 1,
}

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/addons/schedule";
const payload = {
  "addon_key": "text",
  "action": "downgrade",
  "next_qty": 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/orders/1/addons/schedule"
	body := bytes.NewBufferString(`{
  "addon_key": "text",
  "action": "downgrade",
  "next_qty": 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/orders/1/addons/schedule")
        .header("Authorization", format!("Bearer {token}"))
        .json(&serde_json::json!({
          "addon_key": "text",
          "action": "downgrade",
          "next_qty": 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/orders/1/addons/schedule");
        request.Content = new StringContent("""
            {
              "addon_key": "text",
              "action": "downgrade",
              "next_qty": 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({
  "addon_key": "text",
  "action": "downgrade",
  "next_qty": 1
})json";

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.proxyshard.com/user/api/orders/1/addons/schedule");
    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;
}
200Downgrade scheduled
{
  "success": true,
  "message": "text",
  "addons": [
    {
      "addon_key": "text",
      "catalog_id": 1,
      "qty": 1,
      "price_per_unit": 1,
      "pending": {
        "action": "cancel",
        "next_qty": 1
      }
    }
  ]
}

Cancel scheduled downgrade

POSThttps://user-api.proxyshard.com/user/api/orders/{order_id}/addons/schedule/cancel

Removes the pending downgrade that was set via the schedule endpoint.

Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Path parameters
order_idintegerrequired

Order ID

Body
application/json
addon_keystringrequired
Responses
200Pending downgrade clearedapplication/json
successbooleanoptional
messagestringoptional
addonsobject · AddonLine[]optional
Show propertiesHide properties
addon_keystringoptional
catalog_idintegeroptional
qtyintegeroptional

Units active in the current period

price_per_unitintegeroptional

Unit price in cents at purchase time

pendingobject· nullableoptional

Change scheduled for the next renewal, or null

Show propertiesHide properties
actionstring · enumoptional
Possible values:canceldowngrade
next_qtyintegeroptional

Target quantity after downgrade

POST/user/api/orders/1/addons/schedule/cancel
POST /user/api/orders/1/addons/schedule/cancel HTTP/1.1
Host: user-api.proxyshard.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*

{
  "addon_key": "text"
}
curl -X POST 'https://user-api.proxyshard.com/user/api/orders/1/addons/schedule/cancel' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"addon_key":"text"}'
import requests

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

url = "https://user-api.proxyshard.com/user/api/orders/1/addons/schedule/cancel"
headers = {
    "Authorization": f"Bearer {token}",
}
payload = {
    "addon_key": "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/addons/schedule/cancel";
const payload = {
  "addon_key": "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/addons/schedule/cancel"
	body := bytes.NewBufferString(`{
  "addon_key": "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/addons/schedule/cancel")
        .header("Authorization", format!("Bearer {token}"))
        .json(&serde_json::json!({
          "addon_key": "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/addons/schedule/cancel");
        request.Content = new StringContent("""
            {
              "addon_key": "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({
  "addon_key": "text"
})json";

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.proxyshard.com/user/api/orders/1/addons/schedule/cancel");
    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;
}
200Pending downgrade cleared
{
  "success": true,
  "message": "text",
  "addons": [
    {
      "addon_key": "text",
      "catalog_id": 1,
      "qty": 1,
      "price_per_unit": 1,
      "pending": {
        "action": "cancel",
        "next_qty": 1
      }
    }
  ]
}

Last updated on

On this page

Datacenter & ISP Proxies | ProxyShard Docs