Google Search via Scavio
Search Google and return structured JSON — no HTML parsing required. Covers web, news, images, maps, and lens search types.
When to trigger
Use this skill when the user asks to:
- - Look something up on the web or check a current fact
- Find recent news or events
- Search for images, maps, or documentation
- Answer any question that requires real-time or up-to-date information
Do not answer from memory when current information is needed. Search first.
Setup
Get a free API key at https://scavio.dev (1,000 free credits/month, no card required):
CODEBLOCK0
Workflow
- 1. Identify the user's intent and pick the right
search_type (classic, news, images, maps, lens). - Choose
light_request: false only if you need knowledge graph, people also ask, or related searches (costs 2 credits vs 1). - Call the endpoint with the query and any filters.
- Return results in a clear, structured response. Cite URLs.
Endpoint
CODEBLOCK1
Parameters
| Parameter | Type | Default | Description |
|---|
| INLINECODE7 | string | required | Search query (1-500 chars) |
| INLINECODE8 |
string |
classic |
classic,
news,
maps,
images,
lens |
|
country_code | string | -- | ISO 3166-1 alpha-2 (e.g.
us,
gb,
de) |
|
language | string | -- | ISO 639-1 code (e.g.
en,
fr,
es) |
|
page | number |
1 | Result page number |
|
device | string |
desktop |
desktop or
mobile |
|
nfpr | boolean |
false | Set
true to disable autocorrection |
|
light_request | boolean | omitted | Omit for 1 credit. Set
false for full results (2 credits) |
Example
CODEBLOCK2
Response
CODEBLOCK3
Full mode ("light_request": false) also returns: knowledge_graph, questions (people also ask), related_searches, news_results, top_stories.
Guardrails
- - Never fabricate search results or URLs. Only return what the API gives you.
- If the query is time-sensitive, always call the API — do not answer from training data.
- INLINECODE40 only supports
device: desktop. - Cite sources when summarizing results.
Failure handling
- - If the API returns an error, report the status code and stop.
- If no results are returned, tell the user and suggest rephrasing.
- If
SCAVIO_API_KEY is not set, prompt the user to export it before continuing.
LangChain
CODEBLOCK4
CODEBLOCK5
通过Scavio进行Google搜索
搜索Google并返回结构化JSON数据——无需HTML解析。涵盖网页、新闻、图片、地图和镜头搜索类型。
触发时机
当用户要求以下内容时使用此技能:
- - 在网上查找信息或核实当前事实
- 查找最新新闻或事件
- 搜索图片、地图或文档
- 回答任何需要实时或最新信息的问题
当需要最新信息时,不要凭记忆回答。先进行搜索。
设置
在 https://scavio.dev 获取免费API密钥(每月1000个免费额度,无需信用卡):
bash
export SCAVIOAPIKEY=skliveyour_key
工作流程
- 1. 识别用户意图并选择正确的searchtype(classic、news、images、maps、lens)。
- 仅当需要知识图谱、其他人也在问或相关搜索时,选择lightrequest: false(消耗2个额度 vs 1个额度)。
- 使用查询条件和筛选参数调用端点。
- 以清晰、结构化的响应返回结果。引用URL。
端点
POST https://api.scavio.dev/api/v1/google
Authorization: Bearer $SCAVIOAPIKEY
参数
| 参数 | 类型 | 默认值 | 描述 |
|---|
| query | 字符串 | 必填 | 搜索查询(1-500个字符) |
| search_type |
字符串 | classic | classic、news、maps、images、lens |
| country_code | 字符串 | -- | ISO 3166-1 alpha-2(例如 us、gb、de) |
| language | 字符串 | -- | ISO 639-1代码(例如 en、fr、es) |
| page | 数字 | 1 | 结果页码 |
| device | 字符串 | desktop | desktop 或 mobile |
| nfpr | 布尔值 | false | 设置为 true 可禁用自动纠错 |
| light_request | 布尔值 | 省略 | 省略消耗1个额度。设置为 false 获取完整结果(2个额度) |
示例
python
import os, requests
response = requests.post(
https://api.scavio.dev/api/v1/google,
headers={Authorization: fBearer {os.environ[SCAVIOAPIKEY]}},
json={query: langchain agents tutorial, country_code: us, language: en},
)
data = response.json()
results in data[results]
响应
json
{
results: [
{
title: 结果标题,
url: https://example.com,
description: 摘要...,
position: 1
}
],
query: langchain agents tutorial,
credits_used: 1,
credits_remaining: 999
}
完整模式(lightrequest: false)还会返回:knowledgegraph、questions(其他人也在问)、relatedsearches、newsresults、top_stories。
使用规范
- - 切勿编造搜索结果或URL。只返回API提供的内容。
- 如果查询涉及时效性信息,始终调用API——不要根据训练数据回答。
- search_type: news 仅支持 device: desktop。
- 总结结果时需引用来源。
失败处理
- - 如果API返回错误,报告状态码并停止。
- 如果没有返回结果,告知用户并建议重新表述查询。
- 如果未设置 SCAVIOAPIKEY,提示用户先导出密钥再继续。
LangChain
bash
pip install scavio-langchain
python
from scavio_langchain import ScavioSearchTool
tool = ScavioSearchTool(engine=google)