> For the complete documentation index, see [llms.txt](https://docs.iproyal.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.iproyal.com/proxies/sneaker-dc/api/proxies.md).

# Proxies

## Get Proxy Availability

<mark style="color:green;">`GET`</mark>  `/access/availability/sneaker-dc`

Returns a list of countries with available proxies count.

{% hint style="warning" %}
To use this feature, the admin must enable it. This feature requires a minimum total spend of $10000.
{% endhint %}

**Example request:**

{% tabs %}
{% tab title="cURL" %}

```
curl -X GET "https://apid.iproyal.com/v1/reseller/access/availability/sneaker-dc" \
     -H "X-Access-Token: <your_access_token>" \
     -H "Content-Type: application/json"
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$api_token = '<your_access_token>';

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

$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);
?>

```

{% endtab %}

{% tab title="Python" %}

```python
import requests

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

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

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

print(response.status_code)
print(response.json())
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
const https = require('https');

const api_token = '<your_access_token>';

const options = {
  hostname: 'apid.iproyal.com',
  path: '/v1/reseller/access/availability/sneaker-dc',
  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();
```

{% endtab %}

{% tab title="Java" %}

```java
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/sneaker-dc";

        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();
        }
    }
}
```

{% endtab %}

{% tab title="Go" %}

```go
package main

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

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

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)
}
```

{% endtab %}

{% tab title="C#" %}

```csharp
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/sneaker-dc";

        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);
        }
    }
}
```

{% endtab %}
{% endtabs %}

**Example response:**

```json
{
    "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

<mark style="color:green;">`GET`</mark>  `/orders/proxies/change-credentials`

**Body Parameters**

<table><thead><tr><th width="257">Name</th><th width="114">Type</th><th>Description</th></tr></thead><tbody><tr><td>order_id</td><td>Integer</td><td>Order id</td></tr><tr><td>proxies</td><td>Array</td><td>List of proxies</td></tr><tr><td>username</td><td>String</td><td>Proxy connection username</td></tr><tr><td>password</td><td>String</td><td>Proxy connection password</td></tr><tr><td>random_password</td><td>Boolean</td><td>Should we assign a random password</td></tr><tr><td>is_reset</td><td>Boolean</td><td>Should we assign a random username and password</td></tr></tbody></table>

**Example request:**

{% tabs %}
{% tab title="cURL" %}

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

{% endtab %}

{% tab title="PHP" %}

```php
<?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?order_id=$order_id&username=$username&password=$password&random_password=$random_password&is_reset=$is_reset";

$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])
];

$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);
?>

```

{% endtab %}

{% tab title="Python" %}

```python
import requests

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

url = f'https://apid.iproyal.com/v1/reseller/orders/proxies/change-credentials?order_id={order_id}&username={username}&password={password}&random_password={random_password}&is_reset={is_reset}'

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

response = requests.get(url, json={'proxies': proxies}, headers=headers)

print(response.status_code)
print(response.json())
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
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({
  proxies: proxies
});

const options = {
  hostname: 'apid.iproyal.com',
  path: `/v1/reseller/orders/proxies/change-credentials?order_id=${order_id}&username=${username}&password=${password}&random_password=${random_password}&is_reset=${is_reset}`,
  method: 'GET',
  headers: {
    'X-Access-Token': api_token,
    'Content-Type': 'application/json',
    'Content-Length': data.length
  }
};

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();
```

{% endtab %}

{% tab title="Java" %}

```java
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" +
                "?order_id=12345&username=new_username&password=new_password&random_password=false&is_reset=true";
        
        String requestBody = """
            {
                "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());
    }
}
```

{% endtab %}

{% tab title="Go" %}

```go
package main

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

const (
	apiToken = "<your_access_token>"
	orderID  = 12345
)

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

	params := url.Values{}
	params.Add("order_id", fmt.Sprintf("%d", orderID))
	params.Add("username", username)
	params.Add("password", password)
	params.Add("random_password", fmt.Sprintf("%t", randomPassword))
	params.Add("is_reset", fmt.Sprintf("%t", isReset))

	fullURL := fmt.Sprintf("https://apid.iproyal.com/v1/reseller/orders/proxies/change-credentials?%s", params.Encode())

	jsonData, err := json.Marshal(map[string]interface{}{
		"proxies": proxies,
	})
	if err != nil {
		log.Fatal("Error marshaling JSON:", err)
	}

	req, err := http.NewRequest(http.MethodGet, fullURL, 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)
}
```

{% endtab %}

{% tab title="C#" %}

```csharp
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>";
        int orderId = 12345;
        string username = "new_username";
        string password = "new_password";
        bool randomPassword = false;
        bool isReset = true;
        string[] proxies = { "proxy1", "proxy2" };

        string url = $"https://apid.iproyal.com/v1/reseller/orders/proxies/change-credentials?order_id={orderId}&username={username}&password={password}&random_password={randomPassword}&is_reset={isReset}";

        var data = new
        {
            proxies = proxies
        };

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

            var jsonData = JsonSerializer.Serialize(data);
            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);
        }
    }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.iproyal.com/proxies/sneaker-dc/api/proxies.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
