API

Our Proxy Manager API documentation describes how to use Bright Data's API commands and special flags used for automating and controlling recurrent actions executed with Proxy Manager.

API commands are usually used within a code script, and Bright Data's API supports various programming languages, such as shell, Node.js, Java, C#, Python, etc.

Proxy Manager APIs are divided into 5 groups:

  1. Installation & Upgrades
  2. User Access
  3. General Configuration
  4. Port Configuration
  5. IP Handling

Installation & Upgrades

Get the latest Proxy Manager versions

API endpoint: GET /api/last_version

Sample Response:

{"version": "1.280.385","newer": false,"versions": [{"ver": "1.280.385","type": "stable","changes": [{"type": "star","text": "Add render option for unblocker and serp zones"}]}]}

 

Shell

curl "http://127.0.0.1:22999/api/last_version"

Node.js

#!/usr/bin/env node

require('request-promise')({

url: 'http://127.0.0.1:22999/api/last_version'

}).then(function(data){ console.log(data); },

function(err){ console.error(err); });

Java

package example;




import org.apache.http.HttpHost;

import org.apache.http.client.fluent.*;




public class Example {

  public static void main(String[] args) throws Exception {

    String res = Executor.newInstance()

     .execute(Request.Get("http://127.0.0.1:22999/api/last_version"))

     .returnContent().asString();

    System.out.println(res)

  }

}

C#

using System;

using System.Net;

using System.Net.Http;

using System.Net.Http.Headers;




public class Program {

  public static async Task Main() {

    var client = new HttpClient();

    var requestMessage = new HttpRequestMessage {

      Method = HttpMethod.Get,

     RequestUri = new Uri("http://127.0.0.1:22999/api/last_version")

    };

    var response = await client.SendAsync(requestMessage);

    var responseString = await response.Content.ReadAsStringAsync();

    Console.WriteLine(responseString);

  }

}

 

Python

#!/usr/bin/env python

print('If you get error "ImportError: No module named requests", please install it:\n$ sudo pip install requests');

import requests




r = requests.get('http://127.0.0.1:22999/api/last_version')

print(r.content)

 

Get Proxy Manager version

API endpoint: GET /api/version

Sample Response: {"version":"1.280.385","argv":""}

 

Shell

curl "http://127.0.0.1:22999/api/version"

Node.js

#!/usr/bin/env node

require('request-promise')({

url: 'http://127.0.0.1:22999/api/version'

}).then(function(data){ console.log(data); },

function(err){ console.error(err); });

Java

package example;

 

import org.apache.http.HttpHost;

import org.apache.http.client.fluent.*;

 

public class Example {

  public static void main(String[] args) throws Exception {

    String res = Executor.newInstance()

     .execute(Request.Get("http://127.0.0.1:22999/api/version"))

     .returnContent().asString();

    System.out.println(res)

  }

}

C#

using System;

using System.Net;

using System.Net.Http;

using System.Net.Http.Headers;

 

public class Program {

  public static async Task Main() {

    var client = new HttpClient();

    var requestMessage = new HttpRequestMessage {

      Method = HttpMethod.Get,

     RequestUri = new Uri("http://127.0.0.1:22999/api/version")

    };

    var response = await client.SendAsync(requestMessage);

    var responseString = await response.Content.ReadAsStringAsync();

    Console.WriteLine(responseString);

  }

}

 

Python

#!/usr/bin/env python

print('If you get error "ImportError: No module named requests", please install it:\n$ sudo pip install requests');

import requests

 

r = requests.get('http://127.0.0.1:22999/api/version')

print(r.content)

 

Upgrade Proxy Manager

API endpoint: POST /api/upgrade

 

Shell

curl -X POST "http://127.0.0.1:22999/api/upgrade"

Node.js

#!/usr/bin/env node

require('request-promise')({

method: 'POST',

url: 'http://127.0.0.1:22999/api/upgrade'

}).then(function(data){ console.log(data); },

function(err){ console.error(err); });

Java

package example;

 

import org.apache.http.HttpHost;

import org.apache.http.client.fluent.*;

 

public class Example {

  public static void main(String[] args) throws Exception {

    String res = Executor.newInstance()

     .execute(Request.Post("http://127.0.0.1:22999/api/upgrade")

     .returnContent().asString();

 

    System.out.println(res)

  }

}

C#

using System;

using System.Net;

using System.Net.Http;

using System.Net.Http.Headers;

 

public class Program {

  public static async Task Main() {

    var client = new HttpClient();

    var requestMessage = new HttpRequestMessage {

      Method = HttpMethod.Post,

     RequestUri = new Uri("http://127.0.0.1:22999/api/upgrade")

    };

    var response = await client.SendAsync(requestMessage);

    var responseString = await response.Content.ReadAsStringAsync();

    Console.WriteLine(responseString);

  }

}

 

Python

#!/usr/bin/env python

print('If you get error "ImportError: No module named requests", please install it:\n$ sudo pip install requests');

import requests

 

r = requests.post('http://127.0.0.1:22999/api/upgrade')

print(r.content)

Get currently running NodeJS version

API endpoint: GET /api/node_version

Sample Response:

{"current":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"v12.16.1\n","major":12,"minor":16,"patch":1,"prerelease":[],"build":[],"version":"12.16.1"},"satisfied":true,"recommended":">=10.0"}

 

User Access

Add a user

API endpoint: POST /api/lpm_user

POST body

  • email [string] - user email address to add

 

Shell

curl "http://127.0.0.1:22999/api/lpm_user" -H "Content-Type: application/json" -d "{\"email\":\"test@example.com\"}"

Node.js

#!/usr/bin/env node

require('request-promise')({

method: 'POST',

url: 'http://127.0.0.1:22999/api/lpm_user',

json: {'email':'test@example.com'}

}).then(function(data){ console.log(data); },

function(err){ console.error(err); });

Java

package example;

 

import org.apache.http.HttpHost;

import org.apache.http.client.fluent.*;

 

public class Example {

  public static void main(String[] args) throws Exception {

   String body = "{\"email\":\"test@example.com\"}";

    String res = Executor.newInstance()

     .execute(Request.Post("http://127.0.0.1:22999/api/lpm_user")

     .bodyString(body, ContentType.APPLICATION_JSON))

     .returnContent().asString();

 

    System.out.println(res)

  }

}

C#

using System;

using System.Net;

using System.Net.Http;

using System.Net.Http.Headers;

 

public class Program {

  public static async Task Main() {

    var client = new HttpClient();

    var requestMessage = new HttpRequestMessage {

      Method = HttpMethod.Post,

     RequestUri = new Uri("http://127.0.0.1:22999/api/lpm_user"),

     Content = new StringContent(JsonConvert.SerializeObject(new {

       email = "test@example.com"

     }), Encoding.UTF8, "application/json"))

    };

    var response = await client.SendAsync(requestMessage);

    var responseString = await response.Content.ReadAsStringAsync();

    Console.WriteLine(responseString);

  }

}

 

Python

#!/usr/bin/env python

print('If you get error "ImportError: No module named requests", please install it:\n$ sudo pip install requests');

import requests

 

data = {'email':'test@example.com'}

r = requests.post('http://127.0.0.1:22999/api/lpm_user', data=json.dumps(data))

print(r.content)

 

Get all users

API endpoint: GET /api/lpm_users

Sample Response: [{"email":"test@example.com","password":"password"}]

 

Shell

curl "http://127.0.0.1:22999/api/lpm_users"

Node.js

#!/usr/bin/env node

require('request-promise')({

url: 'http://127.0.0.1:22999/api/lpm_users'

}).then(function(data){ console.log(data); },

function(err){ console.error(err); });

Java

package example;

 

import org.apache.http.HttpHost;

import org.apache.http.client.fluent.*;

 

public class Example {

  public static void main(String[] args) throws Exception {

    String res = Executor.newInstance()

     .execute(Request.Get("http://127.0.0.1:22999/api/lpm_users"))

     .returnContent().asString();

    System.out.println(res)

  }

}

C#

using System;

using System.Net;

using System.Net.Http;

using System.Net.Http.Headers;

 

public class Program {

  public static async Task Main() {

    var client = new HttpClient();

    var requestMessage = new HttpRequestMessage {

      Method = HttpMethod.Get,

     RequestUri = new Uri("http://127.0.0.1:22999/api/lpm_users")

    };

    var response = await client.SendAsync(requestMessage);

    var responseString = await response.Content.ReadAsStringAsync();

    Console.WriteLine(responseString);

  }

}

 

