获取 API 请求日志列表
curl --request POST \
--url https://api.pubrio.com/api_keys/logs \
--header 'Content-Type: application/json' \
--header 'pubrio-api-key: <api-key>' \
--data '
{
"profile_id": 123,
"page": 1,
"per_page": 25,
"order_by": "created_at",
"is_ascending_order": false,
"search_term": "<string>",
"log_types": [
123
],
"log_type_slugs": [
"<string>"
],
"status_codes": [
123
],
"methods": [
"<string>"
]
}
'import requests
url = "https://api.pubrio.com/api_keys/logs"
payload = {
"profile_id": 123,
"page": 1,
"per_page": 25,
"order_by": "created_at",
"is_ascending_order": False,
"search_term": "<string>",
"log_types": [123],
"log_type_slugs": ["<string>"],
"status_codes": [123],
"methods": ["<string>"]
}
headers = {
"pubrio-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'pubrio-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
profile_id: 123,
page: 1,
per_page: 25,
order_by: 'created_at',
is_ascending_order: false,
search_term: '<string>',
log_types: [123],
log_type_slugs: ['<string>'],
status_codes: [123],
methods: ['<string>']
})
};
fetch('https://api.pubrio.com/api_keys/logs', 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.pubrio.com/api_keys/logs",
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([
'profile_id' => 123,
'page' => 1,
'per_page' => 25,
'order_by' => 'created_at',
'is_ascending_order' => false,
'search_term' => '<string>',
'log_types' => [
123
],
'log_type_slugs' => [
'<string>'
],
'status_codes' => [
123
],
'methods' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"pubrio-api-key: <api-key>"
],
]);
$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.pubrio.com/api_keys/logs"
payload := strings.NewReader("{\n \"profile_id\": 123,\n \"page\": 1,\n \"per_page\": 25,\n \"order_by\": \"created_at\",\n \"is_ascending_order\": false,\n \"search_term\": \"<string>\",\n \"log_types\": [\n 123\n ],\n \"log_type_slugs\": [\n \"<string>\"\n ],\n \"status_codes\": [\n 123\n ],\n \"methods\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("pubrio-api-key", "<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.pubrio.com/api_keys/logs")
.header("pubrio-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"profile_id\": 123,\n \"page\": 1,\n \"per_page\": 25,\n \"order_by\": \"created_at\",\n \"is_ascending_order\": false,\n \"search_term\": \"<string>\",\n \"log_types\": [\n 123\n ],\n \"log_type_slugs\": [\n \"<string>\"\n ],\n \"status_codes\": [\n 123\n ],\n \"methods\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pubrio.com/api_keys/logs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["pubrio-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"profile_id\": 123,\n \"page\": 1,\n \"per_page\": 25,\n \"order_by\": \"created_at\",\n \"is_ascending_order\": false,\n \"search_term\": \"<string>\",\n \"log_types\": [\n 123\n ],\n \"log_type_slugs\": [\n \"<string>\"\n ],\n \"status_codes\": [\n 123\n ],\n \"methods\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"metadata": {
"filters": {
"page": 1,
"per_page": 3,
"status_codes": [
200
]
}
},
"data": {
"pagination": {
"page": 1,
"per_page": 3,
"total_entries": 1109,
"total_pages": 370,
"total_display_pages": 250,
"is_timeout": false
},
"query_logs": [
{
"query_log_id": "fc1ce3dd-39f7-4fbd-9d22-569a17115c11",
"created_at": "2026-05-14 12:04:32.243",
"profile_id": 1,
"user_id": "2981d4b3-f8b1-44d8-9759-889f3bfa2faf",
"method": "POST",
"path": "/api_keys/usage/daily",
"status_code": 200,
"duration_ms": 1821,
"log_type_id": 0,
"authentication_type": "pubrio-api-key",
"masked_authentication": "0••••••••••••••••f39",
"response_size": 2180,
"ip": "127.0.0.1",
"email": "[email protected]",
"nickname": "Example User",
"user": {
"user_id": "2981d4b3-f8b1-44d8-9759-889f3bfa2faf",
"nickname": "Example User",
"email": "[email protected]"
},
"log_type_slug": null,
"credits": 0,
"log_type_name": null,
"authentication_type_name": "API Key"
}
]
}
}{
"code": 40001,
"message": "错误及代码会根据不同场景有所不同,详情请参阅文档。",
"details": {}
}{
"error": "请求频率超出限制。请稍后再试。"
}{
"error": "服务器在处理请求时遇到了未预料的异常。"
}API 密钥
API 请求日志列表
获取当前工作区的 API 请求日志分页列表。每条记录对应一次使用 pubrio-api-key 调用的请求,包含路径、方法、状态码、耗时、响应大小和消耗的积分。如需查看某条日志的完整请求和响应内容,请使用 日志详情查询 接口。
POST
/
api_keys
/
logs
获取 API 请求日志列表
curl --request POST \
--url https://api.pubrio.com/api_keys/logs \
--header 'Content-Type: application/json' \
--header 'pubrio-api-key: <api-key>' \
--data '
{
"profile_id": 123,
"page": 1,
"per_page": 25,
"order_by": "created_at",
"is_ascending_order": false,
"search_term": "<string>",
"log_types": [
123
],
"log_type_slugs": [
"<string>"
],
"status_codes": [
123
],
"methods": [
"<string>"
]
}
'import requests
url = "https://api.pubrio.com/api_keys/logs"
payload = {
"profile_id": 123,
"page": 1,
"per_page": 25,
"order_by": "created_at",
"is_ascending_order": False,
"search_term": "<string>",
"log_types": [123],
"log_type_slugs": ["<string>"],
"status_codes": [123],
"methods": ["<string>"]
}
headers = {
"pubrio-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'pubrio-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
profile_id: 123,
page: 1,
per_page: 25,
order_by: 'created_at',
is_ascending_order: false,
search_term: '<string>',
log_types: [123],
log_type_slugs: ['<string>'],
status_codes: [123],
methods: ['<string>']
})
};
fetch('https://api.pubrio.com/api_keys/logs', 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.pubrio.com/api_keys/logs",
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([
'profile_id' => 123,
'page' => 1,
'per_page' => 25,
'order_by' => 'created_at',
'is_ascending_order' => false,
'search_term' => '<string>',
'log_types' => [
123
],
'log_type_slugs' => [
'<string>'
],
'status_codes' => [
123
],
'methods' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"pubrio-api-key: <api-key>"
],
]);
$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.pubrio.com/api_keys/logs"
payload := strings.NewReader("{\n \"profile_id\": 123,\n \"page\": 1,\n \"per_page\": 25,\n \"order_by\": \"created_at\",\n \"is_ascending_order\": false,\n \"search_term\": \"<string>\",\n \"log_types\": [\n 123\n ],\n \"log_type_slugs\": [\n \"<string>\"\n ],\n \"status_codes\": [\n 123\n ],\n \"methods\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("pubrio-api-key", "<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.pubrio.com/api_keys/logs")
.header("pubrio-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"profile_id\": 123,\n \"page\": 1,\n \"per_page\": 25,\n \"order_by\": \"created_at\",\n \"is_ascending_order\": false,\n \"search_term\": \"<string>\",\n \"log_types\": [\n 123\n ],\n \"log_type_slugs\": [\n \"<string>\"\n ],\n \"status_codes\": [\n 123\n ],\n \"methods\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pubrio.com/api_keys/logs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["pubrio-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"profile_id\": 123,\n \"page\": 1,\n \"per_page\": 25,\n \"order_by\": \"created_at\",\n \"is_ascending_order\": false,\n \"search_term\": \"<string>\",\n \"log_types\": [\n 123\n ],\n \"log_type_slugs\": [\n \"<string>\"\n ],\n \"status_codes\": [\n 123\n ],\n \"methods\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"metadata": {
"filters": {
"page": 1,
"per_page": 3,
"status_codes": [
200
]
}
},
"data": {
"pagination": {
"page": 1,
"per_page": 3,
"total_entries": 1109,
"total_pages": 370,
"total_display_pages": 250,
"is_timeout": false
},
"query_logs": [
{
"query_log_id": "fc1ce3dd-39f7-4fbd-9d22-569a17115c11",
"created_at": "2026-05-14 12:04:32.243",
"profile_id": 1,
"user_id": "2981d4b3-f8b1-44d8-9759-889f3bfa2faf",
"method": "POST",
"path": "/api_keys/usage/daily",
"status_code": 200,
"duration_ms": 1821,
"log_type_id": 0,
"authentication_type": "pubrio-api-key",
"masked_authentication": "0••••••••••••••••f39",
"response_size": 2180,
"ip": "127.0.0.1",
"email": "[email protected]",
"nickname": "Example User",
"user": {
"user_id": "2981d4b3-f8b1-44d8-9759-889f3bfa2faf",
"nickname": "Example User",
"email": "[email protected]"
},
"log_type_slug": null,
"credits": 0,
"log_type_name": null,
"authentication_type_name": "API Key"
}
]
}
}{
"code": 40001,
"message": "错误及代码会根据不同场景有所不同,详情请参阅文档。",
"details": {}
}{
"error": "请求频率超出限制。请稍后再试。"
}{
"error": "服务器在处理请求时遇到了未预料的异常。"
}请求体
application/json
可选。发起请求的团队标识符。由于 API 密钥已包含您的工作区信息,此参数不再是必填项。如果提供,该 ID 有助于将查找与特定团队(工作区)关联,实现数据检索和额度追踪。
更多信息请参见团队标签下的 user details 端点。
要检索的数据页码。
示例:
1
每页应返回的搜索结果数量。限制每页结果数量可提升接口性能。
示例:
25
日志列表的排序字段。
可用选项:
created_at, duration_ms, status_code 排序方向。true 为升序,false(默认)为降序。
全文搜索,匹配请求路径、日志类型 slug 以及原始请求体内容。
按日志类型 ID 筛选。
按日志类型 slug 筛选(如 people_search、company_search)。
按 HTTP 状态码筛选(如 [200, 400, 500])。
按 HTTP 方法筛选(如 ["POST", "GET"])。
⌘I

