/v1/locations/countries
Requires Auth
List Countries
List Countries
Retrieve a list of available proxy countries. Filter by country code, name, or connection type. Results are paginated using limit and offset parameters.
| Name | Type | Required | Description |
|---|---|---|---|
| code | string | Optional | Exact match on the country code (e.g. "US", "GB"). |
| name | string | Optional | Partial search on the country name (e.g. "United"). |
| connection_type | string | Optional | Filter by connection type: "residential" or "mobile". |
| limit | integer | Optional | Maximum number of results to return. Default 100, max 500. |
| offset | integer | Optional | Number of results to skip for pagination. |
curl "https://api.proxyhat.com/v1/locations/countries?connection_type=residential&limit=10" \
-H "Authorization: Bearer __API_KEY__" \
-H "Accept: application/json"
import requests
response = requests.get(
"https://api.proxyhat.com/v1/locations/countries",
headers={
"Authorization": "Bearer __API_KEY__",
"Accept": "application/json",
},
params={
"connection_type": "residential",
"limit": 10,
},
)
countries = response.json()
for country in countries:
print(f"{country[\"code\"]} — {country[\"name\"]}")
const params = new URLSearchParams({ connection_type: "residential", limit: "10" });
const response = await fetch(`https://api.proxyhat.com/v1/locations/countries?${params}`, {
headers: {
"Authorization": "Bearer __API_KEY__",
"Accept": "application/json",
},
});
const countries = await response.json();
countries.forEach(c => console.log(`${c.code} — ${c.name}`));
req, _ := http.NewRequest("GET", "https://api.proxyhat.com/v1/locations/countries?connection_type=residential&limit=10", nil)
req.Header.Set("Authorization", "Bearer __API_KEY__")
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
var countries []map[string]interface{}
json.NewDecoder(resp.Body).Decode(&countries)
for _, c := range countries {
fmt.Printf("%s — %s\n", c["code"], c["name"])
}
[
{
"code": "US",
"name": "United States",
"availability": "high",
"connection_type": "residential"
}
]