Python

#!/usr/bin/env python

print('If you get error "ImportError: No module named requests", please install it:\n$ sudo pip install requests');

import requests

 

r = requests.get('http://127.0.0.1:22999/api/lpm_users')

print(r.content)

 

Whitelist IPs

API endpoint: POST /api/add_wip

Authorization: TOKEN - Token should be generated using Generate token API

POST body

  • ip="1.2.1.2"

 

Shell

curl "http://127.0.0.1:22999/api/add_wip" -H "Authorization: TOKEN" -H "Content-Type: application/json" -d "{\"ip\":\"1.2.1.2\"}"

Node.js

#!/usr/bin/env node

require('request-promise')({

method: 'POST',

url: 'http://127.0.0.1:22999/api/add_wip',

json: {'ip':'1.2.1.2'},

headers: {'Authorization': 'TOKEN'},

}).then(function(data){ console.log(data); },

function(err){ console.error(err); });

Java

package example;

 

import org.apache.http.HttpHost;

import org.apache.http.client.fluent.*;

 

public class Example {

  public static void main(String[] args) throws Exception {

   String body = "{\"ip\":\"1.2.1.2\"}";

    String res = Executor.newInstance()

      .addHeader("Authorization", "TOKEN")

     .execute(Request.Post("http://127.0.0.1:22999/api/add_wip")

     .bodyString(body, ContentType.APPLICATION_JSON))

     .returnContent().asString();

 

    System.out.println(res)

  }

}

C#

using System;

using System.Net;

using System.Net.Http;

using System.Net.Http.Headers;

 

public class Program {

  public static async Task Main() {

    var client = new HttpClient();

    var requestMessage = new HttpRequestMessage {

      Method = HttpMethod.Post,

     RequestUri = new Uri("http://127.0.0.1:22999/api/add_wip"),

      Headers = {

        {"Authorization", "TOKEN"}

      },

     Content = new StringContent(JsonConvert.SerializeObject(new {

       ip = "1.2.1.2"

     }), Encoding.UTF8, "application/json"))

    };

    var response = await client.SendAsync(requestMessage);

    var responseString = await response.Content.ReadAsStringAsync();

    Console.WriteLine(responseString);

  }

}

 

Python

#!/usr/bin/env python

print('If you get error "ImportError: No module named requests", please install it:\n$ sudo pip install requests');

import requests

 

data = {'ip':'1.2.1.2'}

headers = {'Authorization': 'TOKEN'}

r = requests.post('http://127.0.0.1:22999/api/add_wip', data=json.dumps(data), headers=headers)

print(r.content)

 

Whitelist IPs to access UI

API endpoint: POST /api/add_whitelist_ip

POST body

  • ip="1.2.1.2"

 

Shell

curl "http://127.0.0.1:22999/api/add_whitelist_ip" -H "Content-Type: application/json" -d "{\"ip\":\"1.2.1.2\"}"

Node.js

#!/usr/bin/env node

require('request-promise')({

method: 'POST',

url: 'http://127.0.0.1:22999/api/add_whitelist_ip',

json: {'ip':'1.2.1.2'}

}).then(function(data){ console.log(data); },

function(err){ console.error(err); });

Java

package example;

 

import org.apache.http.HttpHost;

import org.apache.http.client.fluent.*;

 

public class Example {

  public static void main(String[] args) throws Exception {

   String body = "{\"ip\":\"1.2.1.2\"}";

    String res = Executor.newInstance()

     .execute(Request.Post("http://127.0.0.1:22999/api/add_whitelist_ip")

     .bodyString(body, ContentType.APPLICATION_JSON))

     .returnContent().asString();

 

    System.out.println(res)

  }

}

C#

using System;

using System.Net;

using System.Net.Http;

using System.Net.Http.Headers;

 

public class Program {

  public static async Task Main() {

    var client = new HttpClient();

    var requestMessage = new HttpRequestMessage {

      Method = HttpMethod.Post,

     RequestUri = new Uri("http://127.0.0.1:22999/api/add_whitelist_ip"),

     Content = new StringContent(JsonConvert.SerializeObject(new {

       ip = "1.2.1.2"

     }), Encoding.UTF8, "application/json"))

    };

    var response = await client.SendAsync(requestMessage);

    var responseString = await response.Content.ReadAsStringAsync();

    Console.WriteLine(responseString);

  }

}

 

Python

#!/usr/bin/env python

print('If you get error "ImportError: No module named requests", please install it:\n$ sudo pip install requests');

import requests

 

data = {'ip':'1.2.1.2'}

r = requests.post('http://127.0.0.1:22999/api/add_whitelist_ip', data=json.dumps(data))

print(r.content)

 

General Configuration

Restart Proxy Manager

API endpoint: POST /api/restart

 

Shell

curl -X POST "http://127.0.0.1:22999/api/restart"

Node.js

#!/usr/bin/env node

require('request-promise')({

method: 'POST',

url: 'http://127.0.0.1:22999/api/restart'

}).then(function(data){ console.log(data); },

function(err){ console.error(err); });

Java

package example;

 

import org.apache.http.HttpHost;

import org.apache.http.client.fluent.*;

 

public class Example {

  public static void main(String[] args) throws Exception {

    String res = Executor.newInstance()

     .execute(Request.Post("http://127.0.0.1:22999/api/restart")

     .returnContent().asString();

 

    System.out.println(res)

  }

}

C#

using System;

using System.Net;

using System.Net.Http;

using System.Net.Http.Headers;

 

public class Program {

  public static async Task Main() {

    var client = new HttpClient();

    var requestMessage = new HttpRequestMessage {

      Method = HttpMethod.Post,

     RequestUri = new Uri("http://127.0.0.1:22999/api/restart")

    };

    var response = await client.SendAsync(requestMessage);

    var responseString = await response.Content.ReadAsStringAsync();

    Console.WriteLine(responseString);

  }

}

 

Python

#!/usr/bin/env python

print('If you get error "ImportError: No module named requests", please install it:\n$ sudo pip install requests');

import requests

 

r = requests.post('http://127.0.0.1:22999/api/restart')

print(r.content)

 

Shutdown Proxy Manager

API endpoint: POST /api/shutdown

Shell

curl -X POST "http://127.0.0.1:22999/api/shutdown"

Node.js

#!/usr/bin/env node

require('request-promise')({

method: 'POST',

url: 'http://127.0.0.1:22999/api/shutdown'

}).then(function(data){ console.log(data); },

function(err){ console.error(err); });

Java

package example;

 

import org.apache.http.HttpHost;

import org.apache.http.client.fluent.*;

 

public class Example {

  public static void main(String[] args) throws Exception {

    String res = Executor.newInstance()

     .execute(Request.Post("http://127.0.0.1:22999/api/shutdown")

     .returnContent().asString();

 

    System.out.println(res)

  }

}

C#

using System;

using System.Net;

using System.Net.Http;

using System.Net.Http.Headers;

 

public class Program {

  public static async Task Main() {

    var client = new HttpClient();

    var requestMessage = new HttpRequestMessage {

      Method = HttpMethod.Post,

     RequestUri = new Uri("http://127.0.0.1:22999/api/shutdown")

    };

    var response = await client.SendAsync(requestMessage);

    var responseString = await response.Content.ReadAsStringAsync();

    Console.WriteLine(responseString);

  }

}

 

Python

#!/usr/bin/env python

print('If you get error "ImportError: No module named requests", please install it:\n$ sudo pip install requests');

import requests

 

r = requests.post('http://127.0.0.1:22999/api/shutdown')

print(r.content)

 

Get general settings

API endpoint: GET /api/settings

Sample Response:

{"customer":"CUSTOMER","zone":"ZONE","password":"PASSWORD","www_whitelist_ips":[],"whitelist_ips":[],"fixed_whitelist_ips":[],"read_only":false,"config":"/home/user/proxy_manager/.luminati.json","test_url":"http://lumtest.com/myip.json","logs":1000,"log":"notice","har_limit":1024,"request_stats":true,"dropin":true,"pending_ips":[],"pending_www_ips":[],"zagent":false,"sync_config":true}

 

Shell

curl "http://127.0.0.1:22999/api/settings"

Node.js

#!/usr/bin/env node

require('request-promise')({

url: 'http://127.0.0.1:22999/api/settings'

}).then(function(data){ console.log(data); },

function(err){ console.error(err); });

Java

package example;

 

import org.apache.http.HttpHost;

import org.apache.http.client.fluent.*;

 

public class Example {

