Đăng nhập
Cloud VPS Proxy Tên miền Tạo website Cronjob
Cloud VPS Proxy Tên miền Tạo website Cronjob
Trang chủ
Dịch vụ
Nạp tiền
Lịch sử
Tài khoản

Tài liệu API Proxy

Tài liệu kỹ thuật tích hợp hệ thống Proxy Dân cư (Residential) & Datacenter chất lượng cao, tốc độ cao, hỗ trợ HTTP & SOCKS5, tự động trừ tiền qua ví đại lý.

Base URL: https://lpkvps.cfd Định dạng: JSON (UTF-8) Xác thực: X-Api-Token Chuẩn tài liệu: DichVuDark.vip v2

6.1. Hướng Dẫn Xác Thực & API Token Cá Nhân

Bạn chưa đăng nhập
Đăng nhập để xem Token API cá nhân và số dư ví của bạn. Mọi request bên dưới dùng placeholder YOUR_API_TOKEN.
Đăng nhập ngay

1. Header X-Api-Token (Khuyên dùng)

Truyền qua HTTP Request Header chuẩn:

X-Api-Token: YOUR_API_TOKEN

2. Header Authorization: Bearer

Chuẩn Authorization token OAuth2/Bearer:

Authorization: Bearer YOUR_API_TOKEN

3. Tham số Query URL

Tiện lợi khi test trực tiếp trên trình duyệt:

GET /api/proxy/packages?token=YOUR_API_TOKEN

4. Body JSON (cho request POST)

Đặt trường token trực tiếp trong JSON body:

{ "token": "YOUR_API_TOKEN", ... }
6.2. Cơ Chế Tính Giá & Biên Lợi Nhuận Đại Lý
  • Hệ thống hỗ trợ cấu hình tăng giá bán theo phần trăm (%) hoặc số tiền cố định (VNĐ).
  • Khi gọi GET /api/proxy/packages, trường price là giá bán ra đại lý đã áp dụng chiết khấu/tăng giá, và trường original_price là giá gốc tham chiếu.
  • Khi gọi POST /api/proxy/buy hoặc POST /api/proxy/renew, số tiền trừ trong ví tài khoản được tính theo: total_price = (unit_price / duration_days) * days * quantity.
GET

6.3. Lấy Danh Sách Gói Proxy & Bảng Giá

/api/proxy/packages

Lấy toàn bộ các gói Proxy đang kinh doanh (Residential, Datacenter) kèm giá bán, chu kỳ ngày, số ngày tối thiểu và số lượng mua tối đa.

GET https://lpkvps.cfd/api/proxy/packages Không cần params
curl -X GET "https://lpkvps.cfd/api/proxy/packages" \ -H "X-Api-Token: YOUR_API_TOKEN" \ -H "Accept: application/json"
{
  "status": "success",
  "data": [
    {
      "id": 1,
      "name": "Proxy Dân Cư US Cao Cấp",
      "location": "residential",
      "type": "share",
      "duration_days": 30,
      "min_days": 1,
      "max_qty": 100,
      "price": 60000,
      "original_price": 50000
    },
    {
      "id": 2,
      "name": "Proxy Datacenter VN Tốc Độ Cao",
      "location": "datacenter",
      "type": "dedicated",
      "duration_days": 30,
      "min_days": 1,
      "max_qty": 50,
      "price": 40000,
      "original_price": 30000
    }
  ]
}
POST

6.4. Đặt Mua Proxy Tự Động

/api/proxy/buy

Tạo đơn đặt mua proxy mới từ hệ thống. Số dư ví tài khoản sẽ được trừ tự động theo công thức: total_price = unit_price * quantity. Nếu nhà cung cấp hết hàng hoặc lỗi, tiền sẽ được hoàn 100% về ví ngay lập tức.

POST https://lpkvps.cfd/api/proxy/buy Content-Type: application/json
TrườngKiểuBắt buộcMô tả
package_idintegerBắt buộcID gói proxy cần mua (lấy từ endpoint /api/proxy/packages)
daysintegerBắt buộcSố ngày mua (phải >= min_days của gói, ví dụ: 30)
quantityintegerBắt buộcSố lượng proxy muốn mua (>= 1 và <= max_qty)
protocolstringTuỳ chọnGiao thức kết nối: HTTP hoặc SOCKS5 (Mặc định: HTTP)
usernamestringTuỳ chọnTài khoản proxy tuỳ chỉnh (Mặc định: ngẫu nhiên hệ thống tạo)
passwordstringTuỳ chọnMật khẩu proxy tuỳ chỉnh (Mặc định: ngẫu nhiên hệ thống tạo)
curl -X POST "https://lpkvps.cfd/api/proxy/buy" \ -H "X-Api-Token: YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "package_id": 1, "days": 30, "quantity": 1, "protocol": "HTTP" }'
{
  "status": "success",
  "data": [
    {
      "id": 105,
      "ip_address": "104.28.19.45",
      "port": 9050,
      "username": "usr_78129",
      "password": "pwd_88124",
      "protocol": "HTTP",
      "status": "active",
      "expired_at": "2026-10-29 23:59:59"
    }
  ]
}
GET

