跳转到主要内容
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>"
  ]
}
'
"{}"

授权

Authorization
string
header
必填

请求体

application/json
proxyType
enum<string>
默认值:residential_proxies

RTC 代理即抓取 API

可用选项:
residential_proxies,
mobile_proxies,
rtc_universal_proxies,
rtc_universal_core_proxies,
modular_scraper
startDate
string
默认值:2024-09-01 00:00:00

最大日期返回间隔为 180 天。日期格式:YYYY-MM-DD HH:MM:SS

endDate
string
默认值:2024-10-01 00:00:00

最大日期返回间隔为 180 天。日期格式:YYYY-MM-DD HH:MM:SS

proxyUsers
string[]

此处获取的代理用户 ID 列表(仅适用于 residential_proxies)。不适用于 RTC 代理(抓取 API)

groupBy
enum<string>
默认值:target

结果分组方式。hour 显示最近一天每小时的使用情况,但必须在最近 2 周内有流量使用才会显示。

可用选项:
day,
target,
country,
protocol,
proxy_user,
hour,
week,
month
targets
string[]

目标 URL 列表(数组)

locations
string[]

按 ISO-2 格式(IT、US、ES 等)过滤结果的位置列表。不适用于 RTC 代理(抓取 API)

limit
integer<int32>
默认值:500

返回的条目数量

page
integer<int32>
默认值:1

返回的页码

sortBy
enum<string>
默认值:grouping_key

期望的响应分组方式

可用选项:
grouping_key,
requests,
totals
sortOrder
enum<string>
默认值:asc

排序顺序:升序或降序

可用选项:
asc,
desc
protocols
string[]

有效协议:http、https、socks5。留空将返回所有协议。不适用于 RTC 代理(抓取 API)

响应

200

The response is of type object.