  public static void main(String[] args) throws Exception {

    String res = Executor.newInstance()

     .execute(Request.Get("http://127.0.0.1:22999/api/settings"))

     .returnContent().asString();

    System.out.println(res)

  }

}

C#

using System;

using System.Net;

using System.Net.Http;

using System.Net.Http.Headers;

 

public class Program {

  public static async Task Main() {

    var client = new HttpClient();

    var requestMessage = new HttpRequestMessage {

      Method = HttpMethod.Get,

     RequestUri = new Uri("http://127.0.0.1:22999/api/settings")

    };

    var response = await client.SendAsync(requestMessage);

    var responseString = await response.Content.ReadAsStringAsync();

    Console.WriteLine(responseString);

  }

}

 

Python

#!/usr/bin/env python

print('If you get error "ImportError: No module named requests", please install it:\n$ sudo pip install requests');

import requests

 

r = requests.get('http://127.0.0.1:22999/api/settings')

print(r.content)

 

Update general settings

API endpoint: PUT /api/settings

PUT Body:

  • zone [string] - Default zone
  • www_whitelist_ips [array] - Whitelist ip list for granting access to browser admin UI
  • whitelist_ips [array] - Default for all proxies whitelist ip list for granting access to them
  • logs [number] - Number of request logs to store
  • request_stats [boolean] - Enable requests statistics

Sample Response:

{"customer":"CUSTOMER","zone":"ZONE","password":"PASSWORD","www_whitelist_ips":[],"whitelist_ips":[],"fixed_whitelist_ips":[],"read_only":false,"config":"/home/user/proxy_manager/.luminati.json","test_url":"http://lumtest.com/myip.json","logs":1000,"log":"notice","har_limit":1024,"request_stats":true,"dropin":true,"pending_ips":[],"pending_www_ips":[],"zagent":false,"sync_config":true}

 

Shell

curl -X PUT "http://127.0.0.1:22999/api/settings" -H "Content-Type: application/json" -d "{\"zone\":\"ZONE\",\"www_whitelist_ips\":[],\"whitelist_ips\":[],\"logs\":1000,\"request_stats\":true}"

Node.js

#!/usr/bin/env node

require('request-promise')({

method: 'PUT',

url: 'http://127.0.0.1:22999/api/settings',

       json: {'zone': 'ZONE','www_whitelist_ips':'[]','whitelist_ips':'[]','logs':1000,'request_stats':true}

}).then(function(data){ console.log(data); },

function(err){ console.error(err); });

Java

package example;

 

import org.apache.http.HttpHost;

import org.apache.http.client.fluent.*;

 

public class Example {

  public static void main(String[] args) throws Exception {

   String body = "{\"zone\":\"ZONE\",\"www_whitelist_ips\":[],\"whitelist_ips\":[],\"logs\":1000,\"request_stats\":true}";

    String res = Executor.newInstance()

     .execute(Request.Put("http://127.0.0.1:22999/api/settings"))

     .bodyString(body, ContentType.APPLICATION_JSON))

     .returnContent().asString();

 

    System.out.println(res)

  }

}

C#

using System;

using System.Net;

using System.Net.Http;

using System.Net.Http.Headers;

 

public class Program {

  public static async Task Main() {

    var client = new HttpClient();

    var requestMessage = new HttpRequestMessage {

      Method = HttpMethod.Put,

     RequestUri = new Uri("http://127.0.0.1:22999/api/settings"),

     Content = new StringContent(JsonConvert.SerializeObject(new {

         zone = "ZONE", www_whitelist_ips = [], whitelist_ips = [], logs = 1000, request_stats = true

     }), Encoding.UTF8, "application/json"))

    };

    var response = await client.SendAsync(requestMessage);

    var responseString = await response.Content.ReadAsStringAsync();

    Console.WriteLine(responseString);

  }

}

 

Python

#!/usr/bin/env python

print('If you get error "ImportError: No module named requests", please install it:\n$ sudo pip install requests');

import requests

 

data = {'zone': 'ZONE','www_whitelist_ips':[],'whitelist_ips':[],'logs':1000,'request_stats':true}

r = requests.put('http://127.0.0.1:22999/api/settings', data=json.dumps(data))

print(r.content)

 

Get explicit configuration of all or specified proxies

API endpoint: GET /api/proxies/{PORT}

*Note : PORT parameter is optional. You can skip it to fetch all the proxies

Sample Response:

[{"port":24000,"zone":"ZONE","proxy_type":"persist","customer":"CUSTOMER","password":"PASSWORD","whitelist_ips":[]},{"port":22225,"zone":"ZONE","listen_port":22225,"customer":"CUSTOMER","password":"PASSWORD"}]

 

Shell

curl "http://127.0.0.1:22999/api/proxies/{PORT}"

Node.js

#!/usr/bin/env node

require('request-promise')({

url: 'http://127.0.0.1:22999/api/proxies/{PORT}'

}).then(function(data){ console.log(data); },

function(err){ console.error(err); });

Java

package example;

 

import org.apache.http.HttpHost;

import org.apache.http.client.fluent.*;

 

public class Example {

  public static void main(String[] args) throws Exception {

    String res = Executor.newInstance()

     .execute(Request.Get("http://127.0.0.1:22999/api/proxies/{PORT}"))

     .returnContent().asString();

    System.out.println(res)

  }

}

C#

using System;

using System.Net;

using System.Net.Http;

using System.Net.Http.Headers;

 

public class Program {

  public static async Task Main() {

    var client = new HttpClient();

    var requestMessage = new HttpRequestMessage {

      Method = HttpMethod.Get,

     RequestUri = new Uri("http://127.0.0.1:22999/api/proxies/{PORT}")

    };

    var response = await client.SendAsync(requestMessage);

    var responseString = await response.Content.ReadAsStringAsync();

    Console.WriteLine(responseString);

  }

}

 

Python

#!/usr/bin/env python

print('If you get error "ImportError: No module named requests", please install it:\n$ sudo pip install requests');

import requests

 

r = requests.get('http://127.0.0.1:22999/api/proxies/{PORT}')

print(r.content)

 

Generate token for token based authentication

API endpoint: GET /api/gen_token

Sample Response: {"token":"RZD9vaQQaL6En7"}

 

Shell

curl "http://127.0.0.1:22999/api/gen_token"

Node.js

#!/usr/bin/env node

require('request-promise')({

url: 'http://127.0.0.1:22999/api/gen_token'

}).then(function(data){ console.log(data); },

function(err){ console.error(err); });

Java

package example;

 

import org.apache.http.HttpHost;

import org.apache.http.client.fluent.*;

 

public class Example {

  public static void main(String[] args) throws Exception {

    String res = Executor.newInstance()

     .execute(Request.Get("http://127.0.0.1:22999/api/gen_token"))

     .returnContent().asString();

    System.out.println(res)

  }

}

C#

using System;

using System.Net;

using System.Net.Http;

using System.Net.Http.Headers;

 

public class Program {

  public static async Task Main() {

    var client = new HttpClient();

    var requestMessage = new HttpRequestMessage {

      Method = HttpMethod.Get,

     RequestUri = new Uri("http://127.0.0.1:22999/api/gen_token")

    };

    var response = await client.SendAsync(requestMessage);

    var responseString = await response.Content.ReadAsStringAsync();

    Console.WriteLine(responseString);

  }

}

 

Python

#!/usr/bin/env python

print('If you get error "ImportError: No module named requests", please install it:\n$ sudo pip install requests');

import requests

 

r = requests.get('http://127.0.0.1:22999/api/gen_token')

print(r.content)

 

Get effective configuration for all running proxies

API endpoint: GET /api/proxies_running

Sample Response:

[{"port":24000,"zone":"ZONE","proxy_type":"persist","customer":"CUSTOMER","password":"PASSWORD","whitelist_ips":[]}]

 

Shell

curl "http://127.0.0.1:22999/api/proxies_running"

Node.js

#!/usr/bin/env node

require('request-promise')({

url: 'http://127.0.0.1:22999/api/proxies_running'

}).then(function(data){ console.log(data); },

function(err){ console.error(err); });

Java

package example;

 

import org.apache.http.HttpHost;

import org.apache.http.client.fluent.*;

 

public class Example {

  public static void main(String[] args) throws Exception {

    String res = Executor.newInstance()

     .execute(Request.Get("http://127.0.0.1:22999/api/proxies_running"))

     .returnContent().asString();

    System.out.println(res)

  }

}

C#

using System;

using System.Net;

using System.Net.Http;

using System.Net.Http.Headers;

 

