获取流量
curl --request POST \
--url https://api.decodo.com/api/v2/statistics/traffic \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"proxyType": "residential_proxies",
"startDate": "2024-09-01 00:00:00",
"endDate": "2024-10-01 00:00:00",
"proxyUsers": [
"<string>"
],
"groupBy": "target",
"targets": [
"<string>"
],
"locations": [
"<string>"
],
"limit": 500,
"page": 1,
"sortBy": "grouping_key",
"sortOrder": "asc",
"protocols": [
"<string>"
]
}
'import requests
url = "https://api.decodo.com/api/v2/statistics/traffic"
payload = {
"proxyType": "residential_proxies",
"startDate": "2024-09-01 00:00:00",
"endDate": "2024-10-01 00:00:00",
"proxyUsers": ["<string>"],
"groupBy": "target",
"targets": ["<string>"],
"locations": ["<string>"],
"limit": 500,
"page": 1,
"sortBy": "grouping_key",
"sortOrder": "asc",
"protocols": ["<string>"]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
proxyType: 'residential_proxies',
startDate: '2024-09-01 00:00:00',
endDate: '2024-10-01 00:00:00',
proxyUsers: ['<string>'],
groupBy: 'target',
targets: ['<string>'],
locations: ['<string>'],
limit: 500,
page: 1,
sortBy: 'grouping_key',
sortOrder: 'asc',
protocols: ['<string>']
})
};
fetch('https://api.decodo.com/api/v2/statistics/traffic', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.decodo.com/api/v2/statistics/traffic",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'proxyType' => 'residential_proxies',
'startDate' => '2024-09-01 00:00:00',
'endDate' => '2024-10-01 00:00:00',
'proxyUsers' => [
'<string>'
],
'groupBy' => 'target',
'targets' => [
'<string>'
],
'locations' => [
'<string>'
],
'limit' => 500,
'page' => 1,
'sortBy' => 'grouping_key',
'sortOrder' => 'asc',
'protocols' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.decodo.com/api/v2/statistics/traffic"
payload := strings.NewReader("{\n \"proxyType\": \"residential_proxies\",\n \"startDate\": \"2024-09-01 00:00:00\",\n \"endDate\": \"2024-10-01 00:00:00\",\n \"proxyUsers\": [\n \"<string>\"\n ],\n \"groupBy\": \"target\",\n \"targets\": [\n \"<string>\"\n ],\n \"locations\": [\n \"<string>\"\n ],\n \"limit\": 500,\n \"page\": 1,\n \"sortBy\": \"grouping_key\",\n \"sortOrder\": \"asc\",\n \"protocols\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.decodo.com/api/v2/statistics/traffic")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"proxyType\": \"residential_proxies\",\n \"startDate\": \"2024-09-01 00:00:00\",\n \"endDate\": \"2024-10-01 00:00:00\",\n \"proxyUsers\": [\n \"<string>\"\n ],\n \"groupBy\": \"target\",\n \"targets\": [\n \"<string>\"\n ],\n \"locations\": [\n \"<string>\"\n ],\n \"limit\": 500,\n \"page\": 1,\n \"sortBy\": \"grouping_key\",\n \"sortOrder\": \"asc\",\n \"protocols\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.decodo.com/api/v2/statistics/traffic")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"proxyType\": \"residential_proxies\",\n \"startDate\": \"2024-09-01 00:00:00\",\n \"endDate\": \"2024-10-01 00:00:00\",\n \"proxyUsers\": [\n \"<string>\"\n ],\n \"groupBy\": \"target\",\n \"targets\": [\n \"<string>\"\n ],\n \"locations\": [\n \"<string>\"\n ],\n \"limit\": 500,\n \"page\": 1,\n \"sortBy\": \"grouping_key\",\n \"sortOrder\": \"asc\",\n \"protocols\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body"{}""{}"流量
获取流量
POST
/
traffic
获取流量
curl --request POST \
--url https://api.decodo.com/api/v2/statistics/traffic \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"proxyType": "residential_proxies",
"startDate": "2024-09-01 00:00:00",
"endDate": "2024-10-01 00:00:00",
"proxyUsers": [
"<string>"
],
"groupBy": "target",
"targets": [
"<string>"
],
"locations": [
"<string>"
],
"limit": 500,
"page": 1,
"sortBy": "grouping_key",
"sortOrder": "asc",
"protocols": [
"<string>"
]
}
'import requests
url = "https://api.decodo.com/api/v2/statistics/traffic"
payload = {
"proxyType": "residential_proxies",
"startDate": "2024-09-01 00:00:00",
"endDate": "2024-10-01 00:00:00",
"proxyUsers": ["<string>"],
"groupBy": "target",
"targets": ["<string>"],
"locations": ["<string>"],
"limit": 500,
"page": 1,
"sortBy": "grouping_key",
"sortOrder": "asc",
"protocols": ["<string>"]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
proxyType: 'residential_proxies',
startDate: '2024-09-01 00:00:00',
endDate: '2024-10-01 00:00:00',
proxyUsers: ['<string>'],
groupBy: 'target',
targets: ['<string>'],
locations: ['<string>'],
limit: 500,
page: 1,
sortBy: 'grouping_key',
sortOrder: 'asc',
protocols: ['<string>']
})
};
fetch('https://api.decodo.com/api/v2/statistics/traffic', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.decodo.com/api/v2/statistics/traffic",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'proxyType' => 'residential_proxies',
'startDate' => '2024-09-01 00:00:00',
'endDate' => '2024-10-01 00:00:00',
'proxyUsers' => [
'<string>'
],
'groupBy' => 'target',
'targets' => [
'<string>'
],
'locations' => [
'<string>'
],
'limit' => 500,
'page' => 1,
'sortBy' => 'grouping_key',
'sortOrder' => 'asc',
'protocols' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.decodo.com/api/v2/statistics/traffic"
payload := strings.NewReader("{\n \"proxyType\": \"residential_proxies\",\n \"startDate\": \"2024-09-01 00:00:00\",\n \"endDate\": \"2024-10-01 00:00:00\",\n \"proxyUsers\": [\n \"<string>\"\n ],\n \"groupBy\": \"target\",\n \"targets\": [\n \"<string>\"\n ],\n \"locations\": [\n \"<string>\"\n ],\n \"limit\": 500,\n \"page\": 1,\n \"sortBy\": \"grouping_key\",\n \"sortOrder\": \"asc\",\n \"protocols\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.decodo.com/api/v2/statistics/traffic")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"proxyType\": \"residential_proxies\",\n \"startDate\": \"2024-09-01 00:00:00\",\n \"endDate\": \"2024-10-01 00:00:00\",\n \"proxyUsers\": [\n \"<string>\"\n ],\n \"groupBy\": \"target\",\n \"targets\": [\n \"<string>\"\n ],\n \"locations\": [\n \"<string>\"\n ],\n \"limit\": 500,\n \"page\": 1,\n \"sortBy\": \"grouping_key\",\n \"sortOrder\": \"asc\",\n \"protocols\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.decodo.com/api/v2/statistics/traffic")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"proxyType\": \"residential_proxies\",\n \"startDate\": \"2024-09-01 00:00:00\",\n \"endDate\": \"2024-10-01 00:00:00\",\n \"proxyUsers\": [\n \"<string>\"\n ],\n \"groupBy\": \"target\",\n \"targets\": [\n \"<string>\"\n ],\n \"locations\": [\n \"<string>\"\n ],\n \"limit\": 500,\n \"page\": 1,\n \"sortBy\": \"grouping_key\",\n \"sortOrder\": \"asc\",\n \"protocols\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body"{}""{}"授权
请求体
application/json
RTC 代理即抓取 API
可用选项:
residential_proxies, mobile_proxies, rtc_universal_proxies, rtc_universal_core_proxies, modular_scraper 最大日期返回间隔为 180 天。日期格式:YYYY-MM-DD HH:MM:SS
最大日期返回间隔为 180 天。日期格式:YYYY-MM-DD HH:MM:SS
结果分组方式。hour 显示最近一天每小时的使用情况,但必须在最近 2 周内有流量使用才会显示。
可用选项:
day, target, country, protocol, proxy_user, hour, week, month 目标 URL 列表(数组)
按 ISO-2 格式(IT、US、ES 等)过滤结果的位置列表。不适用于 RTC 代理(抓取 API)
返回的条目数量
返回的页码
期望的响应分组方式
可用选项:
grouping_key, requests, totals 排序顺序:升序或降序
可用选项:
asc, desc 有效协议:http、https、socks5。留空将返回所有协议。不适用于 RTC 代理(抓取 API)
响应
200
The response is of type object.
此页面对您有帮助吗?
⌘I