# Perplexity

该 `perplexity` source 允许你直接向 Perplexity 发送提示并捕获完整响应。它以结构化格式返回生成的文本和相关元数据，以及结果的 Markdown 版本。

## 请求示例

下面的代码示例演示如何向 Perplexity 发送提示并检索解析后的响应。

{% tabs %}
{% tab title="cURL" %}

```bash
curl 'https://realtime.oxylabs.io/v1/queries' \
--user 'USERNAME:PASSWORD' \
-H 'Content-Type: application/json' \
-d '{
        "source": "perplexity",
        "prompt": "top 3 smartphones in 2025, compare pricing across US marketplaces",
        "geo_location": "United States",
        "parse": true
    }'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
from pprint import pprint


# 构建负载。
payload = {
    'source': 'perplexity',
    'prompt': 'top 3 smartphones in 2025, compare pricing across US marketplaces',
    'geo_location': 'United States',
    'parse': True
}

# 获取响应。
response = requests.post(
    'https://realtime.oxylabs.io/v1/queries',
    auth=('USERNAME', 'PASSWORD'),
    json=payload
)

# 将美化后的响应打印到 stdout。
pprint(response.json())
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
const https = require("https");

const username = "USERNAME";
const password = "PASSWORD";
const body = {
    source: "perplexity",
    prompt: "top 3 smartphones in 2025, compare pricing across US marketplaces",
    geo_location: "United States",
    parse: true
};

const options = {
    hostname: "realtime.oxylabs.io",
    path: "/v1/queries",
    method: "POST",
    headers: {
        "Content-Type": "application/json",
        Authorization:
            "Basic " + Buffer.from(`${username}:${password}`).toString("base64"),
    },
};

const request = https.request(options, (response) => {
    let data = "";

    response.on("data", (chunk) => {
        data += chunk;
    });

    response.on("end", () => {
        const responseData = JSON.parse(data);
        console.log(JSON.stringify(responseData, null, 2));
    });
});

request.on("error", (error) => {
    console.error("Error:", error);
});

request.write(JSON.stringify(body));
request.end();
```

{% endtab %}

{% tab title="HTTP" %}

```http
https://realtime.oxylabs.io/v1/queries?source=perplexity&prompt=top%203%20smartphones%20in%202025%2C%20compare%20pricing%20across%20US%20marketplaces&geo_location=United%20States&parse=true&access_token=12345abcde
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$params = array(
    'source' => 'perplexity',
    'prompt' => 'top 3 smartphones in 2025, compare pricing across US marketplaces',
    'geo_location' => 'United States',
    'parse' => true
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://realtime.oxylabs.io/v1/queries");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_USERPWD, "USERNAME" . ":" . "PASSWORD");


$headers = array();
$headers[] = "Content-Type: application/json";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
echo $result;

if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}
curl_close($ch);
```

{% endtab %}

{% tab title="Golang" %}

```go
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io"
	"net/http"
)

func main() {
	const Username = "USERNAME"
	const Password = "PASSWORD"

	payload := map[string]interface{}{
		"source":       "perplexity",
		"prompt":       "top 3 smartphones in 2025, compare pricing across US marketplaces",
		"geo_location": "United States",
		"parse":        true,
	}

	jsonValue, _ := json.Marshal(payload)

	client := &http.Client{}
	request, _ := http.NewRequest("POST",
		"https://realtime.oxylabs.io/v1/queries",
		bytes.NewBuffer(jsonValue),
	)

	request.SetBasicAuth(Username, Password)
	response, _ := client.Do(request)

	responseText, _ := io.ReadAll(response.Body)
	fmt.Println(string(responseText))
}

```

{% endtab %}

{% tab title="C#" %}