public class Program {

  public static async Task Main() {

    var client = new HttpClient();

    var requestMessage = new HttpRequestMessage {

      Method = HttpMethod.Get,

     RequestUri = new Uri("http://127.0.0.1:22999/api/proxies_running")

    };

    var response = await client.SendAsync(requestMessage);

    var responseString = await response.Content.ReadAsStringAsync();

    Console.WriteLine(responseString);

  }

}

 

Python

#!/usr/bin/env python

print('If you get error "ImportError: No module named requests", please install it:\n$ sudo pip install requests');

import requests

 

r = requests.get('http://127.0.0.1:22999/api/proxies_running')

print(r.content)

Get enabled zones configuration

API endpoint: GET /api/zones

Sample Response:

{"name":"ZONE","perm":"country ip route_all route_dedicated","plan":{},"password":"PASSWORD"}

 

Shell

curl "http://127.0.0.1:22999/api/zones"

Node.js

#!/usr/bin/env node

require('request-promise')({

url: 'http://127.0.0.1:22999/api/zones'

}).then(function(data){ console.log(data); },

function(err){ console.error(err); });

Java

package example;

 

import org.apache.http.HttpHost;

import org.apache.http.client.fluent.*;

 

public class Example {

  public static void main(String[] args) throws Exception {

    String res = Executor.newInstance()

     .execute(Request.Get("http://127.0.0.1:22999/api/zones"))

     .returnContent().asString();

    System.out.println(res)

  }

}

C#

using System;

using System.Net;

using System.Net.Http;

using System.Net.Http.Headers;

 

public class Program {

  public static async Task Main() {

    var client = new HttpClient();

    var requestMessage = new HttpRequestMessage {

      Method = HttpMethod.Get,

     RequestUri = new Uri("http://127.0.0.1:22999/api/zones")

    };

    var response = await client.SendAsync(requestMessage);

    var responseString = await response.Content.ReadAsStringAsync();

    Console.WriteLine(responseString);

  }

}

 

Python

#!/usr/bin/env python

print('If you get error "ImportError: No module named requests", please install it:\n$ sudo pip install requests');

import requests

 

r = requests.get('http://127.0.0.1:22999/api/zones')

print(r.content)

 

Get recent stats

API endpoint: GET /api/recent_stats

Sample Response:

{"ports":{},"status_code":[],"hostname":[],"protocol":[],"total":0,"success":0,"ssl_enable":true}

 

Shell

curl "http://127.0.0.1:22999/api/recent_stats"

Node.js

#!/usr/bin/env node

require('request-promise')({

url: 'http://127.0.0.1:22999/api/recent_stats'

}).then(function(data){ console.log(data); },

function(err){ console.error(err); });

Java

package example;

 

import org.apache.http.HttpHost;

import org.apache.http.client.fluent.*;

 

public class Example {

  public static void main(String[] args) throws Exception {

    String res = Executor.newInstance()

     .execute(Request.Get("http://127.0.0.1:22999/api/recent_stats"))

     .returnContent().asString();

    System.out.println(res)

  }

}

C#

using System;

using System.Net;

using System.Net.Http;

using System.Net.Http.Headers;

 

public class Program {

  public static async Task Main() {

    var client = new HttpClient();

    var requestMessage = new HttpRequestMessage {

      Method = HttpMethod.Get,

     RequestUri = new Uri("http://127.0.0.1:22999/api/recent_stats")

    };

    var response = await client.SendAsync(requestMessage);

    var responseString = await response.Content.ReadAsStringAsync();

    Console.WriteLine(responseString);

  }

}

 

Python

#!/usr/bin/env python

print('If you get error "ImportError: No module named requests", please install it:\n$ sudo pip install requests');

import requests

 

r = requests.get('http://127.0.0.1:22999/api/recent_stats')

print(r.content)

 

Get HAR logs

API endpoint: GET /api/logs

Optional Parameter :

  • limit: number of logs to get from tail
  • skip: number of requests to be skipped from the beginning
  • limit: maximum number of requests to be fetched
  • search: regex search query for the URL
  • port_from: lower bound for port number
  • port_to: upper bound for port number
  • status_code: filter requests by status code
  • sort: parameter to be sorted by
  • sort_desc: is descending sorting direction

 

Shell

curl "http://127.0.0.1:22999/api/logs"

Node.js

#!/usr/bin/env node

require('request-promise')({

url: 'http://127.0.0.1:22999/api/logs'

}).then(function(data){ console.log(data); },

function(err){ console.error(err); });

Java

package example;

 

import org.apache.http.HttpHost;

import org.apache.http.client.fluent.*;

 

public class Example {

  public static void main(String[] args) throws Exception {

    String res = Executor.newInstance()

     .execute(Request.Get("http://127.0.0.1:22999/api/logs"))

     .returnContent().asString();

    System.out.println(res)

  }

}

C#

using System;

using System.Net;

using System.Net.Http;

using System.Net.Http.Headers;

 

public class Program {

  public static async Task Main() {

    var client = new HttpClient();

    var requestMessage = new HttpRequestMessage {

      Method = HttpMethod.Get,

     RequestUri = new Uri("http://127.0.0.1:22999/api/logs")

    };

    var response = await client.SendAsync(requestMessage);

    var responseString = await response.Content.ReadAsStringAsync();

    Console.WriteLine(responseString);

  }

}

 

Python

#!/usr/bin/env python

print('If you get error "ImportError: No module named requests", please install it:\n$ sudo pip install requests');

import requests

 

r = requests.get('http://127.0.0.1:22999/api/logs')

print(r.content)

 

Get tail from the log file

API endpoint: GET /api/general_logs

Optional Parameter : limit [number] - Number of logs to get from tail

 

Shell

curl "http://127.0.0.1:22999/api/general_logs?limit=5"

Node.js

#!/usr/bin/env node

require('request-promise')({

url: 'http://127.0.0.1:22999/api/general_logs?limit=5'

}).then(function(data){ console.log(data); },

function(err){ console.error(err); });

Java

package example;

 

import org.apache.http.HttpHost;

import org.apache.http.client.fluent.*;

 

public class Example {

  public static void main(String[] args) throws Exception {

    String res = Executor.newInstance()

     .execute(Request.Get("http://127.0.0.1:22999/api/general_logs?limit=5"))

     .returnContent().asString();

    System.out.println(res)

  }

}

C#

using System;

using System.Net;

using System.Net.Http;

using System.Net.Http.Headers;

 

public class Program {

  public static async Task Main() {

    var client = new HttpClient();

    var requestMessage = new HttpRequestMessage {

      Method = HttpMethod.Get,

     RequestUri = new Uri("http://127.0.0.1:22999/api/general_logs?limit=5")

    };

    var response = await client.SendAsync(requestMessage);

    var responseString = await response.Content.ReadAsStringAsync();

    Console.WriteLine(responseString);

  }

}

 

Python

#!/usr/bin/env python

print('If you get error "ImportError: No module named requests", please install it:\n$ sudo pip install requests');

import requests

 

r = requests.get('http://127.0.0.1:22999/api/general_logs?limit=5')

print(r.content)

 

Get allocated gIPs in zone

API endpoint: GET /api/allocated_vips

Parameter: zone - Residential/Mobile exclusive zone name

Sample Response: {"ips":["gIP_1","gIP_2"]}

 

Shell

curl "http://127.0.0.1:22999/api/allocated_vips?zone=ZONE"

Node.js

#!/usr/bin/env node

require('request-promise')({

url: 'http://127.0.0.1:22999/api/allocated_vips?zone=ZONE'

}).then(function(data){ console.log(data); },

function(err){ console.error(err); });

Java

package example;

 

import org.apache.http.HttpHost;

import org.apache.http.client.fluent.*;

 

public class Example {

  public static void main(String[] args) throws Exception {

    String res = Executor.newInstance()

     .execute(Request.Get("http://127.0.0.1:22999/api/allocated_vips?zone=ZONE"))

     .returnContent().asString();

    System.out.println(res)

  }

}

C#

using System;

using System.Net;

using System.Net.Http;

using System.Net.Http.Headers;

 

public class Program {

  public static async Task Main() {

    var client = new HttpClient();

    var requestMessage = new HttpRequestMessage {

      Method = HttpMethod.Get,

     RequestUri = new Uri("http://127.0.0.1:22999/api/allocated_vips?zone=ZONE")

    };

    var response = await client.SendAsync(requestMessage);

    var responseString = await response.Content.ReadAsStringAsync();

    Console.WriteLine(responseString);

  }

}

 

