生成Schema
POST
/302/crawler/generate-schema通过网页跟描述生成对应Schema
价格:根据调用的模型收费
请求参数
Header 参数
Authorization
string
必需
302.AI API Key
示例值:
Bearer {{YOUR_API_KEY}}
Model
string
默认gpt-4o
示例值:
gpt-4o-mini
Body 参数application/json
description
string
数据格式描述
比如:获取AI大模型的具体介绍跟使用场景
url
string
网页链接
需要爬取的数据的目标链接,生成更合适的数据结构
示例1
{
"description": "AI大模型及详情介绍",
"url": "https://news.302.ai"
}
示例代码
返回响应
成功(201)
HTTP 状态码: 201
内容格式: JSONapplication/json
数据结构
object {0}
示例
{
"schema": {
"type": "object",
"properties": {
"model_name": {
"type": "string",
"description": "AI大模型的名称"
},
"description": {
"type": "string",
"description": "AI大模型的详细介绍"
},
"release_date": {
"type": "string",
"description": "AI大模型的发布日期,格式为YYYY-MM-DD"
},
"views": {
"type": "number",
"description": "文章的浏览量"
},
"category": {
"type": "string",
"description": "AI大模型所属的分类"
}
},
"required": [
"model_name",
"description",
"release_date",
"views",
"category"
]
}
}
最后修改时间: 21 天前