Send Your First Request
ProxiesSend your first request through Residential Proxies with copy-paste examples.
You need your proxy Username, Password, and Host (IP or DNS) from the Proxy configuration tab. Add targeting flags to the username as shown in Configure.
Replace the placeholders before you run any example:
| Placeholder | Where to get it |
|---|---|
YOUR_USERNAME | API credentials ? Username |
YOUR_PASSWORD | API credentials ? Password |
YOUR_PROXY_HOST | Generated endpoint host (IP or DNS) |
PORT | Port from the endpoint (for example 9000 for rotating HTTP/HTTPS) |
The examples below use Germany country targeting (-country-de) on a rotating HTTP port.
Code examples
curl -x "http://YOUR_USERNAME-country-de:YOUR_PASSWORD@YOUR_PROXY_HOST:PORT" \
"http://ip-api.com/json"import pprint
import requests
host = "YOUR_PROXY_HOST"
port = 9000
username = "YOUR_USERNAME-country-de"
password = "YOUR_PASSWORD"
proxy_url = f"http://{username}:{password}@{host}:{port}"
proxies = {
"http": proxy_url,
"https": proxy_url,
}
url = "http://ip-api.com/json"
response = requests.get(url, proxies=proxies, timeout=60)
pprint.pprint(response.json())import axios from "axios";
import { HttpsProxyAgent } from "https-proxy-agent";
const host = "YOUR_PROXY_HOST";
const port = 9000;
const username = "YOUR_USERNAME-country-de";
const password = "YOUR_PASSWORD";
const proxyUrl = `http://${username}:${password}@${host}:${port}`;
const agent = new HttpsProxyAgent(proxyUrl);
const { data } = await axios.get("http://ip-api.com/json", {
httpAgent: agent,
httpsAgent: agent,
proxy: false,
timeout: 60000,
});
console.log(data);<?php
$host = "YOUR_PROXY_HOST";
$port = 9000;
$username = "YOUR_USERNAME-country-de";
$password = "YOUR_PASSWORD";
$proxy = "http://{$username}:{$password}@{$host}:{$port}";
$ch = curl_init("http://ip-api.com/json");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_PROXY, $proxy);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
$response = curl_exec($ch);
curl_close($ch);
echo $response;package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
proxyURL, err := url.Parse("http://YOUR_USERNAME-country-de:YOUR_PASSWORD@YOUR_PROXY_HOST:9000")
if err != nil {
panic(err)
}
client := &http.Client{
Transport: &http.Transport{Proxy: http.ProxyURL(proxyURL)},
}
resp, err := client.Get("http://ip-api.com/json")
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil {
panic(err)
}
fmt.Println(string(body))
}Output
The examples above send a request to http://ip-api.com/json through the Residential proxy. A successful Germany-targeted response looks like this:
{
"status": "success",
"country": "Germany",
"countryCode": "DE",
"region": "BY",
"regionName": "Bavaria",
"city": "Munich",
"zip": "80687",
"lat": 48.1394,
"lon": 11.4997,
"timezone": "Europe/Berlin",
"isp": "M-net Telekommunikations GmbH",
"org": "MNET",
"as": "AS8767 M-net Telekommunikations GmbH",
"query": "82.135.83.250"
}query is the exit IP. City and ISP can vary within the country when you only set -country-de.
Narrower targeting
Add state, city, ASN, or OS flags to the username when you need a tighter
location, for example
-country-de-state-badenwurttemberg. If a combination has no available
peers, the proxy returns an error asking you to change targeting. See Configure.
Replace http://ip-api.com/json with the site you want to reach. That is your first Residential Proxies request.
Was this page helpful?