Python

#!/usr/bin/env python

print('If you get error "ImportError: No module named requests", please install it:\n$ sudo pip install requests');

import requests

 

r = requests.get('http://127.0.0.1:22999/api/allocated_vips?zone=ZONE')

print(r.content)

Get allocated IPs in zone

API endpoint: GET /api/allocated_ips

Parameter: zone - Static (Datacenter/ISP) zone name

Sample Response: {"ips":["10.0.0.1","20.0.0.1"]}

 

Shell

curl "http://127.0.0.1:22999/api/allocated_ips?zone=ZONE"

Node.js

#!/usr/bin/env node

require('request-promise')({

url: 'http://127.0.0.1:22999/api/allocated_ips?zone=ZONE'

}).then(function(data){ console.log(data); },

function(err){ console.error(err); });

Java

package example;

 

import org.apache.http.HttpHost;

import org.apache.http.client.fluent.*;

 

public class Example {

  public static void main(String[] args) throws Exception {

    String res = Executor.newInstance()

     .execute(Request.Get("http://127.0.0.1:22999/api/allocated_ips?zone=ZONE"))

     .returnContent().asString();

    System.out.println(res)

  }

}

C#

using System;

using System.Net;

using System.Net.Http;

using System.Net.Http.Headers;

 

public class Program {

  public static async Task Main() {

    var client = new HttpClient();

    var requestMessage = new HttpRequestMessage {

      Method = HttpMethod.Get,

     RequestUri = new Uri("http://127.0.0.1:22999/api/allocated_ips?zone=ZONE")

    };

    var response = await client.SendAsync(requestMessage);

    var responseString = await response.Content.ReadAsStringAsync();

    Console.WriteLine(responseString);

  }

}

 

Python

#!/usr/bin/env python

print('If you get error "ImportError: No module named requests", please install it:\n$ sudo pip install requests');

import requests

 

r = requests.get('http://127.0.0.1:22999/api/allocated_ips?zone=ZONE')

print(r.content)

Refresh IPs or gIPs in zone

API endpoint: POST /api/refresh_ips

POST body

  • zone="ZONE" [string] - Zone name
  • IP/gIP to refresh : one of following
    • ips=["ip1","ip2"] [array] - Static IPs
    • vips=["gip1","gip2"] [array] - gIPs

Sample Response:

{"ips":[{"ip":"10.0.0.1","maxmind":"us"},{"ip":"20.0.0.1","maxmind":"us"}]}

 

Shell

curl "http://127.0.0.1:22999/api/refresh_ips" -H "Content-Type: application/json" -d "{\"zone\":\"ZONE\",\"ips\":[\"10.0.0.1\"]}"

Node.js

#!/usr/bin/env node

require('request-promise')({

method: 'POST',

url: 'http://127.0.0.1:22999/api/refresh_ips',

json: {'zone':'ZONE','ips':['10.0.0.1']}

}).then(function(data){ console.log(data); },

function(err){ console.error(err); });

Java

package example;

 

import org.apache.http.HttpHost;

import org.apache.http.client.fluent.*;

 

public class Example {

  public static void main(String[] args) throws Exception {

   String body = "{\"zone\":\"ZONE\",\"ips\":[\"10.0.0.1\"]}";

    String res = Executor.newInstance()

     .execute(Request.Post("http://127.0.0.1:22999/api/refresh_ips")

     .bodyString(body, ContentType.APPLICATION_JSON))

     .returnContent().asString();

 

    System.out.println(res)

  }

}

C#

using System;

using System.Net;

using System.Net.Http;

using System.Net.Http.Headers;

 

public class Program {

  public static async Task Main() {

    var client = new HttpClient();

    var requestMessage = new HttpRequestMessage {

      Method = HttpMethod.Post,

     RequestUri = new Uri("http://127.0.0.1:22999/api/refresh_ips"),

     Content = new StringContent(JsonConvert.SerializeObject(new {

       zone = "ZONE",

       ips = ["10.0.0.1"]

     }), Encoding.UTF8, "application/json"))

    };

    var response = await client.SendAsync(requestMessage);

    var responseString = await response.Content.ReadAsStringAsync();

    Console.WriteLine(responseString);

  }

}

 

Python

#!/usr/bin/env python

print('If you get error "ImportError: No module named requests", please install it:\n$ sudo pip install requests');

import requests

 

data = {'zone':'ZONE','ips':['10.0.0.1']}

r = requests.post('http://127.0.0.1:22999/api/refresh_ips', data=json.dumps(data))

print(r.content)

 

Port Configuration

Create a new proxy port

API endpoint: POST /api/proxies

POST body

  • proxy [JSON object]
    • port [integer] - Port for the HTTP proxy
    • proxy_type=persist[string] - Set to "persist" to save proxy into the configuration file.
    • multiply[integer] - Multiply the port definition given number of times
    • multiply_users[boolean]
    • users[array] - List of users. This option has to be used along with "multiply_users"
      • user[string]
    • ssl[boolean] - Enable SSL analyzing
    • tls_lib=open_ssl|flex_tls[string] - SSL library
    • iface[string] - Interface or IP to listen on
    • customer[string] - Customer name
    • zone[string] - Zone name
    • password[string] - Zone password
    • proxy[string] - Hostname or IP of super proxy
    • proxy_port[integer] - Super proxy port
    • proxy_connection_type=http|https|socks[string] - Determines what kind of connection will be used between Proxy Manager and Super Proxy
    • proxy_retry[integer] - Automatically retry on super proxy failure
    • insecure[boolean] - Enable SSL connection/analyzing to insecure hosts
    • country[string] - Country
    • state[string] - State
    • city[string] - City
    • asn[string] - ASN
    • ip[string] - Data Center IP
    • vip[integer] - gIP
    • ext_proxies[array] - A list of proxies from external vendors. Format: [username:password@]ip[:port]
      • proxy[string]
    • ext_proxy_username[string] - Default username for external vendor ips
    • ext_proxy_password[string] - Default password for external vendor ips
    • ext_proxy_port[integer] - Default port for external vendor ips
    • dns=local|remote[string] - DNS resolving
    • reverse_lookup_dns[boolean] - Process reverse lookup via DNS
    • reverse_lookup_file[string] - Process reverse lookup via file
    • reverse_lookup_values[array] - Process reverse lookup via value
    • session=^[^\.\-]*$[string] - Session for all proxy requests
    • sticky_ip[boolean] - Use session per requesting host to maintain IP per host
    • pool_size[integer]
    • rotate_session[boolean] - Session pool size
    • throttle[integer] - Throttle requests above given number
    • rules={...}[array] - Proxy request rules
    • route_err[string] - Block or allow requests to be automatically sent through super proxy on error
    • smtp[array]
    • override_headers=[string][boolean]
    • os[string] - Operating System of the Peer IP
    • headers[array] - Request headers
      • name[string]
      • value[string]
    • debug=full|none[string] - Request debug info
    • lpm_auth[string] - x-lpm-authorization header
    • const[boolean]
    • socket_inactivity_timeout[integer]
    • multiply_ips[boolean]
    • multiply_vips[boolean]
    • max_ban_retries[integer]
    • preset[string]
    • ua[boolean] - Unblocker Mobile UA
    • timezone[string] - Timezone ID to be used by the browser
    • resolution[string] - Browser screen size
    • webrtc[string] - WebRTC plugin behavior in the browser
    • bw_limit[object] - BW limit params
      • days[integer]
      • bytes[integer]
      • renewable[boolean] - Renew limit of bytes each period or use single period and stop usage once last day of period is reached. Default is true
  • create_users[boolean]

Sample response:

{"port":24000,"zone":"YOUR_ZONE","proxy_type":"persist","customer":"YOUR_CUSTOMER_ID","password":"PASSWORD","whitelist_ips":[]}

 

Shell

curl "http://127.0.0.1:22999/api/proxies" -H "Content-Type: application/json" -d "{\"proxy\":{\"port\":24000,\"zone\":\"ZONE\",\"proxy_type\":\"persist\",\"customer\":\"CUSTOMER\",\"password\":\"PASSWORD\",\"whitelist_ips\":[]}}"

Node.js

#!/usr/bin/env node

require('request-promise')({

method: 'POST',

url: 'http://127.0.0.1:22999/api/proxies',

json: {'proxy':{'port':24000,'zone': 'ZONE','proxy_type':'persist','customer':'CUSTOMER','password':'PASSWORD','whitelist_ips':[]}}

}).then(function(data){ console.log(data); },

function(err){ console.error(err); });

