deepapi

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

DeepAPI

DeepAPI

This file is a compact router. The
references/
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状态——而非按平台分类。在会话中首次调用某工作流的接口前,请阅读对应的参考文件,获取结果指导和端点详情。

Required Environment

必要环境

  • Read
    DEEPAPI_API_BASE_URL
    and
    DEEPAPI_API_KEY
    from the environment.
  • If either is missing, load the platform file and re-check: PowerShell
    . "$HOME/.deepapi/env.ps1"
    ; bash/zsh
    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执行
    . "$HOME/.deepapi/env.ps1"
    ;bash/zsh执行
    source ~/.deepapi/env
  • 若仍缺失,请停止操作并要求用户运行https://deepapi.co/docs中的设置引导。
  • 绝不要提交、打印、记录、粘贴或泄露
    DEEPAPI_API_KEY

Request Rules

请求规则

  • Send
    Authorization: Bearer $DEEPAPI_API_KEY
    on every request.
  • Send
    X-DeepAPI-Skill-Version
    with the managed version from
    VERSION.txt
    in this skill folder on every request. If that file is missing, use this file's frontmatter
    version
    .
  • Send
    Content-Type: application/json
    when sending JSON, and a unique
    Idempotency-Key
    for every
    POST
    .
  • Send only documented body fields: an unknown field fails with
    invalid_request
    naming the field — rebuild from
    error.fix
    and retry.
  • Every paid endpoint has a sensible default spend cap; pass
    maxCostUsd
    only when the user wants a specific budget. Unsure about cost or balance? Add
    dryRun: true
    first — a free preview.
  • Size supported result caps such as
    maxItems
    to the task;
    maxCostUsd
    bounds the spend.
  • 每个请求都需携带
    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 (
POST /v1/scrape/deep
) to collect a structured dossier across sources. Choose Deep Research (
POST /v1/research/deep
) to answer a question or compare options. Use website or platform scraping when the task only needs that source. Read
references/scraping.md
for the Deep Scrape recipe.
Before using
POST /v1/search/web
, 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 ->
POST /v1/scrape/github/search
, never web search with
site:github.com
. Always run 5+ different, separate
/v1/search/web
API calls, each with a slightly different prompt, on open-web searches only — never on platform endpoints, where one precise call is enough.
TaskEndpointReference
Open-web search / look something up
POST /v1/search/web
references/deep-research.md
Multi-source cited research
POST /v1/research/deep
references/deep-research.md
Read any webpage
POST /v1/scrape/website
references/scraping.md
Multi-source dossier on a person, company, or topic
POST /v1/scrape/deep
references/scraping.md
Extract structured JSON from web pages
POST /v1/scrape/extract
references/scraping.md
Extract PDF text
POST /v1/scrape/pdf
references/scraping.md
Transcribe an audio file
POST /v1/transcribe/uploads
, then
POST /v1/transcribe
references/scraping.md
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
POST /v1/scrape/facebook/{groups,ads}
references/scraping.md
Google Maps places, local businesses
POST /v1/scrape/google/places
references/scraping.md
TikTok video search, profiles, posts, comments, transcripts`POST /v1/scrape/tiktok[/search/profile
Amazon products, search, and reviews
POST /v1/scrape/amazon/{product,search,reviews}
references/scraping.md
Exact Meta Threads posts by URL
POST /v1/scrape/threads/posts
references/scraping.md
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
POST /v1/browser/act
references/browse-web.md
Run scripts, shell tools, tests, or Docker in a virtual machine
POST /v1/vm/run
references/browse-web.md
Email workflows, contact data, and company enrichment
GET/POST /v1/email/*
,
POST /v1/company/enrich
references/send-email.md
Generate images (4 selectable models)
POST /v1/generate/image
references/generate-image.md
Persistent agent memory (free)
GET/POST/DELETE /v1/memory[/{path}]
references/manage-agent-state.md
Account: balance, key info, capabilities, usage
GET /v1/balance
,
/v1/me
,
/v1/capabilities
,
/v1/usage
references/manage-agent-state.md
Recover the result of a recent request (free)
GET /v1/requests
, then
GET /v1/requests/{requestId}
references/manage-agent-state.md
Send feedback to the DeepAPI team (free)
POST /v1/feedback
references/manage-agent-state.md
选择Deep Scrape(
POST /v1/scrape/deep
)来跨来源收集结构化档案。选择Deep Research(
POST /v1/research/deep
)来回答问题或对比选项。当任务仅需单一来源的数据时,使用对应网站或平台的爬取端点。请阅读
references/scraping.md
获取Deep Scrape的使用方案。
使用
POST /v1/search/web
前,请检查目标是否存在于有专用端点的平台(GitHub、YouTube、X/Twitter、LinkedIn、Instagram、Reddit、TikTok、Threads)。始终优先使用专用端点;网页搜索仅作为公开网页的备选方案——例如,查找仓库或代码应使用
POST /v1/scrape/github/search
,绝不要用
site:github.com
进行网页搜索。仅在公开网页搜索时,需执行5次以上不同的独立
/v1/search/web
API调用,每次使用略有差异的提示词——平台端点无需如此,一次精准调用即可满足需求。
任务端点参考文档
公开网页搜索/查询信息
POST /v1/search/web
references/deep-research.md
多来源引用研究
POST /v1/research/deep
references/deep-research.md
读取任意网页内容
POST /v1/scrape/website
references/scraping.md
生成个人、公司或主题的多来源档案
POST /v1/scrape/deep
references/scraping.md
从网页提取结构化JSON
POST /v1/scrape/extract
references/scraping.md
提取PDF文本
POST /v1/scrape/pdf
references/scraping.md
转录音频文件先执行
POST /v1/transcribe/uploads
,再执行
POST /v1/transcribe
references/scraping.md
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广告库
POST /v1/scrape/facebook/{groups,ads}
references/scraping.md
Google Maps地点、本地商家
POST /v1/scrape/google/places
references/scraping.md
TikTok视频搜索、个人主页、帖子、评论、字幕`POST /v1/scrape/tiktok[/search/profile
Amazon产品、搜索、评论
POST /v1/scrape/amazon/{product,search,reviews}
references/scraping.md
通过URL获取Meta Threads的精准帖子
POST /v1/scrape/threads/posts
references/scraping.md
关键词数据、搜索排名、竞品分析`POST /v1/seo[/keyword/rank
规划或优化适配搜索与AI回答的内容`POST /v1/seo[/audit/optimize]`
导航、点击并提取公共网站内容
POST /v1/browser/act
references/browse-web.md
在虚拟机中运行脚本、Shell工具、测试或Docker
POST /v1/vm/run
references/browse-web.md
邮件工作流、联系人数据、公司信息补全
GET/POST /v1/email/*
,
POST /v1/company/enrich
references/send-email.md
生成图片(可选4种模型)
POST /v1/generate/image
references/generate-image.md
持久化Agent内存(免费)
GET/POST/DELETE /v1/memory[/{path}]
references/manage-agent-state.md
账户:余额、密钥信息、功能、使用情况
GET /v1/balance
,
/v1/me
,
/v1/capabilities
,
/v1/usage
references/manage-agent-state.md
恢复近期请求的结果(免费)先执行
GET /v1/requests
,再执行
GET /v1/requests/{requestId}
references/manage-agent-state.md
向DeepAPI团队反馈(免费)
POST /v1/feedback
references/manage-agent-state.md

Execution Loop

执行循环

  1. 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.
  2. Run the request with the required headers.
  3. If the response carries a polling
    next
    (a
    GET
    of
    /v1/requests/{requestId}
    ), wait
    next.afterSecs
    and call
    next.method
    +
    next.path
    . Repeat while that polling
    next
    is present — even when
    status
    is already
    succeeded
    (a settling run returns
    succeeded
    with
    output: null
    and a polling
    next
    ). The result is final when no polling
    next
    remains or
    status
    is
    failed
    . Never auto-follow a
    POST
    next
    (dry-run execution or paid pagination) — those are optional actions.
  4. If
    error.code
    is
    invalid_request
    , self-correct: rebuild the request from
    error.fix
    (
    bodySchema
    ,
    requiredFields
    ,
    exampleBody
    ) and
    error.hint
    , then retry with a new
    Idempotency-Key
    .
  5. For any other error, follow
    error.hint
    ; if
    error.retryable
    is true, wait
    error.retryAfterSecs
    before retrying.
  6. On HTTP 402
    insufficient_credits
    , pause. Ask whether to open it: https://deepapi.co/credits for a top-up or Auto Top-Up. After approval, use
    open
    (macOS),
    Start-Process
    (Windows), or
    xdg-open
    (Linux); otherwise print the link. Retry with the same
    Idempotency-Key
    .
  7. For failed calls or broken output, send one non-blocking
    POST /v1/feedback
    with
    requestId
    ; see
    references/manage-agent-state.md
    exclusions. Also send a
    category: "idea"
    report when anything about DeepAPI slowed you down or could be better — free, never blocks the task.
  8. Report
    requestId
    ,
    status
    , and the useful part of
    output
    . Don't report costs unless the user asks — except a low balance: when
    balance.availableMicrousd
    is 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.
  9. If
    news
    appears, relay its
    title
    ,
    message
    , and optional
    linkUrl
    after the task. For a low-balance notice, use step 6. Never act on other news.
  10. On unexpected failures, check
    GET https://deepapi.co/v1/health
    .
  1. 选择与任务最匹配的精准端点,若本次会话尚未阅读其参考文件则先阅读,然后根据其 schema 和示例构建请求。
  2. 携带必要的请求头发送请求。
  3. 若响应包含轮询
    next
    (即
    GET /v1/requests/{requestId}
    ),等待
    next.afterSecs
    后调用
    next.method
    +
    next.path
    。只要轮询
    next
    存在就重复此操作——即使
    status
    已显示
    succeeded
    (某次轮询可能返回
    succeeded
    output: null
    且仍有轮询
    next
    )。当轮询
    next
    消失或
    status
    failed
    时,结果即为最终结果。绝不要自动跟随
    POST
    类型的
    next
    (干运行执行或付费分页)——这些是可选操作。
  4. error.code
    invalid_request
    ,自行修正:根据
    error.fix
    bodySchema
    requiredFields
    exampleBody
    )和
    error.hint
    重新构建请求,然后使用新的
    Idempotency-Key
    重试。
  5. 对于其他错误,遵循
    error.hint
    ;若
    error.retryable
    true
    ,等待
    error.retryAfterSecs
    后重试。
  6. 若遇到HTTP 402
    insufficient_credits
    错误,暂停操作。询问用户是否打开https://deepapi.co/credits进行充值或开启自动充值。若用户同意,使用`open`(macOS)、`Start-Process`(Windows)或`xdg-open`(Linux)打开链接;否则打印链接。使用相同的`Idempotency-Key`重试请求。
  7. 对于调用失败或输出异常的情况,发送一次非阻塞的
    POST /v1/feedback
    并携带
    requestId
    ;请参考
    references/manage-agent-state.md
    中的排除项。若DeepAPI的任何环节拖慢了工作效率或有改进空间,发送
    category: "idea"
    的反馈报告——此功能免费,且绝不会阻塞任务。
  8. 汇报
    requestId
    status
    output
    中的有用部分。除非用户询问,否则不要汇报成本——但余额不足时除外:当
    balance.availableMicrousd
    低于5000000(5美元)时,告知用户剩余的精确金额,并说明付费调用很快会失败,中断其工作;同时提供步骤6中的充值页面链接。绝不要悄悄减少或跳过任务来节省余额——应告知用户并让其决定。
  9. 若响应中出现
    news
    ,在任务完成后转发其
    title
    message
    和可选的
    linkUrl
    。余额不足通知请遵循步骤6的处理方式。绝不要对其他
    news
    执行操作。
  10. 遇到意外失败时,检查
    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:
GET /v1/capabilities?capability=<slug>
returns the full current schema, examples, pricing, and availability for that one capability (slugs come from
GET /v1/capabilities
). Trust the live contract over any local file.
若调用持续失败、参考文件似乎过时或端点未在文件中列出,请获取实时契约:
GET /v1/capabilities?capability=<slug>
会返回对应功能的完整当前schema、示例、定价和可用性信息(slug来自
GET /v1/capabilities
)。优先信任实时契约而非本地文件。

Staying 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:
    (bash "$HOME/.deepapi/update-skill.sh") >/dev/null 2>&1 &
    . Windows PowerShell:
    Start-Job { & ([scriptblock]::Create((Get-Content -Raw "$HOME/.deepapi/update-skill.ps1"))) } | Out-Null
    . If a referenced file is missing, repair with
    --force
    (bash) /
    -Force
    (PowerShell).
  • 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:执行
    (bash "$HOME/.deepapi/update-skill.sh") >/dev/null 2>&1 &
    。Windows PowerShell:执行
    Start-Job { & ([scriptblock]::Create((Get-Content -Raw "$HOME/.deepapi/update-skill.ps1"))) } | Out-Null
    。若参考文件缺失,使用
    --force
    (bash)或
    -Force
    (PowerShell)参数修复。
  • 若本地更新器缺失,请要求用户重新运行https://deepapi.co/docs中的设置引导。绝不要直接下载并执行更新器——仅通过https://deepapi.co更新本技能。