自定义输入
了解如何向输入架构添加自定义字段,以实现增强的数据管理和检索。
Documentation Index
Fetch the complete documentation index at: https://docs.brightdata.com/llms.txt
Use this file to discover all available pages before exploring further.
自定义输入
您可以向输入架构添加自定义字段,无论您在这些字段中发送什么内容,都将在结果中返回给每个记录/任务。这对以下场景很有用:- 统一架构:在不同的爬虫器/数据集中保持相同的输出结构。
- 索引/参考字段:传递
id、row_index或任何内部密钥,以便您可以轻松将结果匹配回原始输入行。
Authorizations
Use your Bright Data API Key as a Bearer token in the Authorization header.
How to authenticate:
- Obtain your API Key from the Bright Data account settings at https://brightdata.com/cp/setting/users
- Include the API Key in the Authorization header of your requests
- Format:
Authorization: Bearer YOUR_API_KEY
Example:
Authorization: Bearer b5648e1096c6442f60a6c4bbbe73f8d2234d3d8324554bd6a7ec8f3f251f07dfLearn how to get your Bright Data API key: https://docs.brightdata.com/api-reference/authentication
Query Parameters
Dataset ID for which data collection is triggered.
List of output columns, separated by | (e.g., url|about.updated_on). Filters the response to include only the specified fields.
"url|about.updated_on"
Include errors report with the results.
Specifies the format of the response (default: ndjson).
ndjson, json, csv Body
List of input items to scrape.
[
{
"url": "https://chatgpt.com/",
"prompt": "Top hotels in New York",
"index_custom": "abd45424"
}
]List of custom input field names whose values are passed through and returned unchanged in the results for each record.
The name of a custom input field to be accepted and returned in the results.
["url", "prompt", "index_custom"]List of output columns, separated by | (e.g., url|about.updated_on). Filters the response to include only the specified fields.
"url|about.updated_on"
Response
OK
The response is of type string.
"OK"