Java

package example;

 

import org.apache.http.HttpHost;

import org.apache.http.client.fluent.*;

 

public class Example {

  public static void main(String[] args) throws Exception {

   String body = "{\"proxy\":{\"port\":24000,\"zone\":\"ZONE\",\"proxy_type\":\"persist\",\"customer\":\"CUSTOMER\",\"password\":\"PASSWORD\",\"whitelist_ips\":[]}}";

    String res = Executor.newInstance()

     .execute(Request.Post("http://127.0.0.1:22999/api/proxies")

     .bodyString(body, ContentType.APPLICATION_JSON))

     .returnContent().asString();

 

    System.out.println(res)

  }

}

 

Delete proxy ports

API endpoint: POST /api/proxies/delete

POST body

  • ports=[24000,24001] [array]

 

Shell

curl "http://127.0.0.1:22999/api/proxies/delete" -H "Content-Type: application/json" -d "{\"ports\":[24000,24001]}"

Node.js

#!/usr/bin/env node

require('request-promise')({

method: 'POST',

url: 'http://127.0.0.1:22999/api/proxies/delete',

json: {'ports':[24000,24001]}

}).then(function(data){ console.log(data); },

function(err){ console.error(err); });

Java

package example;

 

import org.apache.http.HttpHost;

import org.apache.http.client.fluent.*;

 

public class Example {

  public static void main(String[] args) throws Exception {

   String body = "{\"ports\":[24000,24001]}";

    String res = Executor.newInstance()

     .execute(Request.Post("http://127.0.0.1:22999/api/proxies/delete")

     .bodyString(body, ContentType.APPLICATION_JSON))

     .returnContent().asString();

 

    System.out.println(res)

  }

}

C#

using System;

using System.Net;

using System.Net.Http;

using System.Net.Http.Headers;

 

public class Program {

  public static async Task Main() {

    var client = new HttpClient();

    var requestMessage = new HttpRequestMessage {

      Method = HttpMethod.Post,

     RequestUri = new Uri("http://127.0.0.1:22999/api/proxies/delete"),

     Content = new StringContent(JsonConvert.SerializeObject(new {

       ports = [ 24000, 24001 ]

     }), Encoding.UTF8, "application/json"))

    };

    var response = await client.SendAsync(requestMessage);

    var responseString = await response.Content.ReadAsStringAsync();

    Console.WriteLine(responseString);

  }

}

 

Python

#!/usr/bin/env python

print('If you get error "ImportError: No module named requests", please install it:\n$ sudo pip install requests');

import requests

 

data = {'ports':[24000,24001]}

r = requests.post('http://127.0.0.1:22999/api/proxies/delete', data=json.dumps(data))

print(r.content)

Delete a proxy port

API endpoint: DELETE /api/proxies/{PORT}

*PORT : existing proxy port number

 

Shell

curl -X DELETE "http://127.0.0.1:22999/api/proxies/{PORT}"

Node.js

#!/usr/bin/env node

require('request-promise')({

method: 'DELETE',

url: 'http://127.0.0.1:22999/api/proxies/{PORT}'

}).then(function(data){ console.log(data); },

function(err){ console.error(err); });

Java

package example;

 

import org.apache.http.HttpHost;

import org.apache.http.client.fluent.*;

 

public class Example {

  public static void main(String[] args) throws Exception {

    String res = Executor.newInstance()

     .execute(Request.Delete("http://127.0.0.1:22999/api/proxies/{PORT}"))

     .returnContent().asString();

 

    System.out.println(res)

  }

}

C#

using System;

using System.Net;

using System.Net.Http;

using System.Net.Http.Headers;

 

public class Program {

  public static async Task Main() {

    var client = new HttpClient();

    var requestMessage = new HttpRequestMessage {

      Method = HttpMethod.Delete,

     RequestUri = new Uri("http://127.0.0.1:22999/api/proxies/{PORT}")

    };

    var response = await client.SendAsync(requestMessage);

    var responseString = await response.Content.ReadAsStringAsync();

    Console.WriteLine(responseString);

  }

}

 

Python

#!/usr/bin/env python

print('If you get error "ImportError: No module named requests", please install it:\n$ sudo pip install requests');

import requests

 

r = requests.delete('http://127.0.0.1:22999/api/proxies/{PORT}')

print(r.content)

 

Update a proxy port

API endpoint: PUT /api/proxies/{PORT}

*PORT : existing proxy port number

PUT Body: See params in Create a new proxy port API

Sample Response:

{"port":24000,"zone":"ZONE","proxy_type":"persist","customer":"CUSTOMER","password":"PASSWORD","whitelist_ips":[]}

 

Shell

curl -X PUT "http://127.0.0.1:22999/api/proxies/{PORT}" -H "Content-Type: application/json" -d "{\"proxy\":{\"port\":24000,\"zone\":\"ZONE\",\"proxy_type\":\"persist\",\"customer\":\"CUSTOMER\",\"password\":\"PASSWORD\",\"whitelist_ips\":[]}}"

Node.js

#!/usr/bin/env node

require('request-promise')({

method: 'PUT',

url: 'http://127.0.0.1:22999/api/proxies/{PORT}',

       json: {'proxy':{'port':24000,'zone': 'ZONE','proxy_type':'persist','customer':'CUSTOMER','password':'PASSWORD','whitelist_ips':[]}}

}).then(function(data){ console.log(data); },

function(err){ console.error(err); });

Java

package example;

 

import org.apache.http.HttpHost;

import org.apache.http.client.fluent.*;

 

public class Example {

  public static void main(String[] args) throws Exception {

   String body = "{\"proxy\":{\"port\":24000,\"zone\":\"ZONE\",\"proxy_type\":\"persist\",\"customer\":\"CUSTOMER\",\"password\":\"PASSWORD\",\"whitelist_ips\":[]}}";

    String res = Executor.newInstance()

     .execute(Request.Put("http://127.0.0.1:22999/api/proxies/{PORT}"))

     .bodyString(body, ContentType.APPLICATION_JSON))

     .returnContent().asString();

 

    System.out.println(res)

  }

}

C#

using System;

using System.Net;

using System.Net.Http;

using System.Net.Http.Headers;

 

public class Program {

  public static async Task Main() {

    var client = new HttpClient();

    var requestMessage = new HttpRequestMessage {

      Method = HttpMethod.Put,

     RequestUri = new Uri("http://127.0.0.1:22999/api/proxies/{PORT}"),

     Content = new StringContent(JsonConvert.SerializeObject(new {

       proxy = new {

         port = 24000, zone = "ZONE", proxy_type = "persist", customer = "CUSTOMER", password = "PASSWORD", whitelist_ips = []

       }

     }), Encoding.UTF8, "application/json"))

    };

    var response = await client.SendAsync(requestMessage);

    var responseString = await response.Content.ReadAsStringAsync();

    Console.WriteLine(responseString);

  }

}

 

Python

#!/usr/bin/env python

print('If you get error "ImportError: No module named requests", please install it:\n$ sudo pip install requests');

import requests

 

data = {'proxy':{'port':24000,'zone': 'ZONE','proxy_type':'persist','customer':'CUSTOMER','password':'PASSWORD','whitelist_ips':[]}}

r = requests.put('http://127.0.0.1:22999/api/proxies/{PORT}', data=json.dumps(data))

print(r.content)

Get proxy port status

API endpoint: GET /api/proxy_status/{PORT}

*PORT : existing proxy port number

Sample Response: {"status":"ok","status_details":[]}

 

Shell

curl "http://127.0.0.1:22999/api/proxy_status/{PORT}"

Node.js

#!/usr/bin/env node

require('request-promise')({

url: 'http://127.0.0.1:22999/api/proxy_status/{PORT}'

}).then(function(data){ console.log(data); },

function(err){ console.error(err); });

Java

package example;

 

import org.apache.http.HttpHost;

import org.apache.http.client.fluent.*;

 

public class Example {

  public static void main(String[] args) throws Exception {

    String res = Executor.newInstance()

     .execute(Request.Get("http://127.0.0.1:22999/api/proxy_status/{PORT}"))

     .returnContent().asString();

    System.out.println(res)

  }

}

C#

using System;

using System.Net;

using System.Net.Http;

using System.Net.Http.Headers;

 

public class Program {

