24小時列表API,允許您從“24小時列表”中獲取已經使用過的代理。下麵,您將找到有關如何使用該API的分步說明和示例。(2.1.7版本以上支持此功能,点击下载)
24小時列表API功能支持以下三種使用方式:
-轉發隨機代理:設定端口獲取IP
-今日列表代理:獲取24小時列表的IP信息
-自定義代理提取:唯一標识(SN)綁定端口
一、轉發隨機代理
通過指定端口轉發,動态獲取隨機代理IP
通用url示例:
http://hostname:port/v1/today_random_ip?num=1&country=all&state=all&city=all&t=json&port=30000&isp=all
參數說明:
port: 轉發起始端口(默認為30000)
num:IP個數(每個代理對應一個獨立的端口)
步驟1:篩選您需要的國家/州省/城市/ISP等參數信息,輸入IP個數,選擇轉發的起始端口
注:只可選擇在24小時列表中的國家/州省/城市,列表中12小時內的可用在線IP,再次提取不扣除對應的餘額,超過12小時狀態變為不可用,IP狀態顯示“在線”则可繼續提取使用並扣除對應IP餘額。
步驟2:將API URL複製並粘貼到您想要使用它的軟件或腳本中;或者直接點擊”立即使用“可直接跳轉至瀏覽器
步驟3:端口转发信息可以通过端口转发列表或24小时列表查看,點擊“複製”按鈕,可複製本地IP地址和端口
API參數釋義
國家(默認All),可篩選“24小時列表”中的國家,不區分大小寫; 國家代碼
那麼如何修改和使用參數呢? 接下來我將舉例說明
1、使用任意國家的轉發隨機代理
http://hostname:port/v1/today_random_ip?num=1&country=all&state=all&city=all&t=json&port=30000&isp=all
2、使用來自美國的轉發隨機代理
http://hostname:port/v1/today_random_ip?num=1&country=US&state=all&city=all&t=json&port=30000&isp=all
3、使用來自美國,州:德克薩斯州
http://hostname:port/v1/today_random_ip?num=1&country=US&state=texas&city=all&t=json&port=30000&isp=all
4、使用來自美國,州:弗洛裡達州; 省: cape coral
http://hostname:port/v1/today_random_ip?num=1&country=US&state=florida&city=capecoral&t=json&port=30000&isp=all
5、使用指定ISP運營商的代理,設定ISP=Comcast Cable Communications LLC
http://hostname:port/v1/today_random_ip?num=1&country=all&state=all&city=all&t=json&port=30000&isp=Comcast Cable Communications LLC
6、設定端口30001的轉發隨機代理(在設定中設定端口數)
http://hostname:port/v1/today_random_ip?num=1&country=all&state=all&city=all&t=json&port=30001&isp=all
7、轉發多個IP,設定num=5(超過24小時列表內的符合條件的IP數,將提取24小時列表內所有符合條件的IP)
http://hostname:port/v1/today_random_ip?num=5&country=all&state=all&city=all&t=json&port=30000&isp=all
二、今日列表代理
獲取24小時列表中的IP信息,IP可生成對應的唯一標识
通用url示例
http://hostname:port/v1/today_proxy_list?num=1&country=all&state=all&city=all&t=json&isp=all
步驟1:篩選您需要的國家/州省/城市/ISP信息,輸入IP個數;
步驟2:將API URL複製並粘貼您想要使用它的軟件或腳本中即可使用代理。 或者直接點擊”立即使用“可直接跳轉至瀏覽器
請求示例:
1、轉發多個IP,設定num=3(超過24小時列表內的符合條件的IP數,將提取24小時列表內所有符合條件的IP)
http://hostname:port/v1/today_proxy_list?num=3&country=all&state=all&city=all&t=json&isp=all
三、自定義代理提取
通過代理的唯一標识(SN)請求自定義端口轉發
通用URL示例:(需替換SN參數)
http://hostname:port/v1/today_custom_ip?sn=proxy_sn_from_today_list&t=json&port=30000
步驟1:設定端口值,將API URL複製並粘貼至瀏覽器中
步驟2:從24小時代理列表中複製對應IP的SN參數,替換示例中的SN信息
請求示例:
設定port=30002,SN=55af27c7d144ffeb5c6fc13e7e6edcad
http://hostname:port/v1/today_custom_ip?sn=55af27c7d144ffeb5c6fc13e7e6edcad&t=json&port=30002
四、代碼示例
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'http://hostname:port/v1/today_random_ip?num=1&country=all&state=all&city=all&t=json&port=30000&isp=all',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
// Somecurl --location "http://hostname:port/v1/today_random_ip?num=1&country=all&state=all&city=all&t=json&port=30000&isp=all"
// Some codpackage main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := http://hostname:port/v1/today_random_ip?num=1&country=all&state=all&city=all&t=json&port=30000&isp=all
method := "GET"
client := &http.Client {}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
}
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
const requestOptions = {
method: "GET",
redirect: "follow"
};
fetch("http://hostname:port/v1/today_random_ip?num=1&country=all&state=all&city=all&t=json&port=30000&isp=all", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));
// Some <?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'http://hostname:port/v1/today_random_ip?num=1&country=all&state=all&city=all&t=json&port=30000&isp=all',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
五、錯誤提示
如果無法通過API獲取代理,可能會出現以下錯誤及原因:
1、帳戶餘額已用完,請充值
2、接口請求失敗,請檢查網路環境重試
3、當前未査詢到符合設定條件的IP,請更換參數
通過以上教程,現在您可以開始使用922S5代理的24小時列表API功能了,您可以點擊下載最新版本的客戶端進行使用。
如果您仍然有問題,請聯系客戶支持團隊(Email - support@922proxy.com )。 請提供您的詳細信息,以便我們的支持團隊能更好的幫助您解决問題。