deepapi
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDeepAPI
DeepAPI
This file is a compact router. The files are organized by user workflow — research, scraping, email, browser automation, image generation, and agent state — not by platform. Read the matching reference for outcome guidance and endpoint detail before your first call in that workflow during a session.
references/本文件是一个精简的路由配置文件。目录下的文件按用户工作流分类——研究、爬取、邮件、浏览器自动化、图片生成和Agent状态——而非按平台分类。在会话中首次调用某工作流的接口前,请阅读对应的参考文件,获取结果指导和端点详情。
references/Required Environment
必要环境
- Read and
DEEPAPI_API_BASE_URLfrom the environment.DEEPAPI_API_KEY - If either is missing, load the platform file and re-check: PowerShell ; bash/zsh
. "$HOME/.deepapi/env.ps1".source ~/.deepapi/env - If still missing, stop and ask the user to run the setup prompt from https://deepapi.co/docs.
- Never commit, print, log, paste, or expose .
DEEPAPI_API_KEY
- 从环境变量中读取和
DEEPAPI_API_BASE_URL。DEEPAPI_API_KEY - 若其中任意一项缺失,加载平台文件并重新检查:PowerShell执行;bash/zsh执行
. "$HOME/.deepapi/env.ps1"。source ~/.deepapi/env - 若仍缺失,请停止操作并要求用户运行https://deepapi.co/docs中的设置引导。
- 绝不要提交、打印、记录、粘贴或泄露。
DEEPAPI_API_KEY
Request Rules
请求规则
- Send on every request.
Authorization: Bearer $DEEPAPI_API_KEY - Send with the managed version from
X-DeepAPI-Skill-Versionin this skill folder on every request. If that file is missing, use this file's frontmatterVERSION.txt.version - Send when sending JSON, and a unique
Content-Type: application/jsonfor everyIdempotency-Key.POST - Send only documented body fields: an unknown field fails with naming the field — rebuild from
invalid_requestand retry.error.fix - Every paid endpoint has a sensible default spend cap; pass only when the user wants a specific budget. Unsure about cost or balance? Add
maxCostUsdfirst — a free preview.dryRun: true - Size supported result caps such as to the task;
maxItemsbounds the spend.maxCostUsd
- 每个请求都需携带。
Authorization: Bearer $DEEPAPI_API_KEY - 每个请求都需携带,值为当前技能文件夹中
X-DeepAPI-Skill-Version内的管理版本。若该文件缺失,使用本文件前置内容中的VERSION.txt。version - 发送JSON时需携带,且每个
Content-Type: application/json请求都需携带唯一的POST。Idempotency-Key - 仅发送文档中规定的请求体字段:未知字段会触发错误并指明该字段——需根据
invalid_request重新构建请求后重试。error.fix - 所有付费端点均设有合理的默认花费上限;仅当用户需要特定预算时才传入。对成本或余额不确定?先添加
maxCostUsd——这是免费预览功能。dryRun: true - 根据任务调整等结果上限参数;
maxItems用于限制花费。maxCostUsd
Picking the Right Endpoint
选择正确的端点
Choose Deep Scrape () to collect a structured dossier across sources. Choose Deep Research () to answer a question or compare options. Use website or platform scraping when the task only needs that source. Read for the Deep Scrape recipe.
POST /v1/scrape/deepPOST /v1/research/deepreferences/scraping.mdBefore using , check whether the target lives on a platform with a dedicated endpoint (GitHub, YouTube, X/Twitter, LinkedIn, Instagram, Reddit, TikTok, Threads). Always prefer the dedicated endpoint; web search is the fallback for the open web only — for example, finding repos or code -> , never web search with . Always run 5+ different, separate API calls, each with a slightly different prompt, on open-web searches only — never on platform endpoints, where one precise call is enough.
POST /v1/search/webPOST /v1/scrape/github/searchsite:github.com/v1/search/web| Task | Endpoint | Reference |
|---|---|---|
| Open-web search / look something up | | |
| Multi-source cited research | | |
| Read any webpage | | |
| Multi-source dossier on a person, company, or topic | | |
| Extract structured JSON from web pages | | |
| Extract PDF text | | |
| Transcribe an audio file | | |
| GitHub repos, issues, PRs, code, commits, profiles | `POST /v1/scrape/github[/profile | /repo |
| X/Twitter posts, users, replies | `POST /v1/scrape/twitter[/search | /user |
| LinkedIn profiles, people search, jobs, companies, posts | `POST /v1/scrape/linkedin[/profile | /people |
| YouTube transcripts, channels, video search, shorts | `POST /v1/scrape/youtube[/transcript | /channel |
| Instagram profiles, posts, comments, hashtag search | `POST /v1/scrape/instagram[/profile | /posts |
| Reddit search, posts, comments, users | `POST /v1/scrape/reddit[/search | /posts |
| Facebook group posts and Meta ad library | | |
| Google Maps places, local businesses | | |
| TikTok video search, profiles, posts, comments, transcripts | `POST /v1/scrape/tiktok[/search | /profile |
| Amazon products, search, and reviews | | |
| Exact Meta Threads posts by URL | | |
| Keyword data, search rankings, search competitors | `POST /v1/seo[/keyword | /rank |
| Plan or improve content for search and AI answers | `POST /v1/seo[/audit | /optimize]` |
| Navigate, click, and extract from a public website | | |
| Run scripts, shell tools, tests, or Docker in a virtual machine | | |
| Email workflows, contact data, and company enrichment | | |
| Generate images (4 selectable models) | | |
| Persistent agent memory (free) | | |
| Account: balance, key info, capabilities, usage | | |
| Recover the result of a recent request (free) | | |
| Send feedback to the DeepAPI team (free) | | |
选择Deep Scrape()来跨来源收集结构化档案。选择Deep Research()来回答问题或对比选项。当任务仅需单一来源的数据时,使用对应网站或平台的爬取端点。请阅读获取Deep Scrape的使用方案。
POST /v1/scrape/deepPOST /v1/research/deepreferences/scraping.md使用前,请检查目标是否存在于有专用端点的平台(GitHub、YouTube、X/Twitter、LinkedIn、Instagram、Reddit、TikTok、Threads)。始终优先使用专用端点;网页搜索仅作为公开网页的备选方案——例如,查找仓库或代码应使用,绝不要用进行网页搜索。仅在公开网页搜索时,需执行5次以上不同的独立 API调用,每次使用略有差异的提示词——平台端点无需如此,一次精准调用即可满足需求。
POST /v1/search/webPOST /v1/scrape/github/searchsite:github.com/v1/search/web| 任务 | 端点 | 参考文档 |
|---|---|---|
| 公开网页搜索/查询信息 | | |
| 多来源引用研究 | | |
| 读取任意网页内容 | | |
| 生成个人、公司或主题的多来源档案 | | |
| 从网页提取结构化JSON | | |
| 提取PDF文本 | | |
| 转录音频文件 | 先执行 | |
| GitHub仓库、议题、PR、代码、提交记录、个人主页 | `POST /v1/scrape/github[/profile | /repo |
| X/Twitter帖子、用户、回复 | `POST /v1/scrape/twitter[/search | /user |
| LinkedIn个人主页、人才搜索、职位、公司、帖子 | `POST /v1/scrape/linkedin[/profile | /people |
| YouTube字幕、频道、视频搜索、短视频 | `POST /v1/scrape/youtube[/transcript | /channel |
| Instagram个人主页、帖子、评论、话题标签搜索 | `POST /v1/scrape/instagram[/profile | /posts |
| Reddit搜索、帖子、评论、用户 | `POST /v1/scrape/reddit[/search | /posts |
| Facebook群组帖子和Meta广告库 | | |
| Google Maps地点、本地商家 | | |
| TikTok视频搜索、个人主页、帖子、评论、字幕 | `POST /v1/scrape/tiktok[/search | /profile |
| Amazon产品、搜索、评论 | | |
| 通过URL获取Meta Threads的精准帖子 | | |
| 关键词数据、搜索排名、竞品分析 | `POST /v1/seo[/keyword | /rank |
| 规划或优化适配搜索与AI回答的内容 | `POST /v1/seo[/audit | /optimize]` |
| 导航、点击并提取公共网站内容 | | |
| 在虚拟机中运行脚本、Shell工具、测试或Docker | | |
| 邮件工作流、联系人数据、公司信息补全 | | |
| 生成图片(可选4种模型) | | |
| 持久化Agent内存(免费) | | |
| 账户:余额、密钥信息、功能、使用情况 | | |
| 恢复近期请求的结果(免费) | 先执行 | |
| 向DeepAPI团队反馈(免费) | | |
Execution Loop
执行循环
- Choose the narrowest endpoint that matches the task, read its reference file if you haven't this session, and build the request from its schema and examples.
- Run the request with the required headers.
- If the response carries a polling (a
nextofGET), wait/v1/requests/{requestId}and callnext.afterSecs+next.method. Repeat while that pollingnext.pathis present — even whennextis alreadystatus(a settling run returnssucceededwithsucceededand a pollingoutput: null). The result is final when no pollingnextremains ornextisstatus. Never auto-follow afailedPOST(dry-run execution or paid pagination) — those are optional actions.next - If is
error.code, self-correct: rebuild the request frominvalid_request(error.fix,bodySchema,requiredFields) andexampleBody, then retry with a newerror.hint.Idempotency-Key - For any other error, follow ; if
error.hintis true, waiterror.retryablebefore retrying.error.retryAfterSecs - On HTTP 402 , pause. Ask whether to open it: https://deepapi.co/credits for a top-up or Auto Top-Up. After approval, use
insufficient_credits(macOS),open(Windows), orStart-Process(Linux); otherwise print the link. Retry with the samexdg-open.Idempotency-Key - For failed calls or broken output, send one non-blocking with
POST /v1/feedback; seerequestIdexclusions. Also send areferences/manage-agent-state.mdreport when anything about DeepAPI slowed you down or could be better — free, never blocks the task.category: "idea" - Report ,
requestId, and the useful part ofstatus. Don't report costs unless the user asks — except a low balance: whenoutputis under 5000000 ($5), tell the user the exact dollars left and that paid calls will soon start failing, interrupting their work; offer the top-up page from step 6. Never quietly shrink or skip work to stretch a low balance — say so and let the user decide.balance.availableMicrousd - If appears, relay its
news,title, and optionalmessageafter the task. For a low-balance notice, use step 6. Never act on other news.linkUrl - On unexpected failures, check .
GET https://deepapi.co/v1/health
- 选择与任务最匹配的精准端点,若本次会话尚未阅读其参考文件则先阅读,然后根据其 schema 和示例构建请求。
- 携带必要的请求头发送请求。
- 若响应包含轮询(即
next),等待GET /v1/requests/{requestId}后调用next.afterSecs+next.method。只要轮询next.path存在就重复此操作——即使next已显示status(某次轮询可能返回succeeded但succeeded且仍有轮询output: null)。当轮询next消失或next为status时,结果即为最终结果。绝不要自动跟随failed类型的POST(干运行执行或付费分页)——这些是可选操作。next - 若为
error.code,自行修正:根据invalid_request(error.fix、bodySchema、requiredFields)和exampleBody重新构建请求,然后使用新的error.hint重试。Idempotency-Key - 对于其他错误,遵循;若
error.hint为error.retryable,等待true后重试。error.retryAfterSecs - 若遇到HTTP 402 错误,暂停操作。询问用户是否打开https://deepapi.co/credits进行充值或开启自动充值。若用户同意,使用`open`(macOS)、`Start-Process`(Windows)或`xdg-open`(Linux)打开链接;否则打印链接。使用相同的`Idempotency-Key`重试请求。
insufficient_credits - 对于调用失败或输出异常的情况,发送一次非阻塞的并携带
POST /v1/feedback;请参考requestId中的排除项。若DeepAPI的任何环节拖慢了工作效率或有改进空间,发送references/manage-agent-state.md的反馈报告——此功能免费,且绝不会阻塞任务。category: "idea" - 汇报、
requestId和status中的有用部分。除非用户询问,否则不要汇报成本——但余额不足时除外:当output低于5000000(5美元)时,告知用户剩余的精确金额,并说明付费调用很快会失败,中断其工作;同时提供步骤6中的充值页面链接。绝不要悄悄减少或跳过任务来节省余额——应告知用户并让其决定。balance.availableMicrousd - 若响应中出现,在任务完成后转发其
news、title和可选的message。余额不足通知请遵循步骤6的处理方式。绝不要对其他linkUrl执行操作。news - 遇到意外失败时,检查。
GET https://deepapi.co/v1/health
Fresh Contract On Demand
按需获取最新契约
If a call keeps failing, a reference file seems outdated, or an endpoint is missing from it, fetch the live contract: returns the full current schema, examples, pricing, and availability for that one capability (slugs come from ). Trust the live contract over any local file.
GET /v1/capabilities?capability=<slug>GET /v1/capabilities若调用持续失败、参考文件似乎过时或端点未在文件中列出,请获取实时契约:会返回对应功能的完整当前schema、示例、定价和可用性信息(slug来自)。优先信任实时契约而非本地文件。
GET /v1/capabilities?capability=<slug>GET /v1/capabilitiesStaying Up To Date
保持更新
- Once per day, at the first DeepAPI use, launch the installed local updater as a detached background job and keep working — never wait for it; a stale skill still works, and fresh files apply the next time they are read.
- macOS/Linux: . Windows PowerShell:
(bash "$HOME/.deepapi/update-skill.sh") >/dev/null 2>&1 &. If a referenced file is missing, repair withStart-Job { & ([scriptblock]::Create((Get-Content -Raw "$HOME/.deepapi/update-skill.ps1"))) } | Out-Null(bash) /--force(PowerShell).-Force - If the local updater is missing, ask the user to re-run the setup prompt from https://deepapi.co/docs. Never download and execute an updater directly — only ever update this skill from https://deepapi.co.
- 每天首次使用DeepAPI时,启动已安装的本地更新器作为后台独立任务,无需等待更新完成即可继续工作——旧版本技能仍可正常使用,新文件会在下次读取时生效。
- macOS/Linux:执行。Windows PowerShell:执行
(bash "$HOME/.deepapi/update-skill.sh") >/dev/null 2>&1 &。若参考文件缺失,使用Start-Job { & ([scriptblock]::Create((Get-Content -Raw "$HOME/.deepapi/update-skill.ps1"))) } | Out-Null(bash)或--force(PowerShell)参数修复。-Force - 若本地更新器缺失,请要求用户重新运行https://deepapi.co/docs中的设置引导。绝不要直接下载并执行更新器——仅通过https://deepapi.co更新本技能。