IPRoyal Documentation
EN
EN
  • Overview
  • PROXIES
    • Residential
      • Dashboard
        • Statistics
        • Configuration
          • Automatic Top-Up
          • Proxy Access
          • Whitelisting IPs
          • IP Skipping
          • Allowances
        • Orders
        • Subscription
        • Sub-Users
      • Proxy
        • Location
        • Rotation
        • High-End Pool
        • Skipping Static ISP
        • IP Whitelisting
        • IP Skipping
        • Allowances
        • Protocols
        • Making Requests
      • Sub-Users
      • API
        • Sessions
        • User
        • Access
        • Sub-Users
        • Whitelists
        • IP Skipping
      • Domain Access Terms
    • ISP (Static Residential)
      • Dashboard
        • Orders
        • Order Configuration
        • Extending an Order
      • Using Proxy Strings
      • API
        • User
        • Products
        • Orders
        • Proxies
    • Datacenter
      • Dashboard
        • Orders
        • Order Configuration
        • Extending an Order
      • Using Proxy Strings
      • API
        • User
        • Products
        • Orders
        • Proxies
    • Mobile
      • Dashboard
        • Orders
        • Order Configuration
        • Extending an Order
      • Using Proxy Strings
      • Troubleshooting
      • API
        • User
        • Proxies
  • Dashboard
    • User Management
Powered by GitBook
On this page
  • Get Proxy Availability
  • Change Credentials
Export as PDF
  1. PROXIES
  2. ISP (Static Residential)
  3. API

Proxies

Get Proxy Availability

GET /access/availability/static-residential

Returns a list of countries with available proxies count.

To use this feature, the admin must enable it. This feature requires a minimum total spend of $10000.

Example request:

curl -X GET "https://apid.iproyal.com/v1/reseller/access/availability/static-residential" \
     -H "X-Access-Token: <your_access_token>" \
     -H "Content-Type: application/json"
<?php
$api_token = '<your_access_token>';

$url = "https://apid.iproyal.com/v1/reseller/access/availability/static-residential";

$options = [
    CURLOPT_URL => $url,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "X-Access-Token: $api_token",
        'Content-Type: application/json'
    ]
];

$ch = curl_init();
curl_setopt_array($ch, $options);
$response = curl_exec($ch);

if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
} else {
    echo $response;
}

curl_close($ch);
?>
import requests

api_token = '<your_access_token>'
url = 'https://apid.iproyal.com/v1/reseller/access/availability/static-residential'

headers = {
    'X-Access-Token': api_token,
    'Content-Type': 'application/json'
}

response = requests.get(url, headers=headers)

print(response.status_code)
print(response.json())
const https = require('https');

const api_token = '<your_access_token>';

const options = {
  hostname: 'apid.iproyal.com',
  path: '/v1/reseller/access/availability/static-residential',
  method: 'GET',
  headers: {
    'X-Access-Token': api_token,
    'Content-Type': 'application/json'
  }
};

const req = https.request(options, (res) => {
  let responseData = '';

  res.on('data', (chunk) => {
    responseData += chunk;
  });

  res.on('end', () => {
    console.log(responseData);
  });
});

req.on('error', (error) => {
  console.error('Error:', error.message);
});

req.end();
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