  public static async Task Main() {

    var client = new HttpClient();

    var requestMessage = new HttpRequestMessage {

      Method = HttpMethod.Get,

     RequestUri = new Uri("http://127.0.0.1:22999/api/proxy_status/{PORT}")

    };

    var response = await client.SendAsync(requestMessage);

    var responseString = await response.Content.ReadAsStringAsync();

    Console.WriteLine(responseString);

  }

}

 

Python

#!/usr/bin/env python

print('If you get error "ImportError: No module named requests", please install it:\n$ sudo pip install requests');

import requests

 

r = requests.get('http://127.0.0.1:22999/api/proxy_status/{PORT}')

print(r.content)

Refresh Proxy Manager port sessions

API endpoint: GET /api/refresh_sessions/{PORT}

*PORT : existing proxy port number

 

Shell

curl "http://127.0.0.1:22999/api/refresh_sessions/{PORT}"

Node.js

#!/usr/bin/env node

require('request-promise')({

url: 'http://127.0.0.1:22999/api/refresh_sessions{PORT}'

}).then(function(data){ console.log(data); },

function(err){ console.error(err); });

Java

package example;

 

import org.apache.http.HttpHost;

import org.apache.http.client.fluent.*;

 

public class Example {

  public static void main(String[] args) throws Exception {

    String res = Executor.newInstance()

     .execute(Request.Get("http://127.0.0.1:22999/api/refresh_sessions/{PORT}"))

     .returnContent().asString();

    System.out.println(res)

  }

}

C#

using System;

using System.Net;

using System.Net.Http;

using System.Net.Http.Headers;

 

public class Program {

  public static async Task Main() {

    var client = new HttpClient();

    var requestMessage = new HttpRequestMessage {

      Method = HttpMethod.Get,

     RequestUri = new Uri("http://127.0.0.1:22999/api/refresh_sessions/{PORT}")

    };

    var response = await client.SendAsync(requestMessage);

    var responseString = await response.Content.ReadAsStringAsync();

    Console.WriteLine(responseString);

  }

}

 

Python

#!/usr/bin/env python

print('If you get error "ImportError: No module named requests", please install it:\n$ sudo pip install requests');

import requests

 

r = requests.get('http://127.0.0.1:22999/api/refresh_sessions/{PORT}')

print(r.content)

Enable SSL analyzing on all proxy ports

API endpoint: POST /api/enable_ssl

 

Shell

curl -X POST "http://127.0.0.1:22999/api/enable_ssl"

Node.js

#!/usr/bin/env node

require('request-promise')({

method: 'POST',

url: 'http://127.0.0.1:22999/api/enable_ssl'

}).then(function(data){ console.log(data); },

function(err){ console.error(err); });

Java

package example;

 

import org.apache.http.HttpHost;

import org.apache.http.client.fluent.*;

 

public class Example {

  public static void main(String[] args) throws Exception {

    String res = Executor.newInstance()

     .execute(Request.Post("http://127.0.0.1:22999/api/enable_ssl")

     .returnContent().asString();

 

    System.out.println(res)

  }

}

C#

using System;

using System.Net;

using System.Net.Http;

using System.Net.Http.Headers;

 

public class Program {

  public static async Task Main() {

    var client = new HttpClient();

    var requestMessage = new HttpRequestMessage {

      Method = HttpMethod.Post,

     RequestUri = new Uri("http://127.0.0.1:22999/api/enable_ssl")

    };

    var response = await client.SendAsync(requestMessage);

    var responseString = await response.Content.ReadAsStringAsync();

    Console.WriteLine(responseString);

  }

}

 

Python

#!/usr/bin/env python

print('If you get error "ImportError: No module named requests", please install it:\n$ sudo pip install requests');

import requests

 

r = requests.post('http://127.0.0.1:22999/api/enable_ssl')

print(r.content)

 

 

IP Handling

 

Ban an IP (single)

API endpoint: POST /api/proxies/{PORT}/banip

*PORT : existing proxy port number

POST body

Required :

  • ip="1.2.1.2" [string] - IP to ban

Optional :

  • domain="example.com" [string] - Ban the IP for sending requests to the specified domain
  • ms=60000 [number] - Ban the IP for specified milliseconds

 

Shell

curl "http://127.0.0.1:22999/api/proxies/{PORT}/banip" -H "Content-Type: application/json" -d "{\"ip\":\"1.2.1.2\",\"domain\":\"example.com\",\"ms\":60000}"

Node.js

#!/usr/bin/env node

require('request-promise')({

method: 'POST',

url: 'http://127.0.0.1:22999/api/proxies/{PORT}/banip',

json: {'ip':'1.2.1.2','domain':'example.com','ms':60000}

}).then(function(data){ console.log(data); },

function(err){ console.error(err); });

Java

package example;

 

import org.apache.http.HttpHost;

import org.apache.http.client.fluent.*;

 

public class Example {

  public static void main(String[] args) throws Exception {

   String body = "{\"ip\":\"1.2.1.2\",\"domain\":\"example.com\",\"ms\":60000}";

    String res = Executor.newInstance()

     .execute(Request.Post("http://127.0.0.1:22999/api/proxies/{PORT}/banip")

     .bodyString(body, ContentType.APPLICATION_JSON))

     .returnContent().asString();

 

    System.out.println(res)

  }

}

C#

using System;

using System.Net;

using System.Net.Http;

using System.Net.Http.Headers;

 

public class Program {

  public static async Task Main() {

    var client = new HttpClient();

    var requestMessage = new HttpRequestMessage {

      Method = HttpMethod.Post,

     RequestUri = new Uri("http://127.0.0.1:22999/api/proxies/{PORT}/banip"),

     Content = new StringContent(JsonConvert.SerializeObject(new {

       ip = "1.2.1.2",

       domain = "example.com",

       ms = 60000

     }), Encoding.UTF8, "application/json"))

    };

    var response = await client.SendAsync(requestMessage);

    var responseString = await response.Content.ReadAsStringAsync();

    Console.WriteLine(responseString);

  }

}

 

Python

#!/usr/bin/env python

print('If you get error "ImportError: No module named requests", please install it:\n$ sudo pip install requests');

import requests

 

data = {'ip':'1.2.1.2','domain':'example.com','ms':60000}

r = requests.post('http://127.0.0.1:22999/api/proxies/{PORT}/banip', data=json.dumps(data))

print(r.content)

 

Ban IPs (array)

API endpoint: POST /api/proxies/{PORT}/banips

*PORT : existing proxy port number

POST body

Required :

  • ips=["10.0.0.1","20.0.0.1"] [array] - IPs to ban

Optional :

  • domain="example.com" [string] - Ban the IP for sending requests to the specified domain
  • ms=60000 [number] - Ban the IP for specified milliseconds

 

Shell

curl "http://127.0.0.1:22999/api/proxies/{PORT}/banips" -H "Content-Type: application/json" -d "{\"ips\":[\"10.0.0.1\",\"20.0.0.1\"],\"domain\":\"example.com\",\"ms\":60000}"

Node.js

#!/usr/bin/env node

require('request-promise')({

method: 'POST',

url: 'http://127.0.0.1:22999/api/proxies/{PORT}/banips',

json: {'ips':['10.0.0.1','20.0.0.1'],'domain':'example.com','ms':60000}

}).then(function(data){ console.log(data); },

function(err){ console.error(err); });

Java

package example;

 

import org.apache.http.HttpHost;

import org.apache.http.client.fluent.*;

 

public class Example {

  public static void main(String[] args) throws Exception {

   String body = "{\"ips\":[\"10.0.0.1\",\"20.0.0.1\"],\"domain\":\"example.com\",\"ms\":60000}";

    String res = Executor.newInstance()

     .execute(Request.Post("http://127.0.0.1:22999/api/proxies/{PORT}/banips")

     .bodyString(body, ContentType.APPLICATION_JSON))

     .returnContent().asString();

 

    System.out.println(res)

  }

}

C#

using System;

using System.Net;

using System.Net.Http;

using System.Net.Http.Headers;

 

public class Program {

  public static async Task Main() {

    var client = new HttpClient();

    var requestMessage = new HttpRequestMessage {

      Method = HttpMethod.Post,

     RequestUri = new Uri("http://127.0.0.1:22999/api/proxies/{PORT}/banips"),

     Content = new StringContent(JsonConvert.SerializeObject(new {

       ips = [ "10.0.0.1","20.0.0.1" ],

       domain = "example.com",

       ms = 60000

     }), Encoding.UTF8, "application/json"))

    };

    var response = await client.SendAsync(requestMessage);

    var responseString = await response.Content.ReadAsStringAsync();

    Console.WriteLine(responseString);

  }

}

 

Python

#!/usr/bin/env python

