资源提取

api提取


curl --location --request GET 'https://api.98ip.com/get_proxy_ip?user=xxx&pass=xxx&count=10&format=json'

import requests

url = "https://api.98ip.com/get_proxy_ip?user=xxx&pass=xxx&count=10&format=json"

payload={}
headers = {}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
   CURLOPT_URL => 'https://api.98ip.com/get_proxy_ip?user=xxx&pass=xxx&count=10&format=json',
   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;

var requestOptions = {
   method: 'GET',
   redirect: 'follow'
};

fetch("https://api.98ip.com/get_proxy_ip?user=xxx&pass=xxx&count=10&format=json", requestOptions)
   .then(response => response.text())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));

package main

import (
   "fmt"
   "net/http"
   "io/ioutil"
)

func main() {

   url := "https://api.98ip.com/get_proxy_ip?user=xxx&pass=xxx&count=10&format=json"
   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 := ioutil.ReadAll(res.Body)
   if err != nil {
      fmt.Println(err)
      return
   }
   fmt.Println(string(body))
}

OkHttpClient client = new OkHttpClient().newBuilder()
   .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
   .url("https://api.98ip.com/get_proxy_ip?user=xxx&pass=xxx&count=10&format=json")
   .method("GET", body)
   .build();
Response response = client.newCall(request).execute();

GET /get_proxy_ip

请求参数

名称 类型 必选 说明
user string 认证账号
pass string 认证密码
region string 国家编码
area string 地区
time string 保持时间
count string 提取数量
protocol string 协议
format string 格式(json、txt)
split string 分隔符(txt专用)
splice string 拼接格式(txt专用)
proxyType string 代理服务器类型(1-非亚洲【us.98ip.net】 2-亚洲【sg.98ip.net】)
                                    
https://api.98ip.com/get_proxy_ip?user=xxx&pass=xxx&count=10&format=json

                                

相应结果

名称 类型 说明
code int 响应代码
msg string 响应消息
data list IP列表
                                        
{
   "code": 0,
    "msg": "操作成功",
    "data": [
        {
            "ip": "xxx.xxxx.xxx",
            "pass": "xxx",
            "port": "1000",
            "user": "xxx"
        },
        {
            "ip": "xxx.xxxx.xxx",
            "pass": "xxx",
            "port": "1000",
            "user": "xxx"
        },
        ......
    ]
}

                                    
                                        
{
  "code": 1,
  "msg": "<string>"
}

                                    

curl --location --request GET 'https://api.98ip.com/get_proxy_ip?user=xxx&pass=xxx&count=10&format=json'

import requests

url = "https://api.98ip.com/get_proxy_ip?user=xxx&pass=xxx&count=10&format=json"

payload={}
headers = {}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
   CURLOPT_URL => 'https://api.98ip.com/get_proxy_ip?user=xxx&pass=xxx&count=10&format=json',
   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;

var requestOptions = {
   method: 'GET',
   redirect: 'follow'
};

fetch("https://api.98ip.com/get_proxy_ip?user=xxx&pass=xxx&count=10&format=json", requestOptions)
   .then(response => response.text())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));

package main

import (
   "fmt"
   "net/http"
   "io/ioutil"
)

func main() {

   url := "https://api.98ip.com/get_proxy_ip?user=xxx&pass=xxx&count=10&format=json"
   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 := ioutil.ReadAll(res.Body)
   if err != nil {
      fmt.Println(err)
      return
   }
   fmt.Println(string(body))
}

OkHttpClient client = new OkHttpClient().newBuilder()
   .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
   .url("https://api.98ip.com/get_proxy_ip?user=xxx&pass=xxx&count=10&format=json")
   .method("GET", body)
   .build();
Response response = client.newCall(request).execute();