public class ApiRequest {
    public static void main(String[] args) {
        String apiToken = "<your_access_token>";
        String urlString = "https://apid.iproyal.com/v1/reseller/access/availability/static-residential";

        try {
            URL url = new URL(urlString);
            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
            connection.setRequestMethod("GET");
            connection.setRequestProperty("X-Access-Token", apiToken);
            connection.setRequestProperty("Content-Type", "application/json");

            int responseCode = connection.getResponseCode();
            System.out.println("Response Code: " + responseCode);

            if (responseCode == HttpURLConnection.HTTP_OK) {
                BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
                String inputLine;
                StringBuilder content = new StringBuilder();

                while ((inputLine = in.readLine()) != null) {
                    content.append(inputLine);
                }
                in.close();

                System.out.println("Response Body: " + content.toString());
            } else {
                System.out.println("GET request failed. Response Code: " + responseCode);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
package main

import (
	"encoding/json"
	"fmt"
	"io"
	"log"
	"net/http"
)

const (
	apiToken = "<your_access_token>"
	url      = "https://apid.iproyal.com/v1/reseller/access/availability/static-residential"
)

func main() {
	req, err := http.NewRequest(http.MethodGet, url, nil)
	if err != nil {
		log.Fatal("Error creating request:", err)
	}

	req.Header.Set("X-Access-Token", apiToken)
	req.Header.Set("Content-Type", "application/json")

	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		log.Fatal("Error making request:", err)
	}
	defer resp.Body.Close()

	fmt.Println("Status Code:", resp.StatusCode)

	responseBody, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal("Error reading response body:", err)
	}

	var jsonResponse map[string]interface{}
	err = json.Unmarshal(responseBody, &jsonResponse)
	if err != nil {
		log.Fatal("Error unmarshaling JSON:", err)
	}

	fmt.Printf("%+v\n", jsonResponse)
}
using System;
using System.Net.Http;
using System.Text.Json;
using System.Threading.Tasks;

class Program
{
    static async Task Main(string[] args)
    {
        string apiToken = "<your_access_token>";
        string url = "https://apid.iproyal.com/v1/reseller/access/availability/static-residential";

        using (HttpClient client = new HttpClient())
        {
            client.DefaultRequestHeaders.Add("X-Access-Token", apiToken);

            HttpResponseMessage response = await client.GetAsync(url);

            Console.WriteLine((int)response.StatusCode);

            string responseText = await response.Content.ReadAsStringAsync();
            var jsonResponse = JsonSerializer.Deserialize<JsonElement>(responseText);
            Console.WriteLine(jsonResponse);
        }
    }
}

Example response:

{
    "data": [
        {
            "country_code": "DE",
            "country_name": "Germany",
            "available_ips": 2887
        },
        {
            "country_code": "GB",
            "country_name": "United Kingdom",
            "available_ips": 2351
        },
        {
            "country_code": "US",
            "country_name": "United States",
            "available_ips": 1112
        },
        {
            "country_code": "NL",
            "country_name": "Netherlands",
            "available_ips": 1293
        },
        {
            "country_code": "IT",
            "country_name": "Italy",
            "available_ips": 1812
        },
        ...
    ]
}

Change Credentials

POST /orders/proxies/change-credentials

Body Parameters

Name
Type
Description

order_id

Integer

Order id

proxies

Array

List of proxies

username

String

Proxy connection username

password

String

Proxy connection password

random_password

Boolean

Should we assign a random password

is_reset

Boolean

Should we assign a random username and password

Example request:

curl -X POST "https://apid.iproyal.com/v1/reseller/orders/proxies/change-credentials" \
     -H "X-Access-Token: <your_access_token>" \
     -H "Content-Type: application/json" \
     -d '{
           "order_id": 12345,
           "username": "new_username",
           "password": "new_password",
           "random_password": false,
           "is_reset": true,
           "proxies": ["proxy1", "proxy2"]
         }'
<?php
$api_token = '<your_access_token>';
$order_id = 12345;
$proxies = ['proxy1', 'proxy2'];
$username = 'new_username';
$password = 'new_password';
$random_password = false;
$is_reset = true;

$url = "https://apid.iproyal.com/v1/reseller/orders/proxies/change-credentials";

$options = [
    CURLOPT_URL => $url,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "X-Access-Token: $api_token",
        'Content-Type: application/json'
    ],
    CURLOPT_POST => true,
    CURLOPT_POSTFIELDS => json_encode([
        'proxies' => $proxies,
        'order_id' => $order_id,
        'username' => $username,
        'password' => $password,
        'random_password' => $random_password,
        'is_reset' => $is_reset,
    ])
];

$ch = curl_init();
curl_setopt_array($ch, $options);
$response = curl_exec($ch);

if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
} else {
    echo $response;
}

curl_close($ch);
?>
import requests

api_token = '<your_access_token>'
order_id = 12345
proxies = ['proxy1', 'proxy2']
username = 'new_username'
password = 'new_username'
random_password = False
is_reset = True

url = 'https://apid.iproyal.com/v1/reseller/orders/proxies/change-credentials'

headers = {
    'X-Access-Token': api_token,
    'Content-Type': 'application/json'
}

payload = {
    'order_id': order_id,
    'proxies': proxies,
    'username': username,
    'password': password,
    'random_password': random_password,
    'is_reset': is_reset
}

response = requests.post(url, json=payload, headers=headers)

print(response.status_code)
print(response.json())
const https = require('https');

