Basic query only requires passing username and password. No other parameters are needed. Such a query will result in the request being made from a random IP address (proxy). Every new request will use a different proxy.
Code examples
In this example, a query to ip.oxylabs.io is performed from a random IP:
package example;
import org.apache.http.HttpHost;
import org.apache.http.client.fluent.*;
public class Example {
public static void main(String[] args) throws Exception {
HttpHost entry = new HttpHost("pr.oxylabs.io", 7777);
String query = Executor.newInstance()
.auth(entry, "customer-USERNAME", "PASS")
.execute(Request.Get("http://ip.oxylabs.io/location").viaProxy(entry))
.returnContent().asString();
System.out.println(query);
}
}
using System;
using System.Net;
class Example
{
static void Main()
{
var client = new WebClient();
client.Proxy = new WebProxy("pr.oxylabs.io:7777");
client.Proxy.Credentials = new NetworkCredential("customer-USERNAME", "PASSWORD");
Console.WriteLine(client.DownloadString("https://ip.oxylabs.io/location"));
}
c
require 'uri'
require 'net/http'
uri = URI.parse('https://ip.oxylabs.io/location')
proxy = Net::HTTP::Proxy('pr.oxylabs.io', 7777, 'customer-USERNAME', 'PASSWORD')
req = Net::HTTP::Get.new(uri.path)
result = proxy.start(uri.host,uri.port) do |http|
http.request(req)
end
puts result.body
A single backconnect proxy enables you to choose a specific country proxy via additional parameters in the username. This approach also supports session control. Below is a sample of credentials structure:
Session ID to keep the same IP with upcoming queries. The session expires in 10 minutes. After that, a new IP address is assigned to that session ID. Random string, 0-9, and A-Z characters are supported.
sesstime
The session time parameter keeps the same IP for a certain period. The maximum session time is 30 minutes.
Case insensitive country code in 2-letter . For example, DE for Germany, GB for the United Kingdom, TH for Thailand. You can find more details on how to use country-specific proxies .
Case insensitive city name in English. This parameter must be accompanied by cc for better accuracy, for example, cc-GB-city-london for London, United Kingdom; cc-DE-city-berlin for Berlin, Germany. For a city with more than two words, replace space with _, for example, city-st_petersburg or city-rio_de_janeiro. Click for more information on city-level targeting.
Case insensitive US state name with us_ in the beginning, for example, us_california, us_illinois. for more information on state-level targeting.