6.5. Danh Sách Proxy Đã Mua (Orders)

/api/proxy/orders

Lấy danh sách tất cả proxy đã đặt mua của tài khoản kèm trạng thái, ngày hết hạn và thông tin đăng nhập, có hỗ trợ phân trang và tìm kiếm.

GET https://lpkvps.cfd/api/proxy/orders
Tham sốKiểuBắt buộcMô tả
pageintegerTuỳ chọnSố trang hiện tại (Mặc định: 1)
limitintegerTuỳ chọnSố bản ghi mỗi trang (Mặc định: 20, tối đa 100)
statusstringTuỳ chọnLọc trạng thái: active, expired, pending
searchstringTuỳ chọnTìm kiếm theo địa chỉ IP hoặc tên gói proxy
curl -X GET "https://lpkvps.cfd/api/proxy/orders?page=1&limit=20&status=active" \ -H "X-Api-Token: YOUR_API_TOKEN" \ -H "Accept: application/json"
{
  "status": "success",
  "data": {
    "items": [
      {
        "id": 15,
        "package_name": "Proxy Dân Cư US Cao Cấp",
        "ip_address": "104.28.19.45",
        "port": 9050,
        "username": "usr_78129",
        "password": "pwd_88124",
        "protocol": "HTTP",
        "status": "active",
        "created_at": "2026-09-29 22:00:00",
        "expired_at": "2026-10-29 23:59:59"
      }
    ],
    "pagination": {
      "current_page": 1,
      "total_pages": 1,
      "total_records": 1,
      "limit": 20
    }
  }
}
GET

6.6. Tra Cứu Chi Tiết Proxy Theo ID

/api/proxy/info

Tra cứu thông tin chi tiết một hoặc nhiều proxy cụ thể thông qua danh sách ID.

GET https://lpkvps.cfd/api/proxy/info?ids={ids}&location={location}
Tham sốKiểuBắt buộcMô tả
idsstringBắt buộcDanh sách ID proxy ngăn cách bằng dấu phẩy (Ví dụ: 105,106)
locationstringTuỳ chọnVị trí gói proxy: residential hoặc datacenter
curl -X GET "https://lpkvps.cfd/api/proxy/info?ids=105,106&location=residential" \ -H "X-Api-Token: YOUR_API_TOKEN" \ -H "Accept: application/json"
{
  "status": "success",
  "data": [
    {
      "id": 105,
      "ip_address": "104.28.19.45",
      "port": 9050,
      "username": "usr_78129",
      "password": "pwd_88124",
      "protocol": "HTTP",
      "status": "active",
      "expired_at": "2026-10-29 23:59:59"
    }
  ],
  "failed_ids": []
}
POST

6.7. Gia Hạn Proxy

/api/proxy/renew

Gia hạn thời gian sử dụng cho một hoặc nhiều proxy cùng lúc. Tiền gia hạn được trừ trực tiếp từ số dư ví tài khoản theo công thức tính giá bán ra đại lý.

POST https://lpkvps.cfd/api/proxy/renew Content-Type: application/json
TrườngKiểuBắt buộcMô tả
idsarrayBắt buộcMảng chứa danh sách ID proxy cần gia hạn (Ví dụ: [105, 106])
daysintegerBắt buộcSố ngày gia hạn thêm (Ví dụ: 30)
locationstringTuỳ chọnVị trí gói proxy: residential hoặc datacenter (Mặc định: residential)
curl -X POST "https://lpkvps.cfd/api/proxy/renew" \ -H "X-Api-Token: YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "ids": [105, 106], "days": 30, "location": "residential" }'
{
  "status": "success",
  "message": "Gia hạn 2 proxy thành công",
  "data": [
    {
      "id": 105,
      "status": "active",
      "days_added": 30,
      "new_expired_at": "2026-11-28 23:59:59"
    }
  ]
}
POST

6.8. Đồng Bộ / Làm Mới Địa Chỉ IP

/api/proxy/sync-ip

Yêu cầu nhà cung cấp đồng bộ hoặc cấp địa chỉ IP mới nhất cho proxy đã mua (hữu ích cho proxy dân cư xoay IP hoặc cần đổi IP mới).

POST https://lpkvps.cfd/api/proxy/sync-ip Content-Type: application/json
TrườngKiểuBắt buộcMô tả
idsarrayBắt buộcMảng chứa danh sách ID proxy cần làm mới IP (Ví dụ: [105])
locationstringTuỳ chọnVị trí proxy: residential hoặc datacenter
curl -X POST "https://lpkvps.cfd/api/proxy/sync-ip" \ -H "X-Api-Token: YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "ids": [105], "location": "residential" }'
{
  "status": "success",
  "message": "Đã làm mới IP proxy thành công",
  "data": [
    {
      "id": 105,
      "new_ip": "104.28.19.89",
      "port": 9050
    }
  ]
}
POST

6.9. Kiểm Tra Proxy Live / Die & Đo Ping

/api/proxy/check

