Bỏ qua để đến nội dung

Bắt đầu nhanh

Terminal window
export KEY='YOUR_KEY'
export BASE='https://ipv.rent'
Terminal window
curl -s "$BASE/api/v1/products" -H "Authorization: Bearer $KEY"
{
"products": [
{
"slug": "residential",
"name": "Residential",
"family": "traffic_gateway",
"unit": "gb",
"unit_price": "2.00",
"monthly_price_from": null,
"currency": "USD",
"min_volume": 1,
"volume_presets": [1, 5, 10, 25, 50, 100, 250, 500],
"volume_discounts": []
},
{
"slug": "ipv4",
"name": "IPv4",
"family": "dedicated",
"unit": "ip",
"unit_price": null,
"monthly_price_from": "1.49",
"currency": "USD",
"min_volume": 1,
"volume_presets": [],
"volume_discounts": []
}
]
}

slug là giá trị của trường product trong mọi yêu cầu tiếp theo. Tiếp theo, mỗi sản phẩm có một hướng riêng.

1. Giá

Terminal window
curl -s -X POST "$BASE/api/v1/quote" \
-H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' \
-d '{"product":"residential","volume":10}'
{
"unit": "2.00",
"unit_label": "per_gb",
"quantity": 10,
"discount": "0.00",
"discount_percent": "0.00",
"total": "20.00",
"currency": "USD"
}

2. Mua

Terminal window
curl -s -X POST "$BASE/api/v1/packages" \
-H "Authorization: Bearer $KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H 'Content-Type: application/json' \
-d '{
"product": "residential",
"volume": 10,
"client_reference": "first-run"
}'
{
"order_id": 128,
"package_id": 42,
"status": "completed",
"price": "20.00",
"client_reference": "first-run"
}

Lưu khóa idempotency trước khi gửi yêu cầu: lần thử lại sau khi hết thời gian chờ phải mang cùng giá trị.

3. Kết nối

Terminal window
curl -s -X POST "$BASE/api/v1/packages/42/proxies" \
-H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' \
-d '{
"count": 2,
"mode": "sticky",
"protocol": "http",
"ttl_minutes": 30,
"geo": {
"country": "us"
}
}'
{
"count": 2,
"proxies": [
{
"host": "residential.ipv.rent",
"port": 10000,
"username": "USERNAME_1",
"password": "PASSWORD",
"rotation_url": "https://ipv.rent/r/9f3c1e..."
},
{
"host": "residential.ipv.rent",
"port": 10000,
"username": "USERNAME_2",
"password": "PASSWORD",
"rotation_url": "https://ipv.rent/r/1a77b2..."
}
]
}

4. Kiểm tra

Terminal window
curl -x 'http://USERNAME_1:[email protected]:10000' https://api.ipify.org

1. Có thể chọn gì

Terminal window
curl -s "$BASE/api/v1/products/ipv4/options" -H "Authorization: Bearer $KEY"
{
"type": "ipv4",
"countries": [
{
"code": "us",
"name": "United States",
"periods": ["week", "2_weeks", "month", "2_months", "3_months"],
"quantity_max": null,
"plans": [
{
"id": "dc",
"traffic_gb": null,
"periods": ["week", "2_weeks", "month", "2_months", "3_months"],
"operators": [
{
"id": "united-states",
"name": "United States",
"available": 374
}
]
}
]
},
"..."
]
}

operators - các vị trí trong quốc gia: toàn quốc gia hoặc một thành phố. available - số địa chỉ hiện còn trống ở đó; không thể mua nhiều hơn. quantity_max: null - không có giới hạn riêng cho mỗi lần mua.

2. Giá

Terminal window
curl -s -X POST "$BASE/api/v1/quote" \
-H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' \
-d '{
"product": "ipv4",
"country": "us",
"operator": "united-states",
"period": "month",
"quantity": 2
}'
{
"unit": "1.49",
"unit_label": "per_ip",
"quantity": 2,
"discount": "0.00",
"discount_percent": "0.00",
"total": "2.98",
"currency": "USD"
}

3. Mua

Terminal window
curl -s -X POST "$BASE/api/v1/packages" \
-H "Authorization: Bearer $KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H 'Content-Type: application/json' \
-d '{
"product": "ipv4",
"country": "us",
"operator": "united-states",
"period": "month",
"quantity": 2
}'
{
"order_id": 131,
"package_id": 57,
"status": "completed",
"price": "2.98",
"client_reference": null,
"package_ids": [57],
"requested": 2,
"fulfilled": 2
}

