基础接口地址:https://u.mojinyun.com/
请求方式:GET
返回格式:JSON/TXT
| 参数名 | 类型 | 必选 | 说明 |
|---|---|---|---|
| key | string | 是 | appKey |
| count | int | 否 | 数量(最小值1,最大值200,不填写默认为1) |
| type | string | 否 | 返回类型(取值为json,text二种,默认json) |
| only | int | 否 | 是否去重(1:是,0:否,默认值0) |
| province | int | 否 | 省份编号 |
| city | int | 否 | 城市编号 |
| pw | string | 否 | 获取的是无密码s5代理(yes:是,no:否,默认yes) |
| net | int | 否 | 运营商类型(1:电信,2:移动,3:联通,4:未知) |
{
"count": "2",
"status": "0",
"list": [
{
"sever": "111.111.111.111",
"port": 20025,
"net_type": 2
},
{
"sever": "111.111.111.111",
"port": 20049,
"net_type": 1
}
]
}
| 状态码 | 说明 |
|---|---|
| 0 | 请求成功 |
| 1001 | key不能为空 |
| 1002 | key错误或已过期 |
| 1003 | IP提取频率过快 |
| 1004 | 可用IP数量不足 |
Warning: Trying to access array offset on value of type null in /www/wwwroot/www.mojinyun.com/templates/3/getapi.html on line 261
Warning: Trying to access array offset on value of type null in /www/wwwroot/www.mojinyun.com/templates/3/getapi.html on line 262
import requests
import json
url = "http://proxy.mojinyun.com/?key=您的APPKEY&count=1"
response = requests.get(url)
result = json.loads(response.text)
if result['status'] == 0:
print(result['list'])
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.HttpURLConnection;
public class ProxyTest {
public static void main(String[] args) {
try {
URL url = new URL("http://proxy.mojinyun.com/?key=您的APPKEY&count=1");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String inputLine;
StringBuilder response = new StringBuilder();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
} catch (Exception e) {
e.printStackTrace();
}
}
}