Flow correlation

Traffic consumption query


curl --location --request GET 'https://api.98ip.com/traffic/getConsume?appKey=xxx&statistics=date'

import requests

url = "https://api.98ip.com/traffic/getConsume?appKey=xxx&statistics=date"

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/traffic/getConsume?appKey=xxx&statistics=date',
   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/traffic/getConsume?appKey=xxx&statistics=date", 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/traffic/getConsume?appKey=xxx&statistics=date"
   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/traffic/getConsume?appKey=xxx&statistics=date")
   .method("GET", body)
   .build();
Response response = client.newCall(request).execute();

GET /traffic/getConsume

Request parameters

Name Types Required Explanation
appKey string Yes The user's AppKey
pageNum string No Page number (default 1)
pageSize string No Number of pages per page (default 10)
statistics string Yes Statistics conditions, day:date- by day:month- by month,hour/ not filled - by hour
user string No Verify account
                                    
https://api.98ip.com/traffic/getConsume?appKey=xxx&statistics=date

                                

Corresponding results

Name Types Explanation
code int Response code
msg string Response message
data list Returning data
                                        
{
    "code": 0,
    "msg": "查询成功",
    "data": {
        "rows": [
            {
                "user": "xxxxxxx_xxx",
                "consumeTraffic": 0.004,
                "consumeData": "2024-11-30"
            }
        ],
        "total": 1
    }
}

                                    
                                        
{
    "code": 0,
    "msg": "查询成功",
    "data": {
        "rows": [
            {
                "user": "xxxxxxx_xxx",
                "consumeTraffic": 0.005,
                "consumeData": "2024-12-09"
            },
        ],
        "total": 1
    }
}

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

                                    

curl --location --request GET 'https://api.98ip.com/traffic/getConsume?appKey=xxx&statistics=date'

import requests

url = "https://api.98ip.com/traffic/getConsume?appKey=xxx&statistics=date"

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/traffic/getConsume?appKey=xxx&statistics=date',
   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/traffic/getConsume?appKey=xxx&statistics=date", 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/traffic/getConsume?appKey=xxx&statistics=date"
   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/traffic/getConsume?appKey=xxx&statistics=date")
   .method("GET", body)
   .build();
Response response = client.newCall(request).execute();