```csharp
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Json;
using System.Threading.Tasks;

namespace OxyApi
{
    class Program
    {
        static async Task Main()
        {
            const string Username = "USERNAME";
            const string Password = "PASSWORD";

            var parameters = new
            {
                source = "perplexity",
                prompt = "top 3 smartphones in 2025, compare pricing across US marketplaces",
                geo_location = "United States",
                parse = true
            };

            var client = new HttpClient();

            Uri baseUri = new Uri("https://realtime.oxylabs.io");
            client.BaseAddress = baseUri;

            var requestMessage = new HttpRequestMessage(HttpMethod.Post, "/v1/queries");
            requestMessage.Content = JsonContent.Create(parameters);

            var authenticationString = $"{Username}:{Password}";
            var base64EncodedAuthenticationString = Convert.ToBase64String(System.Text.ASCIIEncoding.UTF8.GetBytes(authenticationString));
            requestMessage.Headers.Add("Authorization", "Basic " + base64EncodedAuthenticationString);

            var response = await client.SendAsync(requestMessage);
            var contents = await response.Content.ReadAsStringAsync();

            Console.WriteLine(contents);
        }
    }
}
```

{% endtab %}

{% tab title="Java" %}

```java
package org.example;

import okhttp3.*;
import org.json.JSONArray;
import org.json.JSONObject;
import java.util.concurrent.TimeUnit;

public class Main implements Runnable {
    private static final String AUTHORIZATION_HEADER = "Authorization";
    public static final String USERNAME = "USERNAME";
    public static final String PASSWORD = "PASSWORD";

    public void run() {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("source", "perplexity");
        jsonObject.put("prompt", "top 3 smartphones in 2025, compare pricing across US marketplaces");
        jsonObject.put("geo_location", "United States");
        jsonObject.put("parse", true);

        Authenticator authenticator = (route, response) -> {
            String credential = Credentials.basic(USERNAME, PASSWORD);
            return response
                    .request()
                    .newBuilder()
                    .header(AUTHORIZATION_HEADER, credential)
                    .build();
        };

        var client = new OkHttpClient.Builder()
                .authenticator(authenticator)
                .readTimeout(180, TimeUnit.SECONDS)
                .build();

        var mediaType = MediaType.parse("application/json; charset=utf-8");
        var body = RequestBody.create(jsonObject.toString(), mediaType);
        var request = new Request.Builder()
                .url("https://realtime.oxylabs.io/v1/queries")
                .post(body)
                .build();

        try (var response = client.newCall(request).execute()) {
            if (response.body() != null) {
                try (var responseBody = response.body()) {
                    System.out.println(responseBody.string());
                }
            }
        } catch (Exception exception) {
            System.out.println("Error: " + exception.getMessage());
        }

        System.exit(0);
    }

    public static void main(String[] args) {
        new Thread(new Main()).start();
    }
}
```

{% endtab %}

{% tab title="JSON" %}

