Perplexity API
The Perplexity API provides real-time access to Perplexity's AI-generated answers, returning structured text blocks, generated markdown, and cited reference links.
API Parameters
Search Query
-
- Name
-
q - Required
- Required
- Description
-
This parameter is used for the terms you want to ask Perplexity. The answer is returned in the same language as your query - for example, queries in German will receive answers in German, queries in Spanish will receive answers in Spanish.
Sources
-
- Name
-
sources - Required
- Optional
- Description
-
Comma-separated list of source connectors Perplexity searches. Defaults to
web. Supported values are:web- General web results.scholar- Academic papers and journals.
sources=web,scholar.
Engine
-
- Name
-
engine - Required
- Required
- Description
-
Parameter defines an engine that will be used to retrieve real-time data. It must be set to
perplexity.
API key
-
- Name
-
api_key - Required
- Required
- Description
-
The
api_keyauthenticates your requests. Use it as a query parameter (https://www.searchapi.io/api/v1/search?api_key=YOUR_API_KEY) or in the Authorization header (Bearer YOUR_API_KEY).
Zero Data Retention
-
- Name
-
zero_retention - Enterprise Only
- Enterprise Only
- Required
- Optional
- Description
-
Set this parameter to
trueto disable all logging and persistent storage. No request parameters, HTML, or JSON responses are stored or logged. Suitable for high-compliance use cases. Debugging and support may be limited while enabled.
API Examples
Full Response
-
text_blocks - The answer as typed blocks:
paragraph,header,unordered_list/ordered_listwith nesteditems,table, andcode_blocks. Each block carries its prose inanswer.
A block adds zero-basedreference_indexesintoreference_linkswhen the answer cites sources inline, so treat that key as optional. - markdown - The same answer as a single markdown string.
-
reference_links - The full source list. Each link carries
index,title,link, andsource, plus an optionalsnippet, ISO 8601date, andthumbnail. -
response_metadata - The answering
modeland thesearch_implementation_modeused to ground the answer. -
related_questions - Suggested follow-ups, each carrying a
question. -
search_queries - The queries the answer was grounded on. Returned only
under
search_implementation_mode: fast; Perplexity currently grounds every answer inmulti_step, so this key is not returned today. -
cards - Returned for widget-style queries, each discriminated by its
type.
Aweathercard carrieslocation,currentconditions, and a dailyforecast.
Afinancecard carries the quote (symbol,price,change_percent), trading stats, andsecurity_type.
Any other widget type falls back to a raw card preserving the provider payload underraw.
https://www.searchapi.io/api/v1/search?engine=perplexity&q=what+are+the+main+differences+between+http+2+and+http+3
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "perplexity",
"q": "what are the main differences between http 2 and http 3"
}
response = requests.get(url, params=params)
print(response.text)
{
"search_metadata": {
"id": "search_Qh7vN2rXmKdBpLwT9sYcF4jZ",
"status": "Success",
"created_at": "2026-07-29T12:00:00Z",
"request_time_taken": 7.31,
"parsing_time_taken": 0.02,
"total_time_taken": 7.33,
"request_url": "https://www.perplexity.ai/search?q=what+are+the+main+differences+between+http+2+and+http+3",
"html_url": "https://www.searchapi.io/api/v1/searches/search_Qh7vN2rXmKdBpLwT9sYcF4jZ.html",
"json_url": "https://www.searchapi.io/api/v1/searches/search_Qh7vN2rXmKdBpLwT9sYcF4jZ"
},
"search_parameters": {
"engine": "perplexity",
"q": "what are the main differences between http 2 and http 3"
},
"text_blocks": [
{
"type": "paragraph",
"answer": "Here are the main differences between HTTP/2 and HTTP/3:"
},
{
"type": "unordered_list",
"items": [
{
"type": "paragraph",
"answer": "Transport protocol HTTP/2 runs over TCP. HTTP/3 runs over QUIC (which itself uses UDP)."
},
{
"type": "paragraph",
"answer": "Head-of-line blocking HTTP/2 can experience head-of-line blocking at the TCP level, where a lost packet blocks all streams on the connection. HTTP/3 eliminates this by using QUIC with independent streams."
},
{
"type": "paragraph",
"answer": "Connection establishment and security HTTP/2 uses TLS over TCP (TLS is negotiated as an independent layer). HTTP/3 integrates security into QUIC, making encryption and connection setup happen together, with TLS 1.3 mandated."
},
{
"type": "paragraph",
"answer": "Multiplexing HTTP/2 supports multiplexing multiple streams over a single TCP connection, but still shares the same transport; performance can degrade if packet loss occurs. HTTP/3 multiplexes streams over QUIC, allowing independent streams with less cross-stream interference."
},
{
"type": "paragraph",
"answer": "Connection migration HTTP/3/QUIC supports seamless connection migration (e.g., changing networks or IP addresses) without dropping the session. HTTP/2 does not natively support this without rebuilding a new connection."
},
{
"type": "paragraph",
"answer": "Protocol standards and naming HTTP/2 is defined in RFC 9113. HTTP/3 is defined in RFC 9114 and is designed to supersede HTTP/2 on many fronts."
},
{
"type": "paragraph",
"answer": "Performance characteristics HTTP/3 generally offers lower latency and faster page loads on lossy or mobile networks due to independent streams and faster handshake, though real-world results depend on network conditions, endpoints, and middleboxes."
},
{
"type": "paragraph",
"answer": "Deployment considerations HTTP/3 requires QUIC support in both client and server and may pass through or be affected by NATs and middleboxes differently than TCP-based HTTP/2. Some networks and proxies may delay or block QUIC initially, impacting early adoption."
}
]
},
{
"type": "paragraph",
"answer": "Illustration of the core shift:"
},
{
"type": "unordered_list",
"items": [
{
"type": "paragraph",
"answer": "HTTP/2 → many streams over one TCP connection; robust but vulnerable to HOL blocking if packets are lost."
},
{
"type": "paragraph",
"answer": "HTTP/3 → streams over QUIC (UDP-based), with independent loss handling, faster handshakes, and built-in security, plus smoother migration across networks."
}
]
},
{
"type": "paragraph",
"answer": "If you want, I can tailor this to your use case (e.g., for a website, a mobile app, or a CDN) and highlight actionable steps to migrate or test performance."
}
],
"response_metadata": {
"model": "turbo",
"search_implementation_mode": "multi_step",
"backend_uuid": "2e8a64dc-6d74-416a-8e68-75445b67c239",
"context_uuid": "b580a1ff-671c-49e2-bb00-081ebceec248",
"read_write_token": "a3245d4e-762f-454f-8a73-100368400997"
},
"related_questions": [
{
"question": "How does HTTP/3 improve latency over HTTP/2"
},
{
"question": "What is QUIC and why is it used in HTTP/3"
},
{
"question": "HTTP/2 vs HTTP/3: header compression differences"
},
{
"question": "Is HTTP/3 backward compatible with HTTP/2 servers"
},
{
"question": "What are the security implications of HTTP/3"
}
],
"markdown": "Here are the main differences between HTTP/2 and HTTP/3:\n\n- Transport protocol\n - HTTP/2 runs over TCP. HTTP/3 runs over QUIC (which itself uses UDP).\n- Head-of-line blocking\n - HTTP/2 can experience head-of-line blocking at the TCP level, where a lost packet blocks all streams on the connection. HTTP/3 eliminates this by using QUIC with independent streams.\n- Connection establishment and security\n - HTTP/2 uses TLS over TCP (TLS is negotiated as an independent layer). HTTP/3 integrates security into QUIC, making encryption and connection setup happen together, with TLS 1.3 mandated.\n- Multiplexing\n - HTTP/2 supports multiplexing multiple streams over a single TCP connection, but still shares the same transport; performance can degrade if packet loss occurs. HTTP/3 multiplexes streams over QUIC, allowing independent streams with less cross-stream interference.\n- Connection migration\n - HTTP/3/QUIC supports seamless connection migration (e.g., changing networks or IP addresses) without dropping the session. HTTP/2 does not natively support this without rebuilding a new connection.\n- Protocol standards and naming\n - HTTP/2 is defined in RFC 9113. HTTP/3 is defined in RFC 9114 and is designed to supersede HTTP/2 on many fronts.\n- Performance characteristics\n - HTTP/3 generally offers lower latency and faster page loads on lossy or mobile networks due to independent streams and faster handshake, though real-world results depend on network conditions, endpoints, and middleboxes.\n- Deployment considerations\n - HTTP/3 requires QUIC support in both client and server and may pass through or be affected by NATs and middleboxes differently than TCP-based HTTP/2. Some networks and proxies may delay or block QUIC initially, impacting early adoption.\n\nIllustration of the core shift:\n\n- HTTP/2 → many streams over one TCP connection; robust but vulnerable to HOL blocking if packets are lost.\n- HTTP/3 → streams over QUIC (UDP-based), with independent loss handling, faster handshakes, and built-in security, plus smoother migration across networks.\n\nIf you want, I can tailor this to your use case (e.g., for a website, a mobile app, or a CDN) and highlight actionable steps to migrate or test performance.",
"reference_links": [
{
"title": "HTTP/2 vs HTTP/3: A Comparison",
"link": "https://ably.com/topic/http-2-vs-http-3",
"source": "ably.com",
"snippet": "A deep dive into the similarities and differences between HTTP/2 and HTTP/3, including strengths, weaknesses, the past, and the future.",
"date": "2024-11-15T00:00:00",
"thumbnail": "https://d2u1z1lopyfwlx.cloudfront.net/thumbnails/8f97b5b5-5a67-5156-a93c-ba464a537806/3cb059b3-e901-51c5-8425-e794cb6c299b.jpg",
"images": [
"https://d2u1z1lopyfwlx.cloudfront.net/thumbnails/8f97b5b5-5a67-5156-a93c-ba464a537806/3cb059b3-e901-51c5-8425-e794cb6c299b.jpg"
],
"trust": {
"level": 2,
"label": "trusted",
"description": "is trusted for official product information and technical documentation about Ably’s realtime messaging platform and developer-focused APIs and SDKs."
},
"index": 0
},
{
"title": "How This Applies In Practice",
"link": "https://www.azion.com/en/learning/performance/http2-vs-http3/",
"source": "azion.com",
"snippet": "Learn the differences between HTTP/2 and HTTP/3, how each protocol works, and when to use them for better web performance. Understand multiplexing, QUIC, head-of-line blocking, TLS 1.3, connection migration, and how HTTP/3 improves latency and reliability on modern networks.",
"thumbnail": "https://anp9wamula0.map.azionedge.net/?title=HTTP%2F2%20vs%20HTTP%2F3&subtitle=Learn%20the%20differences%20between%20HTTP%2F2%20and%20HTTP%2F3%2C%20how%20each%20protocol%20works%2C%20and%20when%20to%20use%20them%20for%20better%20web%20performance.%20Understand%20multiplexing%2C%20QUIC%2C%20head-of-line%20blocking%2C%20TLS%201.3%2C%20connection%20migration%2C%20and%20how%20HTTP%2F3%20improves%20latency%20and%20reliability%20on%20modern%20networks.&type=dotGrid",
"images": [
"https://anp9wamula0.map.azionedge.net/?title=HTTP%2F2%20vs%20HTTP%2F3&subtitle=Learn%20the%20differences%20between%20HTTP%2F2%20and%20HTTP%2F3%2C%20how%20each%20protocol%20works%2C%20and%20when%20to%20use%20them%20for%20better%20web%20performance.%20Understand%20multiplexing%2C%20QUIC%2C%20head-of-line%20blocking%2C%20TLS%201.3%2C%20connection%20migration%2C%20and%20how%20HTTP%2F3%20improves%20latency%20and%20reliability%20on%20modern%20networks.&type=dotGrid"
],
"trust": {
"level": 2,
"label": "trusted",
"description": "is trusted for first-party technical, product, and security information about Azion’s edge computing and CDN services, mainly for Brazilian and global enterprise users."
},
"index": 1
},
{
"title": "HTTP vs. HTTP/2 vs. HTTP/3: What's the Difference?",
"link": "https://www.pubnub.com/blog/http-vs-http-2-vs-http-3-whats-the-difference/",
"source": "pubnub.com",
"snippet": "Let's explore HTTP, HTTP/2, and HTTP/3",
"date": "2023-11-06T00:00:00",
"thumbnail": "https://www.pubnub.com/og/?text=HTTP/1%20vs%20HTTP/2%20vs%20HTTP/3%20-%20Technical%20Comparison&style=blue&img=7",
"images": [
"https://www.pubnub.com/og/?text=HTTP/1%20vs%20HTTP/2%20vs%20HTTP/3%20-%20Technical%20Comparison&style=blue&img=7"
],
"trust": {
"level": 2,
"label": "trusted",
"description": "is trusted for official technical, product, and corporate information about PubNub’s real-time communication and interactive app platform."
},
"index": 2
},
{
"title": "HTTP/2 vs. HTTP/3",
"link": "https://www.logicmonitor.com/deep-dive/http3-vs-http2/introduction",
"source": "logicmonitor.com",
"snippet": "HTTP/3 uses QUIC protocol to eliminate head-of-line blocking and reduce latency compared to HTTP/2. Compare protocols, multiplexing, security, and performance.",
"date": "2026-07-22T00:00:00",
"thumbnail": "https://d2u1z1lopyfwlx.cloudfront.net/thumbnails/14a7fc6c-89ff-55f7-9e7a-e68a92075e9b/26ea1a47-62e6-5687-a970-8ef4d3d0fcbb.jpg",
"images": [
"https://d2u1z1lopyfwlx.cloudfront.net/thumbnails/14a7fc6c-89ff-55f7-9e7a-e68a92075e9b/26ea1a47-62e6-5687-a970-8ef4d3d0fcbb.jpg"
],
"trust": {
"level": 2,
"label": "trusted",
"description": "is trusted for first-party technical, security, and corporate information about LogicMonitor’s observability and IT monitoring services."
},
"index": 3
},
{
"title": "HTTP 2 vs HTTP 3: What's the Difference? | Nikki Siapno ...",
"link": "https://www.linkedin.com/posts/nikkisiapno_http-2-vs-http-3-whats-the-difference-activity-7374770177235857408-uq2g",
"source": "linkedin.com",
"snippet": "HTTP 2 vs HTTP 3 — What's the Difference? • 1996 → HTTP 1 • 1997 → HTTP 1.1 • 2015 → HTTP 2 • 2022 → HTTP 3 But what’s the difference? Starting at the foundation: 🔹 𝗛𝗧𝗧𝗣 𝟭.𝟭: ☑ 𝗣𝗲𝗿𝘀𝗶𝘀𝘁𝗲𝗻𝘁 𝗰𝗼𝗻𝗻𝗲𝗰𝘁𝗶𝗼𝗻𝘀 — Reuses connections instead of opening new ones ☑ 𝗖𝗵𝘂𝗻𝗸𝗲𝗱 𝘁𝗿𝗮𝗻𝘀𝗳𝗲𝗿𝘀 — Sends data in parts instead of waiting for the full response ☑ 𝗜𝗺𝗽𝗿𝗼𝘃𝗲𝗱 𝗰𝗮𝗰𝗵𝗶𝗻𝗴 — Introduced headers for better caching and connection management 🅇 𝗦𝗲𝗾𝘂𝗲𝗻𝘁𝗶𝗮𝗹 𝗿𝗲𝗾𝘂𝗲𝘀𝘁𝘀 — Requests block each other (HoL blocking at the request...",
"date": "2025-09-19T00:00:00",
"thumbnail": "https://d2u1z1lopyfwlx.cloudfront.net/thumbnails/04e11155-390a-5763-a1b0-43aa37ad090e/e1552eaa-b7d1-56e6-a296-59dbf0e1db7d.jpg",
"images": [
"https://d2u1z1lopyfwlx.cloudfront.net/thumbnails/04e11155-390a-5763-a1b0-43aa37ad090e/e1552eaa-b7d1-56e6-a296-59dbf0e1db7d.jpg"
],
"trust": {
"level": 1,
"label": "credible",
"description": "is credible for global professional networking and job-related services operated as a Microsoft-owned platform based in the United States."
},
"index": 4
},
{
"title": "What is HTTP/3? How it is Different From HTTP/2?",
"link": "https://www.geeksforgeeks.org/computer-networks/what-is-http-3-how-it-is-different-from-http-2/",
"source": "geeksforgeeks.org",
"snippet": "Your All-in-One Learning Portal: GeeksforGeeks is a comprehensive educational platform that empowers learners across domains-spanning computer science and programming, school education, upskilling, commerce, software tools, competitive exams, and more.",
"date": "2024-03-18T00:00:00",
"thumbnail": "https://d2u1z1lopyfwlx.cloudfront.net/thumbnails/235fcf6e-183e-525d-b93d-86c0a1433055/8ae81ef5-e94b-5660-bf9a-206df4c487a4.jpg",
"images": [
"https://d2u1z1lopyfwlx.cloudfront.net/thumbnails/235fcf6e-183e-525d-b93d-86c0a1433055/8ae81ef5-e94b-5660-bf9a-206df4c487a4.jpg"
],
"trust": {
"level": 1,
"label": "credible",
"description": "is credible for large-scale Indian programming and computer science education content and interview preparation used by students and developers worldwide."
},
"index": 5
},
{
"title": "HTTP/2 vs HTTP/3: Improving Web Performance",
"link": "https://www.oshyn.com/blog/http2-vs-http3-performance",
"source": "oshyn.com",
"snippet": "Learn the key differences between HTTP/2 and HTTP/3, how QUIC enhances speed and reliability, and why upgrading can improve web performance and security.",
"date": "2025-02-28T00:00:00",
"thumbnail": "https://media2.oshyn.com/-/media/Oshyn/Insights/Blog/2025-02-28-Improving-Web-Performance/blog_thumb_improving-web-performance-http.jpg?rev=77d1085fb61b4266bf0fc45002d2c45b&hash=B2939EBEC822D98E75F787BFA28A7428",
"images": [
"https://media2.oshyn.com/-/media/Oshyn/Insights/Blog/2025-02-28-Improving-Web-Performance/blog_thumb_improving-web-performance-http.jpg?rev=77d1085fb61b4266bf0fc45002d2c45b&hash=B2939EBEC822D98E75F787BFA28A7428"
],
"trust": {
"level": 1,
"label": "credible",
"description": "is credible for information about a U.S. digital experience implementation agency’s services, tools, and case-study style insights"
},
"index": 6
},
{
"title": "HTTP/3 vs HTTP/2 Performance: Is the Upgrade Worth It?",
"link": "https://www.debugbear.com/blog/http3-vs-http2-performance",
"source": "debugbear.com",
"snippet": "Compare HTTP/3 vs HTTP/2 performance. Learn how factors like distance, network quality, and connection reuse affect the upgrade's impact on page speed.",
"date": "2026-04-15T00:00:00",
"thumbnail": "https://d2u1z1lopyfwlx.cloudfront.net/thumbnails/03c41598-d23a-58ff-959a-dac8066fe506/a03d6e9b-a781-5f74-98b9-44fef8912c82.jpg",
"images": [
"https://d2u1z1lopyfwlx.cloudfront.net/thumbnails/03c41598-d23a-58ff-959a-dac8066fe506/a03d6e9b-a781-5f74-98b9-44fef8912c82.jpg"
],
"trust": {
"level": 1,
"label": "credible",
"description": "is credible for vendor-hosted web performance metrics, Core Web Vitals monitoring features, and related technical documentation about its own tools and methodology."
},
"index": 7
},
{
"title": "HTTP/2 vs HTTP/3: What Every Web Server Owner Needs to Know ...",
"link": "https://runcloud.io/blog/http2-vs-http3",
"source": "runcloud.io",
"snippet": "HTTP/3 was engineered specifically to address the structural limitations of TCP that degrade performance on mobile devices, in high-latency connections, and",
"date": "2026-04-21T00:00:00",
"thumbnail": "https://d2u1z1lopyfwlx.cloudfront.net/thumbnails/4204f7a2-defb-5c93-bf7d-243e0872feb5/9e5a0153-c34e-5d43-b621-61a5aaa9e5cf.jpg",
"images": [
"https://d2u1z1lopyfwlx.cloudfront.net/thumbnails/4204f7a2-defb-5c93-bf7d-243e0872feb5/9e5a0153-c34e-5d43-b621-61a5aaa9e5cf.jpg"
],
"trust": {
"level": 1,
"label": "credible",
"description": "is credible for first-party product, pricing, and documentation information about RunCloud’s cloud server management platform, though content is commercial rather than neutral."
},
"index": 8
},
{
"title": "Comparing HTTP/3 vs. HTTP/2 Performance",
"link": "https://blog.cloudflare.com/http-3-vs-http-2/",
"source": "blog.cloudflare.com",
"snippet": "We announced support for HTTP/3, the successor to HTTP/2, during Cloudflare’s birthday week last year. Our goal is and has always been to help build a better Internet. Even though HTTP/3 is still in draft status, we've seen a lot of interest from our users.",
"date": "2026-07-15T00:00:00",
"thumbnail": "https://d2u1z1lopyfwlx.cloudfront.net/thumbnails/dedf20bc-e5ac-5a40-bcb8-adb2a259978a/03026f12-453b-5750-9e7f-18b070264f40.jpg",
"images": [
"https://d2u1z1lopyfwlx.cloudfront.net/thumbnails/dedf20bc-e5ac-5a40-bcb8-adb2a259978a/03026f12-453b-5750-9e7f-18b070264f40.jpg"
],
"index": 9
}
]
}