Kiểm tra kết nối thực tế tới proxy: đo tốc độ phản hồi (ping ms), xác định proxy còn sống hay đã chết (live/die) và kiểm tra địa chỉ IP public thực tế khi đi ra Internet.

POST https://lpkvps.cfd/api/proxy/check Content-Type: application/json
TrườngKiểuBắt buộcMô tả
proxystringBắt buộcĐịnh dạng ip:port hoặc ip:port:username:password
protocolstringTuỳ chọnGiao thức kết nối: HTTP hoặc SOCKS5 (Mặc định: HTTP)
timeoutintegerTuỳ chọnThời gian chờ tối đa kết nối (giây, mặc định: 10, tối đa 30)
curl -X POST "https://lpkvps.cfd/api/proxy/check" \ -H "X-Api-Token: YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "proxy": "104.28.19.45:9050:usr_78129:pwd_88124", "protocol": "HTTP", "timeout": 10 }'
{
  "status": "success",
  "data": {
    "live": true,
    "ping_ms": 138,
    "ip": "104.28.19.45",
    "protocol": "HTTP",
    "time": "2026-09-29 22:15:00"
  }
}
GET

6.10. Thông Tin Tài Khoản & Số Dư Proxy

/api/proxy/profile

Xem thông tin tài khoản hiện tại, số dư ví khả dụng, mức chiết khấu và trạng thái token API.

GET https://lpkvps.cfd/api/proxy/profile
curl -X GET "https://lpkvps.cfd/api/proxy/profile" \ -H "X-Api-Token: YOUR_API_TOKEN" \ -H "Accept: application/json"
{
  "status": "success",
  "data": {
    "username": "client_demo",
    "email": "[email protected]",
    "balance": 500000,
    "discount_percent": 10,
    "token": "YOUR_API_TOKEN"
  }
}

6.11. Code Mẫu Tích Hợp API Proxy

PHP SDK & Node.js

Bạn có thể sử dụng trực tiếp bộ thư viện PHP SDK có sẵn trong thư mục classes/DichVuDarkProxyAPI.php hoặc mã nguồn mẫu Node.js bên dưới để tích hợp vào ứng dụng của bạn trong 5 phút.

<?php require_once __DIR__ . '/classes/DichVuDarkProxyAPI.php'; // Khởi tạo SDK với Base URL và API Token cá nhân $api = new DichVuDarkProxyAPI('https://lpkvps.cfd', 'YOUR_API_TOKEN'); // 1. Lấy danh sách gói Proxy đang bán $packages = $api->getPackages(); echo "=== DANH SÁCH GÓI PROXY ===\n"; print_r($packages); // 2. Mua Proxy mới tự động (Ví dụ: Gói 1, 30 ngày, 1 proxy, giao thức HTTP) $buyResult = $api->buyProxy([ 'package_id' => 1, 'days' => 30, 'quantity' => 1, 'protocol' => 'HTTP' ]); echo "\n=== KẾT QUẢ MUA PROXY ===\n"; print_r($buyResult); // 3. Lấy danh sách Proxy đã mua (phân trang, lọc active) $orders = $api->listOrders(1, 20, 'active'); echo "\n=== DANH SÁCH PROXY ĐÃ MUA ===\n"; print_r($orders); // 4. Kiểm tra Proxy Live/Die và đo Ping ms $check = $api->checkProxy('104.28.19.45:9050:usr:pwd', 'HTTP', 10); if (!empty($check['data']['live'])) { echo "\nProxy Live! Ping: " . $check['data']['ping_ms'] . "ms | Public IP: " . $check['data']['ip']; } else { echo "\nProxy Die hoặc không phản hồi!"; } ?>
const axios = require('axios'); class DichVuDarkProxyAPI { constructor(apiToken, baseURL = 'https://lpkvps.cfd') { this.client = axios.create({ baseURL, headers: { 'X-Api-Token': apiToken, 'Content-Type': 'application/json' }, timeout: 30000 }); } // 1. Lấy danh sách gói Proxy async getPackages() { const res = await this.client.get('/api/proxy/packages'); return res.data; } // 2. Đặt mua Proxy mới async buyProxy(packageId, days = 30, quantity = 1, protocol = 'HTTP') { const res = await this.client.post('/api/proxy/buy', { package_id: packageId, days, quantity, protocol }); return res.data; } // 3. Danh sách Proxy đã mua async listOrders(page = 1, limit = 20, status = 'active') { const res = await this.client.get('/api/proxy/orders', { params: { page, limit, status } }); return res.data; } // 4. Kiểm tra Live / Die & Ping async checkProxy(proxyString, protocol = 'HTTP', timeout = 10) { const res = await this.client.post('/api/proxy/check', { proxy: proxyString, protocol, timeout }); return res.data; } } // === Ví dụ thực thi === (async () => { const api = new DichVuDarkProxyAPI('YOUR_API_TOKEN'); try { const packages = await api.getPackages(); console.log('Danh sách gói:', packages); } catch (err) { console.error('Lỗi gọi API:', err.response ? err.response.data : err.message); } })();
Đã sao chép!