Mọi địa chỉ của một lần mua là một gói.

4. Địa chỉ và quyền truy cập

Terminal window
curl -s "$BASE/api/v1/packages/57" -H "Authorization: Bearer $KEY"
{
"id": 57,
"family": "dedicated",
"product": "ipv4",
"status": "active",
"expires_at": "2026-11-04T12:00:00+00:00",
"auto_renew": true,
"credentials": {
"username": "USERNAME",
"password": "PASSWORD"
},
"addresses": [
{
"host": "198.51.100.11",
"port_http": 10010,
"port_socks": 10011
},
{
"host": "198.51.100.12",
"port_http": 10012,
"port_socks": 10013
}
],
"...": "..."
}

Các địa chỉ bắt đầu phản hồi trong vòng 2 phút sau khi mua.

5. Kiểm tra

Terminal window
curl -x 'http://USERNAME:[email protected]:10010' https://api.ipify.org

Gia hạn, tự động gia hạn, thay địa chỉ và dấu vân tay - trên trang Địa chỉ cố định.

1. Có thể chọn gì

Terminal window
curl -s "$BASE/api/v1/products/mobile/options" -H "Authorization: Bearer $KEY"
{
"type": "mobile",
"countries": [
{
"code": "fr",
"name": "France",
"periods": ["day", "week", "month", "3_months"],
"quantity_max": null,
"plans": [
{
"id": "unlimited",
"traffic_gb": null,
"periods": ["day", "week", "month", "3_months"],
"operators": [
{
"id": "free-mobile",
"name": "Free Mobile",
"available": 7
},
{
"id": "sfr",
"name": "SFR",
"available": 3
}
]
}
]
},
"..."
]
}

operators là các nhà mạng di động của quốc gia. available - số cổng của nhà mạng đó hiện còn trống; không thể mua nhiều hơn.

2. Giá

Terminal window
curl -s -X POST "$BASE/api/v1/quote" \
-H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' \
-d '{
"product": "mobile",
"country": "fr",
"operator": "free-mobile",
"period": "day",
"quantity": 1
}'

3. Mua

Terminal window
curl -s -X POST "$BASE/api/v1/packages" \
-H "Authorization: Bearer $KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H 'Content-Type: application/json' \
-d '{
"product": "mobile",
"country": "fr",
"operator": "free-mobile",
"period": "day",
"quantity": 1
}'

Nếu nhà mạng còn ít cổng trống hơn số lượng yêu cầu, giao dịch mua bị từ chối với 422 out_of_stock. Không có khoản nào bị trừ.

4. Cổng và quyền truy cập

Terminal window
curl -s "$BASE/api/v1/packages/58" -H "Authorization: Bearer $KEY"
{
"id": 58,
"family": "dedicated",
"product": "mobile",
"status": "active",
"credentials": {
"username": "USERNAME",
"password": "PASSWORD"
},
"addresses": [
{
"host": "fr2.mobile.ipv.rent",
"port_http": 13029,
"port_socks": 13029
}
],
"endpoint": {
"country": "fr",
"operator": "Free Mobile",
"rotation_interval_minutes": 0,
"rotation_url": "https://ipv.rent/r/9f3c1e..."
},
"capabilities": ["prolong", "rotate", "rotation_interval", "credentials", "renewal"],
"...": "..."
}

HTTP và SOCKS5 hoạt động trên cùng một cổng.

5. Kiểm tra và đổi IP

Terminal window
curl -x 'http://USERNAME:[email protected]:13029' https://api.ipify.org
curl -s 'https://ipv.rent/r/9f3c1e...'

Yêu cầu GET tới rotation_url cấp cho cổng một IP mới của cùng nhà mạng; các phản hồi được liệt kê trong Đổi IP. Trong khi IP thay đổi, cổng ngắt kết nối vài giây. Hẹn giờ đổi IP được thiết lập trong bảng điều khiển.

Gia hạn, tự động gia hạn và mật khẩu - trên trang Địa chỉ cố định: với gói di động chúng hoạt động giống như vậy. Thay địa chỉ và dấu vân tay không có cho cổng di động. Sau khi hết hạn, cổng di động không thể gia hạn.