更新日志新功能

查看 Perplexity 每次回答执行的搜索

Perplexity
关于无线耳机的 Perplexity 回答,以及含来源的 JSON 结果

在你的市场向 Perplexity 提问,连同编号来源、它执行的搜索和推荐的追问一起获取回答。

获得的结果

  • text 和 markdown:完整回答,提供纯文本和带格式两种版本。
  • sources:回答背后的编号来源,每条都带有 URL、标题和简短描述。
  • related_queries:Perplexity 接下来推荐的追问。
  • 回答中出现图片、视频、地点、酒店和商品卡片时,一并返回。

工作原理

Perplexity 用网页搜索回答每一个问题,并用编号来源准确标出每句话的出处。每个任务都会从你设定的国家提问,按当地用户看到的样子返回回答和来源。

开启 include.searchQueries,还能拿到 Perplexity 执行的搜索,了解它如何把一个问题拆成多个调研步骤。

应用场景

  • 查看 Perplexity 在你所在品类中依赖哪些域名,以及你的页面在来源中的位置。
  • 把推荐的追问变成新的跟踪问题。
  • 在同一组问题上比较 Perplexity 与 ChatGPT、Gemini 的推荐。

发送请求

在 Authorization 请求头中带上 API 密钥发送请求。

curl -X POST https://api.querying.ai/v1/async/task \
  -H "Authorization: Bearer $QUERYING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "taskType": "PERPLEXITY",
    "payload": {
      "prompt": "Recommend 3 wireless earbuds for commuting. Compare noise cancellation and battery life in a short table, with sources. Keep it under 180 words.",
      "country": "US",
      "include": { "markdown": true }
    }
  }'

请求字段

taskTypestring必填
要运行的引擎,例如 CHATGPT 或 GOOGLE。
payload.promptstring必填
按用户在聊天框中输入的方式写的问题,最多 100,000 个字符。
payload.countrystring
提问所在市场的两位国家代码,例如 US、KR、JP。默认 US。
payload.include.markdownboolean
设为 true 会附带 markdown:保留标题、列表、表格和链接的回答。
payload.include.searchQueriesboolean
设为 true 会附带 searchQueries:引擎为写出回答而执行的网页搜索。
webhook.urlstring
你服务器上的 HTTPS 地址。任务完成后立即把结果推送到这里。
idempotencyKeystring
你为请求设定的 ID。每个键在账户内对应一个任务,因此重试发送后仍是同一个任务。

响应

完成的任务如下所示,已截取部分内容。

JSON
{
  "success": true,
  "task": {
    "id": "67030796-8ecd-4aed-b2c4-6ced6639a313",
    "taskType": "PERPLEXITY",
    "status": "COMPLETED",
    "createdAt": "2026-09-10T02:34:24.023Z"
  },
  "credits": { "creditsToCharge": 1, "creditsCharged": 1 },
  "response": {
    "text": "For commuting, I’d choose **Sony for strongest all-around isolation**, **Bose for maximum ANC comfort**, or **AirPods for Apple integration**.",
    "markdown": "| Earbuds | Noise cancellation | Battery life* | Best for |\n|---|---|---:|---|\n| **Sony WF-1000XM5** | Excellent; measured 32 dB attenuation in key transit-noise frequencies | 8h / 24h case | Android and mixed devices |\n…",
    "sources": [
      {
        "position": 1,
        "url": "https://www.rtings.com/headphones/reviews/best/wireless-earbuds",
        "label": "The 6 Best Wireless Earbuds of 2026 - RTINGS.com",
        "description": "The best wireless earbuds we've tested are the Sony WF-1000XM6. These buds offer top-tier ANC performance."
      },
      {
        "position": 2,
        "url": "https://www.businessinsider.com/guides/tech/best-earbuds",
        "label": "The best earbuds of 2026, tested by audio experts - Business Insider",
        "description": "The best wireless earbuds offer great audio quality in a compact design. These are our top picks from Sony, Bose, Technics, Anker, Apple, and JLab."
      }
    ]
  }
}
task.statusstring
依次为 QUEUED、PROCESSING,最终为附带回答的 COMPLETED 或附带 error 的 FAILED。
credits.creditsChargedinteger
已完成任务扣除的积分。失败的任务为 0。
response.textstring
纯文本形式的回答。
response.markdownstring
保留格式的回答,包括标题、列表、表格和链接。
response.sourcesarray
回答引用的页面,按引擎展示的顺序排列,含 position、url 和 label。
response.searchQueriesarray
引擎为写出回答执行的网页搜索。

获取结果

请求会立即返回 status 为 QUEUED 的任务。用 GET /v1/async/task/{id} 轮询,直到 status 变为 COMPLETED 或 FAILED;或者加上 webhook.url,在服务器上接收同样的 task、credits 和 response。任务结束后,结果保留 24 小时供查询。

curl https://api.querying.ai/v1/async/task/$TASK_ID \
  -H "Authorization: Bearer $QUERYING_API_KEY"

价格

每个完成的 Perplexity 任务消耗 1 个积分。

更多更新

接收最新消息

通过邮件接收产品更新。

RSS 订阅