API endpoint:
GET /api/zone/count_available_ips
Parameters:
zone=ZONE
[string] - name of the Zoneplan={...}
[JSON object] - abstract plan parameterspool_ip_type=static_res
[string] - use in case you want to get the amount of ISP IPs available, the default amount for that API endpoint is data center peer IPs.ips_type=shared|selective|dedicated
[string] - type of the IPs
* Note : when ips_type=selective, domain_whitelist is requiredcountry=country_name
[string] - IPs location countrycountry_city=country_name-city_name
[string] - defines the city location of the IPscity=true
[boolean] - requred with "country_city" parameterdomain_whitelist=d1.com d2.com
[string] - space separated list of domains.
* Note: for [curl] the spaces should be urlencoded : d1.com%20d2.comgeo_db={...}
[JSON object] - turns on/off using of the IP`s location databasesmaxmind=true
[boolean] - use MaxMind IP location DBdbip=true
[boolean] - use DB-IP IP location DBgoogle=true
[boolean] - use Google IP location DBip2location=true
[boolean] - use IP2Location IP location DBipcn=true
[boolean] - use ip.cn IP location DB
Sample Response:
{count: 1234}
Plan Examples :
-
Available IPs for current Zone plan:
curl "https://api.brightdata.com/count_available_ips?zone=ZONE" -H "Authorization: Bearer API_TOKEN"
-
Abstract plan, dedicated IPs:
curl "https://api.brightdata.com/count_available_ips?plan=\{\"ips_type\":\"dedicated\"\}" -H "Authorization: Bearer API_TOKEN"
-
Abstract plan, shared IPs located in United States:
curl "https://api.brightdata.com/count_available_ips?plan=\{\"country\":\"us\",\"ips_type\":\"shared\"\}" -H "Authorization: Bearer API_TOKEN"
-
Abstract plan, dedicated ips located in United States:
curl "https://api.brightdata.com/count_available_ips?plan=\{\"country\":\"us\",\"ips_type\":\"dedicated\"\}" -H "Authorization: Bearer API_TOKEN"
-
Abstract plan, shared IPs located in United States, Denver:
curl "https://api.brightdata.com/count_available_ips?plan=\{\"ips_type\":\"shared\",\"country_city\":\"us-denver\",\"city\":true\}" -H "Authorization: Bearer API_TOKEN"
-
Abstract plan, shared IPs located in US, exclusive for domains: amazon.com, fb.com:
curl "https://api.brightdata.com/count_available_ips?plan=\{\"ips_type\":\"selective\",\"country\":\"us\",\"domain_whitelist\":\"amazon.com%20fb.com\"\}" -H "Authorization: Bearer API_TOKEN"
-
Abstract plan, shared IPs located in US, geo IP databases: should persist in both maxmind and dbip:
curl "https://api.brightdata.com/count_available_ips?plan=\{\"ips_type\":\"shared\",\"country\":\"us\",\"geo_db\":\{\"maxmind\":true,\"dbip\":true\}\}" -H "Authorization: Bearer API_TOKEN"
Shell
curl "https://api.brightdata.com/zone/count_available_ips?[zone=ZONE&plan={...}]" -H "Authorization: Bearer API_TOKEN"
Node.js
#!/usr/bin/env node
require('request-promise')({
url: 'https://api.brightdata.com/zone/count_available_ips?[zone=ZONE&plan={...}]',
headers: {'Authorization': 'Bearer API_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() .addHeader("Authorization", "Bearer API_TOKEN")
.execute(Request.Get("https://api.brightdata.com/zone/count_available_ips?[zone=ZONE&plan={...}]"))
.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("https://api.brightdata.com/zone/count_available_ips?[zone=ZONE&plan={...}]"), Headers = { {"Authorization", "Bearer API_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
headers = {'Authorization': 'Bearer API_TOKEN'}
r = requests.get('https://api.brightdata.com/zone/count_available_ips?[zone=ZONE&plan={...}]', headers=headers)
print(r.content)