Hướng dẫn đầy đủ để tích hợp và sử dụng API Proxy Xoay HD FutureTech
HD FutureTech cung cấp API Proxy Xoay cho phép bạn tích hợp dịch vụ proxy xoay vào hệ thống của mình một cách dễ dàng và hiệu quả. Tài liệu này hướng dẫn chi tiết về cách sử dụng API của chúng tôi.
Để bắt đầu sử dụng API của chúng tôi, bạn cần có một tài khoản HD FutureTech và token API. Các API endpoint của chúng tôi được xây dựng theo chuẩn RESTful và sử dụng định dạng JSON.
https://api.hdfuturetech.com
Tất cả các API của chúng tôi yêu cầu xác thực bằng token API. Để lấy token, hãy đăng nhập vào tài khoản HD FutureTech và tạo token từ trang quản lý API tokens.
Thêm token vào header Authorization
của mỗi request:
Authorization: Bearer hd_ft_api_your_token_here
Mua key proxy xoay mới với các tùy chọn thời gian khác nhau.
/api/v1/user/buy-proxy/buy-proxy-rotate
ID: 67cbfadf5db13c1bb24f6be7
ID: 67cbfadf5db13c1bb24f6be8
ID: 67cbfadf5db13c1bb24f6be9
Lưu ý: Khi sử dụng API, vui lòng sử dụng chính xác ID của loại proxy bạn muốn mua trong tham số idProxyRotate
. Số tiền sẽ được trừ tự động từ tài khoản của bạn.
Tham số | Kiểu | Bắt buộc | Mô tả |
---|---|---|---|
thoigian | string | Có | Thời gian (đơn vị tùy thuộc vào loại proxy) |
soluong | string | Có | Số lượng key cần mua |
idProxyRotate | string | Có | ID của loại proxy xoay
|
const axios = require('axios');
const buyProxyKey = async () => {
try {
const response = await axios.post('https://api.hdfuturetech.com/api/v1/user/buy-proxy/buy-proxy-rotate', {
thoigian: '1',
soluong: '1',
idProxyRotate: '65f4c2d54a8fb5c282c13e55'
}, {
headers: {
'Authorization': 'Bearer hd_ft_api_your_token_here',
'Content-Type': 'application/json'
}
});
console.log('Kết quả mua key:', response.data);
return response.data;
} catch (error) {
console.error('Lỗi khi mua key:', error.response?.data || error.message);
throw error;
}
};
buyProxyKey();
Lấy proxy từ key xoay đã mua
/api/v1/user/buy-proxy/get-proxy
Tham số | Kiểu | Bắt buộc | Mô tả |
---|---|---|---|
key | string | Có | Key proxy xoay |
nhamang | string | Có | Nhà mạng (viettel, vnpt, fpt...) |
tinhthanh | number | Không (mặc định: 0) | Mã tỉnh thành (0 = ngẫu nhiên) |
const axios = require('axios');
const getProxy = async () => {
try {
const response = await axios.post('https://api.hdfuturetech.com/api/v1/user/buy-proxy/get-proxy', {
key: 'HD_12345678',
nhamang: 'viettel',
tinhthanh: 0
}, {
headers: {
'Authorization': 'Bearer hd_ft_api_your_token_here',
'Content-Type': 'application/json'
}
});
console.log('Proxy:', response.data);
return response.data;
} catch (error) {
console.error('Lỗi khi lấy proxy:', error.response?.data || error.message);
throw error;
}
};
getProxy();
{
"success": true,
"message": "HD FutureTech xin cảm ơn quý khách",
"data": {
"status": 100,
"proxyhttp": "103.82.20.1:8080",
"proxysock": "103.82.20.1:1080",
"username": "username",
"password": "password",
"message": "OK"
}
}
{
"success": false,
"message": "Key đã hết hạn hoặc không tồn tại"
}
Gia hạn key proxy xoay đã mua
/api/v1/user/buy-proxy/extend-proxy-rotate
Tham số | Kiểu | Bắt buộc | Mô tả |
---|---|---|---|
keyxoay | string | Có | Key proxy xoay cần gia hạn |
thoigian | string | Có | Thời gian gia hạn |
idProxyRotate | string | Có | ID của loại proxy xoay |
const axios = require('axios');
const extendProxyKey = async () => {
try {
const response = await axios.post('https://api.hdfuturetech.com/api/v1/user/buy-proxy/extend-proxy-rotate', {
keyxoay: 'HD_12345678',
thoigian: '1',
idProxyRotate: '65f4c2d54a8fb5c282c13e55'
}, {
headers: {
'Authorization': 'Bearer hd_ft_api_your_token_here',
'Content-Type': 'application/json'
}
});
console.log('Kết quả gia hạn key:', response.data);
return response.data;
} catch (error) {
console.error('Lỗi khi gia hạn key:', error.response?.data || error.message);
throw error;
}
};
extendProxyKey();
{
"success": true,
"message": "Gia hạn key thành công",
"data": {
"message": "HD FutureTech xin cảm ơn quý khách",
"keyxoay": "HD_12345678",
"expiredDate": "2024-05-25T03:30:00.000Z",
"duration": 1,
"type": "day",
"price": 2000,
"newBalance": 96000,
"transactionId": "7f4c2d54-a8fb-5c28-2c13-e58f4c2d54a9"
}
}
{
"success": false,
"message": "Key không tồn tại hoặc đã hết hạn",
"transactionId": "7f4c2d54-a8fb-5c28-2c13-e58f4c2d54a9"
}
Lấy danh sách các key proxy xoay còn hạn sử dụng
/api/v1/user/buy-proxy/active-proxy-keys
Tham số | Kiểu | Bắt buộc | Mô tả |
---|---|---|---|
page | number | Không (mặc định: 1) | Số trang |
limit | number | Không (mặc định: 10) | Số lượng key trên mỗi trang |
const axios = require('axios');
const getActiveProxyKeys = async (page = 1, limit = 10) => {
try {
const response = await axios.get(`https://api.hdfuturetech.com/api/v1/user/buy-proxy/active-proxy-keys?page=${page}&limit=${limit}`, {
headers: {
'Authorization': 'Bearer hd_ft_api_your_token_here',
}
});
console.log('Danh sách key còn hạn:', response.data);
return response.data;
} catch (error) {
console.error('Lỗi khi lấy danh sách key:', error.response?.data || error.message);
throw error;
}
};
getActiveProxyKeys();
{
"success": true,
"data": [
{
"_id": "65f4c2d54a8fb5c282c13e59",
"userId": "65f4c2d54a8fb5c282c13e50",
"orderId": "65f4c2d54a8fb5c282c13e58",
"keyxoay": "HD_12345678",
"expired": "2024-04-25T03:30:00.000Z",
"typeDate": "day",
"status": "active",
"purchaseDate": "2024-04-24T03:30:00.000Z",
"remainingDays": 1,
"remainingTime": "1 ngày, 0 giờ, 0 phút",
"isExpired": false,
"isAboutToExpire": true
}
],
"pagination": {
"totalItems": 5,
"totalPages": 1,
"currentPage": 1,
"itemsPerPage": 10,
"hasNextPage": false,
"hasPrevPage": false
}
}
{
"success": false,
"message": "Lỗi hệ thống"
}
Hướng dẫn nhanh để tạo và sử dụng key proxy xoay
Dưới đây là hướng dẫn nhanh để tạo và sử dụng key proxy xoay trong vài phút.
Tạo token API từ trang cài đặt tài khoản để xác thực các yêu cầu API của bạn.
Tạo Token →Sử dụng API để mua key proxy xoay và tích hợp vào ứng dụng của bạn.
Xem hướng dẫn →Đội ngũ hỗ trợ kỹ thuật của chúng tôi luôn sẵn sàng giúp đỡ bạn tích hợp API proxy xoay vào hệ thống của bạn.
Bắt đầu sử dụng API proxy xoay của HD FutureTech ngay hôm nay