const api_token = '<your_access_token>';
const order_id = 12345;
const proxies = ['proxy1', 'proxy2'];
const username = 'new_username';
const password = 'new_password';
const random_password = false;
const is_reset = true;

const data = JSON.stringify({
    order_id: order_id,
    proxies: proxies,
    username: username,
    password: password,
    random_password: random_password,
    is_reset: is_reset
});

const options = {
    hostname: 'apid.iproyal.com',
    path: '/v1/reseller/orders/proxies/change-credentials',
    method: 'POST',
    headers: {
        'X-Access-Token': api_token,
        'Content-Type': 'application/json',
    }
};

const req = https.request(options, (res) => {
    let responseData = '';

    res.on('data', (chunk) => {
        responseData += chunk;
    });

    res.on('end', () => {
        console.log(responseData);
    });
});

req.on('error', (error) => {
    console.error('Error:', error.message);
});

req.write(data);
req.end();
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Main {
    public static void main(String[] args) throws Exception {
        String accessToken = "<your_access_token>";
        String url = "https://apid.iproyal.com/v1/reseller/orders/proxies/change-credentials";

        String requestBody = """
            {
                "order_id": 12345,
                "username": "new_username",
                "password": "new_password",
                "random_password": false,
                "is_reset": true,
                "proxies": ["proxy1", "proxy2"]
            }
        """;

        HttpClient client = HttpClient.newHttpClient();
        HttpRequest request = HttpRequest.newBuilder()
                .uri(URI.create(url))
                .header("Content-Type", "application/json")
                .header("X-Access-Token", accessToken)
                .POST(HttpRequest.BodyPublishers.ofString(requestBody))
                .build();

        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());

        System.out.println("Response Code: " + response.statusCode());
        System.out.println("Response Body: " + response.body());
    }
}
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io"
	"log"
	"net/http"
)

const (
	apiToken = "<your_access_token>"
)

func main() {
	proxies := []string{"proxy1", "proxy2"}
	orderID := 12345
	username := "new_username"
	password := "new_password"
	randomPassword := false
	isReset := true

	requestBody := map[string]interface{}{
		"order_id":        orderID,
		"username":        username,
		"password":        password,
		"random_password": randomPassword,
		"is_reset":        isReset,
		"proxies":         proxies,
	}

	jsonData, err := json.Marshal(requestBody)
	if err != nil {
		log.Fatal("Error marshaling JSON:", err)
	}

	url := "https://apid.iproyal.com/v1/reseller/orders/proxies/change-credentials"
	req, err := http.NewRequest(http.MethodPost, url, bytes.NewBuffer(jsonData))
	if err != nil {
		log.Fatal("Error creating request:", err)
	}

	req.Header.Set("X-Access-Token", apiToken)
	req.Header.Set("Content-Type", "application/json")

	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		log.Fatal("Error making request:", err)
	}
	defer resp.Body.Close()

	fmt.Println("Status Code:", resp.StatusCode)

	responseBody, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal("Error reading response body:", err)
	}

	var jsonResponse map[string]interface{}
	err = json.Unmarshal(responseBody, &jsonResponse)
	if err != nil {
		log.Fatal("Error unmarshaling JSON:", err)
	}

	fmt.Printf("%+v\n", jsonResponse)
}
using System;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;

class Program
{
    static async Task Main(string[] args)
    {
        string apiToken = "<your_access_token>";
        
        var requestBody = new
        {
            order_id = 12345,
            username = "new_username",
            password = "new_password",
            random_password = false,
            is_reset = true,
            proxies = new string[] { "proxy1", "proxy2" }
        };

        string url = "https://apid.iproyal.com/v1/reseller/orders/proxies/change-credentials";

        using (HttpClient client = new HttpClient())
        {
            client.DefaultRequestHeaders.Add("X-Access-Token", apiToken);
            
            var jsonData = JsonSerializer.Serialize(requestBody);
            var content = new StringContent(jsonData, Encoding.UTF8, "application/json");

            HttpResponseMessage response = await client.PostAsync(url, content);

            Console.WriteLine((int)response.StatusCode);

            string responseText = await response.Content.ReadAsStringAsync();
            var jsonResponse = JsonSerializer.Deserialize<JsonElement>(responseText);
            Console.WriteLine(jsonResponse);
        }
    }
}

PreviousOrdersNextDatacenter

Last updated 1 month ago