print('If you get error "ImportError: No module named requests", please install it:\n$ sudo pip install requests');

import requests

 

data = {'ips':['10.0.0.1','20.0.0.1'],'domain':'example.com','ms':60000}

r = requests.post('http://127.0.0.1:22999/api/proxies/{PORT}/banips', data=json.dumps(data))

print(r.content)

Ban an IP for all ports

API endpoint: POST /api/banip

POST body

Required :

  • ip="1.2.1.2" [string] - IP to ban

Optional :

  • domain="example.com" [string] - Ban the IP for sending requests to the specified domain
  • ms=60000 [number] - Ban the IP for specified milliseconds

 

Shell

curl "http://127.0.0.1:22999/api/banip" -H "Content-Type: application/json" -d "{\"ip\":\"1.2.1.2\",\"domain\":\"example.com\",\"ms\":60000}"

Node.js

#!/usr/bin/env node

require('request-promise')({

method: 'POST',

url: 'http://127.0.0.1:22999/api/banip',

json: {'ip':'1.2.1.2','domain':'example.com','ms':60000}

}).then(function(data){ console.log(data); },

function(err){ console.error(err); });

Java

package example;

 

import org.apache.http.HttpHost;

import org.apache.http.client.fluent.*;

 

public class Example {

  public static void main(String[] args) throws Exception {

   String body = "{\"ip\":\"1.2.1.2\",\"domain\":\"example.com\",\"ms\":60000}";

    String res = Executor.newInstance()

     .execute(Request.Post("http://127.0.0.1:22999/api/banip")

     .bodyString(body, ContentType.APPLICATION_JSON))

     .returnContent().asString();

 

    System.out.println(res)

  }

}

C#

using System;

using System.Net;

using System.Net.Http;

using System.Net.Http.Headers;

 

public class Program {

  public static async Task Main() {

    var client = new HttpClient();

    var requestMessage = new HttpRequestMessage {

      Method = HttpMethod.Post,

     RequestUri = new Uri("http://127.0.0.1:22999/banip"),

     Content = new StringContent(JsonConvert.SerializeObject(new {

       ip = "1.2.1.2",

       domain = "example.com",

       ms = 60000

     }), Encoding.UTF8, "application/json"))

    };

    var response = await client.SendAsync(requestMessage);

    var responseString = await response.Content.ReadAsStringAsync();

    Console.WriteLine(responseString);

  }

}

 

Python

#!/usr/bin/env python

print('If you get error "ImportError: No module named requests", please install it:\n$ sudo pip install requests');

import requests

 

data = {'ip':'1.2.1.2','domain':'example.com','ms':60000}

r = requests.post('http://127.0.0.1:22999/api/banip', data=json.dumps(data))

print(r.content)

Unban an IP

API endpoint: POST /api/proxies/{PORT}/unbanip

*PORT : existing proxy port number

POST body

Required :

  • ip="1.2.1.2" [string] - IP to unban

Optional :

  • domain="example.com" [string] - Unban the IP for sending requests to the specified domain

 

Shell

curl "http://127.0.0.1:22999/api/proxies/{PORT}/unbanip" -H "Content-Type: application/json" -d "{\"ip\":\"1.2.1.2\",\"domain\":\"example.com\"}"

Node.js

#!/usr/bin/env node

require('request-promise')({

method: 'POST',

url: 'http://127.0.0.1:22999/api/proxies/{PORT}/unbanip',

json: {'ip':'1.2.1.2','domain':'example.com'}

}).then(function(data){ console.log(data); },

function(err){ console.error(err); });

Java

package example;

 

import org.apache.http.HttpHost;

import org.apache.http.client.fluent.*;

 

public class Example {

  public static void main(String[] args) throws Exception {

   String body = "{\"ip\":\"1.2.1.2\",\"domain\":\"example.com\"}";

    String res = Executor.newInstance()

     .execute(Request.Post("http://127.0.0.1:22999/api/proxies/{PORT}/unbanip")

     .bodyString(body, ContentType.APPLICATION_JSON))

     .returnContent().asString();

 

    System.out.println(res)

  }

}

C#

using System;

using System.Net;

using System.Net.Http;

using System.Net.Http.Headers;

 

public class Program {

  public static async Task Main() {

    var client = new HttpClient();

    var requestMessage = new HttpRequestMessage {

      Method = HttpMethod.Post,

     RequestUri = new Uri("http://127.0.0.1:22999/api/proxies/{PORT}/unbanip"),

     Content = new StringContent(JsonConvert.SerializeObject(new {

       ip = "1.2.1.2",

       domain = "example.com"

     }), Encoding.UTF8, "application/json"))

    };

    var response = await client.SendAsync(requestMessage);

    var responseString = await response.Content.ReadAsStringAsync();

    Console.WriteLine(responseString);

  }

}

 

Python

#!/usr/bin/env python

print('If you get error "ImportError: No module named requests", please install it:\n$ sudo pip install requests');

import requests

 

data = {'ip':'1.2.1.2','domain':'example.com'}

r = requests.post('http://127.0.0.1:22999/api/proxies/{PORT}/unbanip', data=json.dumps(data))

print(r.content)

 

 

Unban IPs

API endpoint: POST /api/proxies/{PORT}/unbanips

*PORT : existing proxy port number

 

Shell

curl "http://127.0.0.1:22999/api/proxies/{PORT}/unbanips"

Node.js

#!/usr/bin/env node

require('request-promise')({

method: 'POST',

url: 'http://127.0.0.1:22999/api/proxies/{PORT}/unbanips'

}).then(function(data){ console.log(data); },

function(err){ console.error(err); });

Java

package example;

 

import org.apache.http.HttpHost;

import org.apache.http.client.fluent.*;

 

public class Example {

  public static void main(String[] args) throws Exception {

    String res = Executor.newInstance()

     .execute(Request.Post("http://127.0.0.1:22999/api/proxies/{PORT}/unbanips")

     .returnContent().asString();

 

    System.out.println(res)

  }

}

C#

using System;

using System.Net;

using System.Net.Http;

using System.Net.Http.Headers;

 

public class Program {

  public static async Task Main() {

    var client = new HttpClient();

    var requestMessage = new HttpRequestMessage {

      Method = HttpMethod.Post,

     RequestUri = new Uri("http://127.0.0.1:22999/api/proxies/{PORT}/unbanips")

    };

    var response = await client.SendAsync(requestMessage);

    var responseString = await response.Content.ReadAsStringAsync();

    Console.WriteLine(responseString);

  }

}

 

Python

#!/usr/bin/env python

print('If you get error "ImportError: No module named requests", please install it:\n$ sudo pip install requests');

import requests

 

r = requests.post('http://127.0.0.1:22999/api/proxies/{PORT}/unbanips')

print(r.content)

 

Get banned IPs

API endpoint: GET /api/banlist/{PORT}

* Note : ?full=true parameter is optional and can be used to provide additional details about each entry in the ban-list

Sample Response : {"ips":["10.20.30.40","50.60.70.80|example.com"]}

 

Shell

curl "http://127.0.0.1:22999/api/banlist/{PORT}?full=true"

Node.js

#!/usr/bin/env node

require('request-promise')({

url: 'http://127.0.0.1:22999/api/banlist/{PORT}?full=true'

}).then(function(data){ console.log(data); },

function(err){ console.error(err); });

Java

package example;

 

import org.apache.http.HttpHost;

import org.apache.http.client.fluent.*;

 

public class Example {

  public static void main(String[] args) throws Exception {

    String res = Executor.newInstance()

     .execute(Request.Get("http://127.0.0.1:22999/api/banlist/{PORT}?full=true"))

     .returnContent().asString();

    System.out.println(res)

  }

}

C#

using System;

using System.Net;

using System.Net.Http;

using System.Net.Http.Headers;

 

public class Program {

  public static async Task Main() {

    var client = new HttpClient();

    var requestMessage = new HttpRequestMessage {

      Method = HttpMethod.Get,

     RequestUri = new Uri("http://127.0.0.1:22999/api/banlist/{PORT}?full=true")

    };

    var response = await client.SendAsync(requestMessage);

    var responseString = await response.Content.ReadAsStringAsync();

    Console.WriteLine(responseString);

  }

}

 

Python

#!/usr/bin/env python

print('If you get error "ImportError: No module named requests", please install it:\n$ sudo pip install requests');

import requests

 

r = requests.get('http://127.0.0.1:22999/api/banlist/{PORT}?full=true')

print(r.content)

 

Was this article helpful?