```json
{
    "source": "perplexity",
    "prompt": "top 3 smartphones in 2025, compare pricing across US marketplaces",
    "geo_location": "United States",
    "parse": true
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
默认情况下，所有对 Perplexity 的请求都使用 JavaScript 渲染。在使用 Realtime 集成方法时，请确保设置足够的超时（例如 180 秒）。
{% endhint %}

我们的示例使用 [**Realtime**](https://developers.oxylabs.io/documentation/cn/zhua-qu-jie-jue-fang-an/web-scraper-api/integration-methods/realtime) (同步) 集成方法。要使用 [**Proxy Endpoint**](https://developers.oxylabs.io/documentation/cn/zhua-qu-jie-jue-fang-an/web-scraper-api/integration-methods/proxy-endpoint) 或 [**Push-Pull**](https://developers.oxylabs.io/documentation/cn/zhua-qu-jie-jue-fang-an/web-scraper-api/integration-methods/push-pull) （异步），请参考 [**integration methods**](https://developers.oxylabs.io/documentation/cn/zhua-qu-jie-jue-fang-an/web-scraper-api/integration-methods) 页面。

{% hint style="warning" %}
B**atch 请求** 当前 **不支持** 用于该 `perplexity` source。&#x20;
{% endhint %}

## 请求参数值

### 通用

用于抓取 Perplexity 响应的基本设置和配置参数。

<table><thead><tr><th width="222">参数</th><th width="350.3333333333333">描述</th><th>默认值</th></tr></thead><tbody><tr><td><mark style="background-color:green;"><strong><code>source</code></strong></mark></td><td>设置要使用的抓取器。</td><td><code>perplexity</code></td></tr><tr><td><mark style="background-color:green;"><strong><code>prompt</code></strong></mark></td><td>要提交给 Perplexity 的提示或问题。</td><td>-</td></tr><tr><td><code>parse</code></td><td>当设置为 <code>true</code>.</td><td><code>false</code></td></tr><tr><td><code>geo_location</code></td><td>指定从哪个国家/地区发送提示。 <a href="../features/localization/proxy-location"><strong>更多信息</strong></a>.</td><td>-</td></tr><tr><td><code>callback_url</code></td><td>你的回调端点的 URL。 <a href="../../integration-methods/push-pull#callback"><strong>更多信息</strong></a>.</td><td>-</td></tr></tbody></table>

&#x20;    \- 必填参数

## 结构化数据

网页爬虫 API 返回 Perplexity 输出的 HTML 文档或 JSON 对象，其中包含结果页面的结构化数据。

<details>

<summary><code>perplexity</code> 结构化输出</summary>

```json
{
  "results": [
    {
      "content": {
        "url": "https://www.perplexity.ai/search/top-3-smartphones-in-2025-comp-wvA0dso7TgW3NpgF8Jd8tg",
        "model": "turbo",
        "top_images": [
          {
            "url": "https://d2u1z1lopyfwlx.cloudfront.net/thumbnails/cca0fd5c-8a96-543c-89ff-3191b4be9c42/57288799-40bc-5d1f-90fe-b936b0a65cd1.jpg",
            "title": "Top Smartphones of 2025 with AI-Driven Features"
          },
          {
            "url": "https://d2u1z1lopyfwlx.cloudfront.net/thumbnails/2cc6543a-e4ef-594b-801f-c5b60308c33a/aec8f940-3469-5597-816f-0dd903b3407c.jpg",
            "title": "The best phone 2025: top smartphones in the US right now ..."
          },
          {
            "url": "https://d2u1z1lopyfwlx.cloudfront.net/thumbnails/26dedbf8-baca-5d1f-ac97-bd70b76c61a3/aec8f940-3469-5597-816f-0dd903b3407c.jpg",
            "title": "Best phones 2025 tested \u2014 Our top picks | Tom's Guide"
          },
          {
            "url": "https://d2u1z1lopyfwlx.cloudfront.net/thumbnails/0a3be7b1-a63d-5c96-b3f5-10b3ab84249c/6a4747ad-0c64-581e-8c1d-a7d907f27628.jpg",
            "title": "Best phones to buy in 2025 reviewed and ranked | Stuff"
          }
        ],
        "prompt_query": "top 3 smartphones in 2025, compare pricing across US marketplaces",
        "answer_results": [
          "The top 3 smartphones in 2025 based on expert reviews and market consensus are:",
          {
            "list": [
              [
                [
                  [
                    "Samsung Galaxy S25 Ultra"
                  ]
                ]
              ],
              [
                [
                  [
                    "Apple iPhone 16 Pro Max"
                  ]
                ]
              ],
              [
                [
                  [
                    "Google Pixel 9 Pro XL"
                  ],
                  " (or alternatively the Pixel 9a as a value option)"
                ]
              ]
            ]
          },
          "Pricing Comparison Across US Marketplaces (Approximate MSRP & Market Prices):",
          {
            "table": [
              {
                "table_columns": [
                  [
                    "Smartphone Model"
                  ],
                  [
                    "MSRP (Official)"
                  ],
                  [
                    "Amazon Price (2025)"
                  ],
                  [
                    "T-Mobile Price (2025)"
                  ],
                  [
                    "Notes"
                  ]
                ]
              },
              {
                "table_rows": [
                  [
                    [
                      "Samsung Galaxy S25 Ultra"
                    ],
                    [
                      "$1,300"
                    ],
                    [
                      "Around $949.50 (256GB)"
                    ],
                    [
                      "Around $830 - $1,000"
                    ],
                    [
                      "Prices vary by storage, with deals around $950 for 256GB variants; offers S Pen and premium camera features[2][11][12]"
                    ]
                  ],
                  [
                    [
                      "Apple iPhone 16 Pro Max"
                    ],
                    [
                      "$1,200"
                    ],
                    [
                      "Around $1,200"
                    ],
                    [
                      "$830 (iPhone 16 base)"
                    ],
                    [
                      "Pro Max model typically $1,200 MSRP; iPhone 16 base model available around $830 at carriers[2][10]"
                    ]
                  ],
                  [
                    [
                      "Google Pixel 9 Pro XL"
                    ],
                    [
                      "$900"
                    ],
                    [
                      "Not specifically listed"
                    ],
                    [
                      "N/A"
                    ],
                    [
                      "MSRP $900; Pixel 9a variant offers strong value under $500[2][4][10]"
                    ]
                  ]
                ]
              }
            ]
          },
          "Notes on these smartphones:",
          {
            "list": [
              [
                "Samsung Galaxy S25 Ultra",
                " is considered the best overall phone with a large 6.9\" display, powerful Snapdragon 8 Elite processor, 5,000mAh battery, versatile cameras including 200MP sensor, and built-in S Pen productivity features. It commands a premium price but can be found with discounts below MSRP on platforms like Amazon and T-Mobile[2][12]."
              ],
              [
                "Apple iPhone 16 Pro Max",
                " stands as the best iPhone with Apple's A18 Pro Bionic chip, a similarly large 6.9\" screen, and up to 1TB storage, priced around $1,200 MSRP. Carrier deals can sometimes bring the effective cost lower for the base iPhone 16 (not Pro Max)[2][10]."
              ],
              [
                "Google Pixel 9 Pro XL",
                " offers a solid camera and software experience with Google\u2019s Tensor G4 chip at a lower price point (~$900). For those seeking excellent value, the Pixel 9a offers impressive cameras and performance under $500 but is not a flagship competitor[2][4]."
              ]
            ]
          },
          "Marketplaces Overview:",
          {
            "list": [
              [
                [
                  [
                    "Amazon"
                  ],
                  " typically offers slightly discounted flagship prices\u2014Samsung Galaxy S25 Ultra (256GB) found near $949.50, OnePlus 13 and other flagships similarly discounted[11][12]."
                ]
              ],
              [
                [
                  [
                    "Carrier stores like T-Mobile"
                  ],
                  " sometimes provide financing and promotional prices\u2014iPhone 16 starting near $830 with plans, Samsung Galaxy S25 varies but can approach MSRP or lower under contracts[10][11]."
                ]
              ],
              [
                "Other marketplaces (Best Buy, Walmart) generally align with Amazon and carrier pricing but may vary with bundles and seasonal promotions."
              ]
            ]
          },
          "In summary, the premium flagship tier in 2025 centers around the Samsung Galaxy S25 Ultra and Apple iPhone 16 Pro Max, with Google\u2019s Pixel 9 Pro XL key as a powerful, slightly more affordable flagship alternative. Pricing varies but flagship devices routinely range from $900 to $1,300 in the US market, with discounts commonly available through Amazon and carriers[2][10][11][12].",
          {
            "enumerated_references": [
              {
                "num": 1,
                "url": "https://www.youtube.com/watch?v=EYMe2jy-urg"
              },
              {
                "num": 2,
                "url": "https://www.zdnet.com/article/best-phone/"
              },
              {
                "num": 3,
                "url": "https://www.tomsguide.com/best-picks/best-phones"
              },
              {
                "num": 4,
                "url": "https://www.wired.com/story/best-cheap-phones/"
              },
              {
                "num": 5,
                "url": "https://www.techradar.com/news/best-phone"
              },
              {
                "num": 6,
                "url": "https://www.counterpointresearch.com/insight/top-10-bestselling-smartphones-q1-2025/"
              },
              {
                "num": 7,
                "url": "https://uptradeit.com/blog/what-iphones-will-stop-working"
              },
              {
                "num": 8,
                "url": "https://www.stuff.tv/features/best-phone/"
              },
              {
                "num": 9,
                "url": "https://www.youtube.com/watch?v=93wZbN9tecs"
              },
              {
                "num": 10,
                "url": "https://www.cnet.com/tech/mobile/best-phone/"
              },
              {
                "num": 11,
                "url": "https://www.pcmag.com/picks/the-best-phones"
              },
              {
                "num": 12,
                "url": "https://www.gsmarena.com/best_flagship_phones_buyers_guide-review-2027.php"
              }
            ]
          }
        ],
        "displayed_tabs": [
          "search",
          "images",
          "sources"
        ],
        "related_queries": [
          "How do the prices of the top 3 smartphones compare across US marketplaces",
          "What features make the Galaxy S25 Ultra stand out as the best in 2025",
          "Why is the Pixel 9a considered a top budget option despite its lower price",
          "How does the iPhone 16 Pro Max's pricing differ from Samsung and Google models",
          "What factors should I consider when choosing among these top smartphones in 2025"
        ],
        "answer_results_md": "\nThe top 3 smartphones in 2025 based on expert reviews and market consensus are:\n\n1. **Samsung Galaxy S25 Ultra**\n2. **Apple iPhone 16 Pro Max**\n3. **Google Pixel 9 Pro XL** (or alternatively the Pixel 9a as a value option)\n\n### Pricing Comparison Across US Marketplaces (Approximate MSRP & Market Prices):\n\n| Smartphone Model        | MSRP (Official) | Amazon Price (2025) | T-Mobile Price (2025)  | Notes                        |\n|------------------------|-----------------|---------------------|-----------------------|------------------------------|\n| Samsung Galaxy S25 Ultra| $1,300          | Around $949.50 (256GB)| Around $830 - $1,000  | Prices vary by storage, with deals around $950 for 256GB variants; offers S Pen and premium camera features[2][11][12]|\n| Apple iPhone 16 Pro Max | $1,200          | Around $1,200         | $830 (iPhone 16 base)  | Pro Max model typically $1,200 MSRP; iPhone 16 base model available around $830 at carriers[2][10]|\n| Google Pixel 9 Pro XL   | $900            | Not specifically listed | N/A                   | MSRP $900; Pixel 9a variant offers strong value under $500[2][4][10]|\n\n### Notes on these smartphones:\n\n- **Samsung Galaxy S25 Ultra** is considered the best overall phone with a large 6.9\" display, powerful Snapdragon 8 Elite processor, 5,000mAh battery, versatile cameras including 200MP sensor, and built-in S Pen productivity features. It commands a premium price but can be found with discounts below MSRP on platforms like Amazon and T-Mobile[2][12].\n\n- **Apple iPhone 16 Pro Max** stands as the best iPhone with Apple's A18 Pro Bionic chip, a similarly large 6.9\" screen, and up to 1TB storage, priced around $1,200 MSRP. Carrier deals can sometimes bring the effective cost lower for the base iPhone 16 (not Pro Max)[2][10].\n\n- **Google Pixel 9 Pro XL** offers a solid camera and software experience with Google\u2019s Tensor G4 chip at a lower price point (~$900). For those seeking excellent value, the Pixel 9a offers impressive cameras and performance under $500 but is not a flagship competitor[2][4].\n\n### Marketplaces Overview:\n\n- **Amazon** typically offers slightly discounted flagship prices\u2014Samsung Galaxy S25 Ultra (256GB) found near $949.50, OnePlus 13 and other flagships similarly discounted[11][12].\n- **Carrier stores like T-Mobile** sometimes provide financing and promotional prices\u2014iPhone 16 starting near $830 with plans, Samsung Galaxy S25 varies but can approach MSRP or lower under contracts[10][11].\n- Other marketplaces (Best Buy, Walmart) generally align with Amazon and carrier pricing but may vary with bundles and seasonal promotions.\n\nIn summary, the premium flagship tier in 2025 centers around the Samsung Galaxy S25 Ultra and Apple iPhone 16 Pro Max, with Google\u2019s Pixel 9 Pro XL key as a powerful, slightly more affordable flagship alternative. Pricing varies but flagship devices routinely range from $900 to $1,300 in the US market, with discounts commonly available through Amazon and carriers[2][10][11][12].\n\n[1] https://www.youtube.com/watch?v=EYMe2jy-urg\n[2] https://www.zdnet.com/article/best-phone/\n[3] https://www.tomsguide.com/best-picks/best-phones\n[4] https://www.wired.com/story/best-cheap-phones/\n[5] https://www.techradar.com/news/best-phone\n[6] https://www.counterpointresearch.com/insight/top-10-bestselling-smartphones-q1-2025/\n[7] https://uptradeit.com/blog/what-iphones-will-stop-working\n[8] https://www.stuff.tv/features/best-phone/\n[9] https://www.youtube.com/watch?v=93wZbN9tecs\n[10] https://www.cnet.com/tech/mobile/best-phone/\n[11] https://www.pcmag.com/picks/the-best-phones\n[12] https://www.gsmarena.com/best_flagship_phones_buyers_guide-review-2027.php\n",
        "parse_status_code": 12000,
        "additional_results": {
          "images_results": [
            {
              "title": "Top Smartphones of 2025 with AI-Driven Features",
              "image_url": "https://img-cdn.thepublive.com/filters:format(webp)/industry-wired/media/media_files/2025/01/04/A9hU8NmTl0weavNM5Cmb.jpg",
              "image_from_url": "https://industrywired.com/ai/top-smartphones-of-2025-with-ai-driven-features-8590046"
            },
            {
              "title": "The best phone 2025: top smartphones in the US right now ...",
              "image_url": "https://cdn.mos.cms.futurecdn.net/CuSm3XePuDdXHxmbeoZF8M.jpg",
              "image_from_url": "https://www.techradar.com/news/best-phone"
            },
            {
              "title": "Best phones 2025 tested \u2014 Our top picks | Tom's Guide",
              "image_url": "https://cdn.mos.cms.futurecdn.net/M4nigVN3vvA5EEnNX9atxY.jpg",
              "image_from_url": "https://www.tomsguide.com/best-picks/best-phones"
            },
            {
              "title": "Best phones to buy in 2025 reviewed and ranked | Stuff",
              "image_url": "https://www.stuff.tv/wp-content/uploads/sites/2/2024/07/Best-smartphones-on-sale-2024-lead.jpg",
              "image_from_url": "https://www.stuff.tv/features/best-phone/"
            },
            {
              "title": "The best mid-range phones to buy in 2025 - PhoneArena",
              "image_url": "https://m-cdn.phonearena.com/images/article/133911-wide-two_1200/The-best-mid-range-phones-to-buy-in-2025.jpg",
              "image_from_url": "https://www.phonearena.com/news/best-mid-range-phones_id133911"
            },
            {
              "title": "The best smartphones of 2025, tried and tested \u2013 but are ...",
              "image_url": "https://www.telegraph.co.uk/content/dam/recommended/2025/05/20/TELEMMGLPICT000425244583_17477562398800_trans_NvBQzQNjv4BqqVzuuqpFlyLIwiB6NTmJwfSVWeZ_vEN7c6bHu2jJnT8.jpeg?imwidth=640",
              "image_from_url": "https://www.telegraph.co.uk/recommended/tech/best-smartphones/"
            },
            {
              "title": "Best Phones in 2025 | Top-Rated Smartphones and Cellphones ...",
              "image_url": "https://www.cnet.com/a/img/resize/b84fd97fe29bbe2ec4d397caf63db53bf8bea241/hub/2022/03/30/e841545d-e55c-47fc-b24a-003bf14e58c8/oneplus-10-pro-cnet-review-12.jpg?auto=webp&fit=crop&height=900&width=1200",
              "image_from_url": "https://www.cnet.com/tech/mobile/best-phone/"
            },
            {
              "title": "The 7 Best Smartphones to Buy in 2025 - Best Smartphone Reviews",
              "image_url": "https://hips.hearstapps.com/hmg-prod/images/best-smartphones-2025-67afc62def800.jpg?crop=0.503xw:0.671xh;0.338xw,0.218xh&resize=1120:*",
              "image_from_url": "https://www.bestproducts.com/tech/electronics/g60318873/best-smartphones/"
            },
            {
              "title": "Which Smartphones Are Most Popular in 2025? The Winner Might ...",
              "image_url": "https://i.pcmag.com/imagery/articles/00lQQsbajdRLVSbeeBwioC0-2.fit_lim.size_1050x.webp",
              "image_from_url": "https://www.pcmag.com/news/2025-smartphone-sales-rankings-reveal-a-surprise-leader-and-a-red-flag"
            }
          ],
          "sources_results": [
            {
              "url": "https://www.youtube.com/watch?v=EYMe2jy-urg",
              "title": "Top 5 BEST Smartphones of 2025\u2026 So Far - YouTube"
            },
            {
              "url": "https://www.zdnet.com/article/best-phone/",
              "title": "The best phones to buy in 2025 - ZDNET"
            },
            {
              "url": "https://www.tomsguide.com/best-picks/best-phones",
              "title": "Best phones 2025 tested \u2014 Our top picks | Tom's Guide"
            },
            {
              "url": "https://www.wired.com/story/best-cheap-phones/",
              "title": "8 Best Cheap Phones (2025), Tested and Reviewed - WIRED"
            },
            {
              "url": "https://www.techradar.com/news/best-phone",
              "title": "The best phone 2025: top smartphones in the US right now"
            },
            {
              "url": "https://www.counterpointresearch.com/insight/top-10-bestselling-smartphones-q1-2025/",
              "title": "iPhone 16 Leads Global Smartphone Sales in Q1 2025"
            },
            {
              "url": "https://uptradeit.com/blog/what-iphones-will-stop-working",
              "title": "What iPhones Will Stop Working in 2025 - UpTrade"
            },
            {
              "url": "https://www.stuff.tv/features/best-phone/",
              "title": "Best phones to buy in 2025 reviewed and ranked - Stuff"
            },
            {
              "url": "https://www.youtube.com/watch?v=93wZbN9tecs",
              "title": "Best Phones of 2025 (so far) | Mid-Range, Camera, Gaming & More"
            },
            {
              "url": "https://www.cnet.com/tech/mobile/best-phone/",
              "title": "Best Phones in 2025 | Top-Rated Smartphones and ... - CNET"
            },
            {
              "url": "https://www.pcmag.com/picks/the-best-phones",
              "title": "The Best Phones We've Tested (July 2025) - PCMag"
            },
            {
              "url": "https://www.gsmarena.com/best_flagship_phones_buyers_guide-review-2027.php",
              "title": "Best flagship phones 2025 - buyer's guide - GSMArena.com tests"
            }
          ]
        }
      },
      "created_at": "2025-07-16 12:14:32",
      "updated_at": "2025-07-16 12:15:28",
      "page": 1,
      "url": "https://www.perplexity.ai/search/top-3-smartphones-in-2025-comp-wvA0dso7TgW3NpgF8Jd8tg",
      "job_id": "7351222707934990337",
      "is_render_forced": false,
      "status_code": 200,
      "parser_type": "perplexity",
      "parser_preset": null
    }
  ]
}
```

</details>

## 输出数据字典

### **HTML 示例**

<div data-full-width="false"><figure><img src="https://2655358775-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzrXw45naRpCZ0Ku9AjY1%2Fuploads%2FFG1veyxj4ecJGmGr2729%2Fhtml_sample.png?alt=media&#x26;token=7cda7a48-eaf4-4479-ab22-18a028cb4ff9" alt=""><figcaption></figcaption></figure></div>

### **JSON 结构**

结构化 `perplexity` 输出包括诸如以下的字段 `url`, `model`, `answer_results`等。下表分解了我们解析的页面元素，以及描述、数据类型和相关元数据。

{% hint style="info" %}
特定结果类型的项数和字段可能会根据提交的提示而变化。
{% endhint %}

<table><thead><tr><th width="340.171875">字段</th><th width="300.19921875">描述</th><th width="105.93359375">类型</th></tr></thead><tbody><tr><td><code>url</code></td><td>Perplexity 对话的 URL。</td><td>字符串</td></tr><tr><td><code>page</code></td><td>页码。</td><td>整数</td></tr><tr><td><code>content</code></td><td>包含解析后 Perplexity 页面数据的对象。</td><td>对象</td></tr><tr><td><code>model</code></td><td>用于生成答案的 Perplexity 模型。</td><td>字符串</td></tr><tr><td><code>prompt_query</code></td><td>提交给 Perplexity 的原始提示。</td><td>字符串</td></tr><tr><td><code>displayed_tabs</code></td><td>Perplexity 界面中显示的标签（例如，购物、图片）。</td><td>列表</td></tr><tr><td><code>answer_results</code></td><td>包含文本或嵌套内容的完整 Perplexity 响应。</td><td>列表 或 字符串</td></tr><tr><td><code>answer_results_md</code></td><td>以 Markdown 格式呈现的完整答案。</td><td>字符串</td></tr><tr><td><code>related_queries</code></td><td>与主提示相关的查询列表。</td><td>列表</td></tr><tr><td><code>top_images</code></td><td>包含标题和 URL 的热门图片列表。</td><td>数组</td></tr><tr><td><code>inline_products</code></td><td>包含标题、价格、链接和其他元数据的内联产品列表。</td><td>数组</td></tr><tr><td><code>additional_results.hotels_results</code></td><td>包含标题、URL、地址和其他酒店详情的酒店列表。</td><td>数组</td></tr><tr><td><code>additional_results.places_results</code></td><td>包含标题、URL、坐标和其他元数据的地点列表。</td><td>数组</td></tr><tr><td><code>additional_results.videos_results</code></td><td>包含缩略图、标题、URL 和来源的视频列表。</td><td>数组</td></tr><tr><td><code>additional_results.shopping_results</code></td><td>包含标题、价格、URL 和其他产品元数据的购物商品列表。</td><td>数组</td></tr><tr><td><code>additional_results.sources_results</code></td><td>包含引用来源及其标题和 URL 的列表。</td><td>数组</td></tr><tr><td><code>additional_results.images_results</code></td><td>包含标题、图片 URL 和来源页面 URL 的相关图片列表。</td><td>数组</td></tr><tr><td><code>parse_status_code</code></td><td>解析操作的状态码。</td><td>整数</td></tr><tr><td><code>created_at</code></td><td>创建该爬取任务的时间戳。</td><td>timestamp</td></tr><tr><td><code>updated_at</code></td><td>爬取任务完成的时间戳。</td><td>timestamp</td></tr><tr><td><code>job_id</code></td><td>与该爬取任务关联的任务 ID。</td><td>字符串</td></tr><tr><td><code>geo_location</code></td><td>提交请求时使用的代理位置。</td><td>字符串</td></tr><tr><td><code>status_code</code></td><td>爬取任务的状态码。你可以查看描述爬虫状态码的说明 <a href="../response-codes"><strong>here</strong></a>.</td><td>整数</td></tr><tr><td><code>parser_type</code></td><td>用于解析 HTML 内容的解析器类型。</td><td>字符串</td></tr></tbody></table>

### 附加结果和内联产品

除了主要的 AI 响应外，我们还在 `additional_results`下返回额外数据，例如

* `images_results`
* `sources_results`
* `shopping_results`
* `videos_results`
* `places_results`
* `hotels_results`

这些数组从原始结果页面的选项卡中提取，只有在存在相关内容时才包含：

<figure><img src="https://2655358775-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzrXw45naRpCZ0Ku9AjY1%2Fuploads%2FACAmb9aCbmit0FySHZGA%2Fadditiona_results.png?alt=media&#x26;token=8c6f8fc5-115c-44bb-9ac3-a6edf16bc112" alt=""><figcaption></figcaption></figure>

此外， `inline_products` 数组包含直接嵌入在响应中的产品：

<figure><img src="https://2655358775-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzrXw45naRpCZ0Ku9AjY1%2Fuploads%2FWIff7QrPjp7iTJeWJBlG%2Finline.png?alt=media&#x26;token=dbd2cb71-309d-476c-b59c-5c82ee327073" alt=""><figcaption></figcaption></figure>
