Skip to content

Generate proxy credentials

POST
/proxies/generate
curl --request POST \
--url https://api.proxyrequest.com/api/v1/proxies/generate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "package_id": "550e8400-e29b-41d4-a716-446655440002", "quantity": 2, "targeting": { "country": "us", "region": "california", "city": "los_angeles", "isp": "comcast" }, "connection": { "protocol": "http", "format": "{host}:{port}:{username}:{password}" }, "session": { "ttl": 60 } }'

Creates ready-to-use proxy credentials for a purchased package. Use targeting to choose a location or provider scope, connection to choose protocol and output format, and session to control sticky session lifetime.

Validates proxy generation request data and builds generator config.

object
package_id

Package used to generate credentials.

string format: uuid
user_id

Sub-user that will use the generated credentials.

string format: uuid
quantity
required

Number of proxies to generate

integer
>= 1 <= 5000
targeting
object
continent

Target continent code.

string
<= 255 characters
country

Target country code.

string
<= 255 characters
region

Target region or state code.

string
<= 255 characters
city

Target city code.

string
<= 255 characters
pool

Proxy pool identifier.

string
<= 255 characters
asn

Target autonomous system number.

integer
<= 65536
isp

Target internet service provider.

string
<= 255 characters
os

Target operating system: linux, windows, ios, macos, android. Use comma-separated values only when combined OS targeting is enabled.

string
<= 255 characters
connection
object
protocol

Proxy protocol. * http - http * socks5 - socks5 * auto - auto

string
Allowed values: http socks5 auto
host

Gateway host. Leave empty to use the default gateway.

string
<= 255 characters
port

Gateway port. Leave empty to use the port for the selected protocol.

integer
>= 1 <= 65535
format

Connection string format.

string
default: {protocol}://{username}:{password}@{host}:{port} >= 1 characters
session
object
ttl

Sticky session lifetime in minutes. Use 0 for rotating sessions.

integer
default: 3600 >= 30 <= 86400
Examples
ExampleGenerateHTTPProxiesForACountry

Generate HTTP proxies for a country

{
"package_id": "550e8400-e29b-41d4-a716-446655440002",
"quantity": 2,
"targeting": {
"country": "us",
"region": "california",
"city": "los_angeles",
"isp": "comcast"
},
"connection": {
"protocol": "http",
"format": "{host}:{port}:{username}:{password}"
},
"session": {
"ttl": 60
}
}

The resource or action result was created successfully.

Media typeapplication/json
object
count
required
integer
proxies
required
Array<object>
object
host
required
string
port
required
integer
protocol
required
string
username
required
string
password
required
string
connection_string
required
string
Examples
ExampleGeneratedProxyCredentials

Generated proxy credentials

{
"count": 2,
"proxies": [
{
"host": "proxy.thepremiumports.com",
"port": 8000,
"protocol": "http",
"username": "pkg-res-country-us-region-california",
"password": "proxy-password",
"connection_string": "proxy.thepremiumports.com:8000:pkg-res-country-us-region-california:proxy-password"
}
]
}

The request is malformed or violates a business rule.

Media typeapplication/json

Validation and API error payload. Field names may be added dynamically; field errors are returned as arrays of human-readable messages.

object
detail
string
non_field_errors
Array<string>
translation

Stable translation key suitable for client localisation.

string
key
additional properties
One of:
string
Examples
ExampleValidationError

Validation error

{
"non_field_errors": [
"The request could not be processed."
],
"translation": "errors.request.invalid"
}

Authentication credentials are missing, expired, or invalid.

Media typeapplication/json

Validation and API error payload. Field names may be added dynamically; field errors are returned as arrays of human-readable messages.

object
detail
string
non_field_errors
Array<string>
translation

Stable translation key suitable for client localisation.

string
key
additional properties
One of:
string
Examples
ExampleAuthenticationRequired

Authentication required

{
"detail": "Authentication credentials were not provided."
}

The authenticated account cannot perform this operation.

Media typeapplication/json

Validation and API error payload. Field names may be added dynamically; field errors are returned as arrays of human-readable messages.

object
detail
string
non_field_errors
Array<string>
translation

Stable translation key suitable for client localisation.

string
key
additional properties
One of:
string
Examples
ExamplePermissionDenied

Permission denied

{
"detail": "You do not have permission to perform this action."
}

The requested resource does not exist in the current account scope.

Media typeapplication/json

Validation and API error payload. Field names may be added dynamically; field errors are returned as arrays of human-readable messages.

object
detail
string
non_field_errors
Array<string>
translation

Stable translation key suitable for client localisation.

string
key
additional properties
One of:
string
Examples
ExampleResourceNotFound

Resource not found

{
"detail": "Not found."
}