/v1/proxy-descriptors
Requires Auth
Generate Proxy Descriptor
Generate Proxy Descriptor
Build a ready-to-use proxy descriptor for one of your active sub-users. The sub-user must belong to your account and be in the "active" lifecycle state, otherwise the endpoint returns 404. Geo-targeting, session stickiness, and the AI filter are all optional; the returned username has every requested token pre-assembled.
Tweak any value if you like — or just press Try.
| Name | Type | Required | Description |
|---|---|---|---|
| sub_user_uuid | uuid | Required | UUID of the sub-user to generate the descriptor for. Must be a sub-user you own whose lifecycle_status is "active". |
| protocol | string | Required | Proxy protocol. One of "http" or "socks5". Determines the returned port (8080 for http, 1080 for socks5). |
| location | object | Optional | Optional geo-targeting object. Omit for a random location (the username uses country "any"). |
| location.country | string | Optional | Country to target, e.g. "US". Max 32 chars. Slugified into the -country- token; defaults to "any" when omitted. |
| location.region | string | Optional | Region/state to target, e.g. "California". Max 128 chars. Adds a -region- token. |
| location.city | string | Optional | City to target, e.g. "Los Angeles". Max 128 chars. Adds a -city- token. |
| session | object | Optional | Optional session-control object. Omit for a rotating (per-request) IP. |
| session.mode | string | Optional | Session mode: "rotating" (default — new IP each request) or "sticky" (hold one IP). Only "sticky" adds -sid-/-ttl- tokens. |
| session.ttl | string | Optional | Sticky-session lifetime. One of "30m" or "12h". Defaults to "30m". Only applied when mode is "sticky". |
| session.id | string | Optional | Sticky-session identifier: exactly 16 hexadecimal characters. If omitted while mode is "sticky", a random 16-hex id is generated for you. |
| filter | string | Optional | AI filter tier. One of "filter-high", "filter-high-speed-fast", "filter-medium", "filter-medium-speed-fast", or "none". Defaults to "filter-medium". "none" leaves the filter token off entirely. |
curl -X POST https://api.proxyhat.com/v1/proxy-descriptors \
-H "Authorization: Bearer __API_KEY__" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"sub_user_uuid": "7c9f2a1b-4d3e-4f5a-9b6c-1e2d3f4a5b6c",
"protocol": "http",
"location": { "country": "US", "region": "California", "city": "Los Angeles" },
"session": { "mode": "sticky", "ttl": "30m" },
"filter": "filter-medium"
}'
import requests
response = requests.post(
"https://api.proxyhat.com/v1/proxy-descriptors",
headers={
"Authorization": "Bearer __API_KEY__",
"Content-Type": "application/json",
"Accept": "application/json",
},
json={
"sub_user_uuid": "7c9f2a1b-4d3e-4f5a-9b6c-1e2d3f4a5b6c",
"protocol": "http",
"location": {"country": "US", "region": "California", "city": "Los Angeles"},
"session": {"mode": "sticky", "ttl": "30m"},
"filter": "filter-medium",
},
)
descriptor = response.json()["payload"]
print(descriptor["url"])
const response = await fetch("https://api.proxyhat.com/v1/proxy-descriptors", {
method: "POST",
headers: {
"Authorization": "Bearer __API_KEY__",
"Content-Type": "application/json",
"Accept": "application/json",
},
body: JSON.stringify({
sub_user_uuid: "7c9f2a1b-4d3e-4f5a-9b6c-1e2d3f4a5b6c",
protocol: "http",
location: { country: "US", region: "California", city: "Los Angeles" },
session: { mode: "sticky", ttl: "30m" },
filter: "filter-medium",
}),
});
const { payload } = await response.json();
console.log(payload.url);
payload := map[string]interface{}{
"sub_user_uuid": "7c9f2a1b-4d3e-4f5a-9b6c-1e2d3f4a5b6c",
"protocol": "http",
"location": map[string]string{"country": "US", "region": "California", "city": "Los Angeles"},
"session": map[string]string{"mode": "sticky", "ttl": "30m"},
"filter": "filter-medium",
}
body, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", "https://api.proxyhat.com/v1/proxy-descriptors", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer __API_KEY__")
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
var result struct {
Payload struct {
URL string `json:"url"`
} `json:"payload"`
}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result.Payload.URL)