Gemini 抓取器
scraper.gemini 用于提取 Gemini 的响应,以便您以结构化的引用元数据归档 Google AI 的输出内容。
请求示例
curl 'https://api.scrapeless.com/api/v2/scraper/request' \
--header 'Content-Type: application/json' \
--header 'x-api-token: {you_api_key}' \
--data '{
"actor": "scraper.gemini",
"input": {
"prompt": "Recommended attractions in New York",
"country": "US"
},
"webhook": {
"url": "http://www.youwebhook.com"
}
}'请求体参数
| 参数 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
prompt | string | 是 | 发送给 Gemini 的提示词。 |
country | string | 是 | 国家或地区代码。 |
shopping | boolean | 否 | 是否获取购物数据。默认为 false。启用后,响应将在 products 字段中包含额外的商品信息——即每个商品分组背后的商家报价,例如直接商店链接、价格、分期付款、库存、配送和退货政策。 |
should_fetch_html | boolean | 否 | 是否获取 HTML 内容。 |
响应字段
注意: 当启用
shopping且响应返回这些额外的商品信息时,该 API 调用将按基础费率的 2 倍计费。这是因为从多个来源提取和处理商品信息需要额外的资源开销。
| 参数 | 类型 | 描述 |
|---|---|---|
result_text | string | Markdown 格式的响应内容。 |
rawtext | string | 原始回答数据。 |
prompt | string | 原始提示词。 |
citations | array | 引用元数据。 |
citations.favicon | string | 网站图标 (Favicon) URL。 |
citations.highlights | array | 来源文本中的高亮片段。 |
citations.snippet | string | 引用摘要。 |
citations.title | string | 被引用页面的标题。 |
citations.url | string | 被引用页面的 URL。 |
citations.website_name | string | 网站名称。 |
related_queries | array | 相关查询数组。 |
products | array | Google Gemini 返回的商品信息。 |
products.thumbnails | array | 商品缩略图 URL 数组。 |
products.title | string | 商品标题。 |
products.url | string | 商品页面 URL。 |
products.brand | string | 商品品牌名称。 |
products.reviews | int | 评论数量。 |
products.rating | string | 平均评分。 |
products.price_range | string | 价格范围,例如 $2,499.99。 |
products.stores | array | 商家报价数组。 |
products.stores.name | string | 商家名称。 |
products.stores.link | string | 商家商品链接。 |
products.stores.title | string | 商家处的商品标题。 |
products.stores.ratings | string | 商家评分,例如 4.3/5。 |
products.stores.extensions | array | 附加信息(库存、配送、退货等)。 |
products.stores.price | string | 商家价格。 |
products.stores.delivery_fee | string | 配送费信息。 |
products.stores.total_price | string | 含费用的总价。 |
products.about_the_product | object | 详细商品信息。 |
products.about_the_product.title | string | 区块标题。 |
products.about_the_product.link | string | 商品页面链接。 |
products.about_the_product.displayed_link | string | 显示的域名。 |
products.about_the_product.features | array | 商品特性/规格。 |
products.about_the_product.features.title | string | 特性名称。 |
products.about_the_product.features.value | string | 特性值。 |
products.about_the_product.description | string | 商品描述。 |
products.variants | array | 商品变体选项。 |
products.variants.title | string | 变体分类标题。 |
products.variants.items | array | 变体选项列表。 |
products.variants.items.name | string | 变体选项名称。 |
products.variants.items.selected | bool | 是否已选中该变体。 |
products.variants.items.availability | bool | 变体可用状态。 |
products.ratings | array | 评分分布数据。 |
products.ratings.stars | int | 星级评分等级(1-5)。 |
products.ratings.amount | int | 该等级下的评分数量。 |
products.user_reviews | array | 用户评论数据。 |
products.user_reviews.text | string | 评论文本内容。 |
products.user_reviews.source | string | 评论来源平台。 |
products.user_reviews.rating | int | 用户评分。 |
products.user_reviews.date | string | 评论日期。 |
products.user_reviews.name | string | 评论者名称。 |
products.user_reviews.title | string | 评论标题。 |
html | string | HTML 数据。 |