Duck AI API
Our Duck AI API (DuckDuckGo AI Chat API) allows you to scrape answers from Duck AI, DuckDuckGo's private AI chat. The API returns the answer as text blocks (paragraphs, headings, lists, tables, and code blocks), the sources Duck AI cites, the related searches it suggests, and the full answer in markdown.
Choose the AI model answering the prompt with the model parameter, and continue a conversation with the subsequent_request_token returned by each search.
The API endpoint is https://serpapi.com/search?engine=duck_ai
Head to the playground for a live and interactive demo.
API Parameters
Advanced Parameters
model
Optional
Parameter defines the AI model that answers the prompt. It can be set to:gpt-5.6-luna - GPT-5.6 Lunagpt-6-luna - GPT-6 Lunagpt-5.4-mini - GPT-5.4 miniclaude-haiku-4-5 - Claude Haiku 4.5mistral-small-2603 - Mistral Small 4tinfoil/gpt-oss-120b - gpt-oss 120Btinfoil/gemma4-31b - Gemma 4 31B
It defaults to gpt-5.6-luna.
Subsequent Request
subsequent_request_token
Optional
Parameter defines the token used to continue a Duck AI conversation. Pass this token with a new q to send a follow-up prompt that includes the previous prompts and answers as context (multi-turn).
The token is returned by SerpApi from your previous request using our Duck AI API.
The token holds the whole conversation, so it grows with each turn. Conversations longer than about 16,000 characters (prompts and answers combined) can't be continued: the request becomes too long and is rejected.
Serpapi Parameters
no_cache
Optional
Parameter will force SerpApi to fetch the Duck AI results even if a cached version is already present. A cache is served only if the query and all parameters are exactly the same. Cache expires after 1h. Cached searches are free, and are not counted towards your searches per month. It can be set to false (default) to allow results from the cache, or true to disallow results from the cache. no_cache and async parameters should not be used together.
async
Optional
Parameter defines the way you want to submit your search to SerpApi. It can be set to false (default) to open an HTTP connection and keep it open until you got your search results, or true to just submit your search to SerpApi and retrieve them later. In this case, you'll need to use our Searches Archive API to retrieve your results. async and no_cache parameters should not be used together. async should not be used on accounts with Ludicrous Speed enabled.
zero_trace
Optional
Enterprise only. Parameter enables ZeroTrace mode. It can be set to false (default) or true. Enable this mode to skip storing search parameters, search files, and search metadata on our servers. This may make debugging more difficult.
output
Optional
Parameter defines the format of the result. It can be set to json (default) to get a structured JSON of the results, html to get the raw HTML retrieved, or md to get a markdown-formatted version optimized for LLMs and AI agents.
json_restrictor
Optional
Parameter defines the fields you want to include in the output, reducing payload size for faster response. See the JSON Restrictor documentation for more details.
API Results
JSON Results
JSON output includes structured data for text_blocks, references, related_searches, markdown, and more.
A search status is accessible through search_metadata.status.
It flows this way: Processing -> Success || Error.
If a search has failed, error will contain an error message.
search_metadata.id is the search ID inside SerpApi.
HTML Results
This API does not have a full HTML response, only text.
search_metadata.prettify_html_file contains a link to the prettified version of the result.
It is displayed in the playground.
Markdown Results
Markdown output is optimized for LLMs and AI agents. It provides most of the same informational content as JSON
in a token-efficient format using tables, markdown links, and YAML frontmatter.
To access, use the output=md parameter, the /search.md endpoint, or request header Accept: text/markdown.
API Examples
Example with q: where does coffee grow?
When Duck AI searches the web to answer, it cites its sources: reference_indexes of a text block point to the references it cites. Duck AI shows the cited references under "Read More".
{
"text_blocks": [
{
"type": "paragraph",
"snippet": "Coffee grows mainly in the “Coffee Belt,” a tropical region around the equator, roughly between the Tropics of Cancer and Capricorn. It includes parts of:",
"snippet_highlighted_words": ["“Coffee Belt,”"]
},
{
"type": "list",
"list": [
{
"snippet": "Central and South America: Brazil, Colombia, Guatemala, Mexico, Peru, Costa Rica",
"snippet_highlighted_words": ["Central and South America:"]
},
{
"snippet": "Africa: Ethiopia, Kenya, Uganda, Tanzania, Rwanda",
"snippet_highlighted_words": ["Africa:"]
},
...
]
},
{
"type": "paragraph",
"snippet": "Coffee plants prefer warm, frost-free climates, seasonal rainfall, rich soil, and often some shade. Arabica is usually grown in cooler, higher-altitude areas, while Robusta tolerates hotter, lower elevations. Brazil is currently the largest coffee producer, followed by Vietnam, Colombia, Indonesia, and Ethiopia.",
"snippet_highlighted_words": ["Arabica", "Robusta"],
"reference_indexes": [0, 3]
}
],
"references": [
{
"title": "List of countries by coffee production - Wikipedia",
"link": "https://en.wikipedia.org/wiki/List_of_countries_by_coffee_production",
"source": "Wikipedia",
"source_icon": "https://external-content.duckduckgo.com/ip3/en.wikipedia.org.ico",
"index": 0
},
{
"title": "Where Does Coffee Grow? Coffee Belt, Countries and Climate",
"link": "https://www.onlinecoffeeguide.com/guides/where-coffee-grows",
"source": "onlinecoffeeguide.com",
"source_icon": "https://external-content.duckduckgo.com/ip3/www.onlinecoffeeguide.com.ico",
"date": "December 19, 2025",
"index": 1
},
...
],
"related_searches": [
{
"query": "largest coffee-producing countries",
"link": "https://duckduckgo.com/?q=largest+coffee-producing+countries&t=duck_ai",
"serpapi_link": "https://serpapi.com/search.json?engine=duckduckgo&kl=us-en&q=largest+coffee-producing+countries"
},
{
"query": "Arabica vs Robusta coffee growing regions",
"link": "https://duckduckgo.com/?q=Arabica+vs+Robusta+coffee+growing+regions&t=duck_ai",
"serpapi_link": "https://serpapi.com/search.json?engine=duckduckgo&kl=us-en&q=Arabica+vs+Robusta+coffee+growing+regions"
},
...
],
"markdown": "Coffee grows mainly in the **“Coffee Belt,”** a tropical region around the equator, roughly between the Tropics of Cancer and Capricorn. It includes parts of:\n\n- **Central and South America:** Brazil, Colombia, Guatemala, Mexico, Peru, Costa Rica\n- **Africa:** Ethiopia, Kenya, Uganda, Tanzania, Rwanda\n- **Asia and the Pacific:** Vietnam, Indonesia, India, Laos, Papua New Guinea\n- **Other areas:** Hawaii and Yemen\n\nCoffee plants prefer warm, frost-free climates, seasonal rainfall, rich soil, and often some shade. **Arabica** is usually grown in cooler, higher-altitude areas, while **Robusta** tolerates hotter, lower elevations. Brazil is currently the largest coffee producer, followed by Vietnam, Colombia, Indonesia, and Ethiopia. [0] [3]\n\n### References\n\n[0] [List of countries by coffee production - Wikipedia](https://en.wikipedia.org/wiki/List_of_countries_by_coffee_production)\n[1] [Where Does Coffee Grow? Coffee Belt, Countries and Climate](https://www.onlinecoffeeguide.com/guides/where-coffee-grows)\n[2] [Where Can Coffee Beans Grow? Mapping the Coffee Belt](https://biologyinsights.com/where-can-coffee-beans-grow-mapping-the-coffee-belt/)\n[3] [Coffee regions of the world - NCA - About Coffee](https://www.aboutcoffee.org/origins/coffee-regions-of-the-world/)\n[4] [Coffee Production Around the World: Uncovering the Major ...](https://coffeeplusthree.com/where-is-most-of-the-coffee-grown-in-the-world/)",
"subsequent_request_token": "oF3KRnicTVLLjtNAEJQ45iv6HDn5gL2g3QjBitcqLEgcO3Y7Hmk8bXrGmOxp-QQ4w5Fv4F847oXfoNrJKpzGnumqrq7qr7_KaCl_-_576sSEGpVMtbatCO1Np6d_nvzdnH8z9RxSPFBIVDqh5fLh_sfp_UpiqR7ufy6XxFRMh1BzJJN90ERsOqZmxsinkYtaRbjad-DaSZlEjoS3My6TtrThVIsRA7bhwUKtltZ0XdC7jmMDnQNb8dKLxWIFKRtJxdDSEe90LB1d9gIcX0DSlfFdiBVtNGq_C1zRc8iQniM-X8sX0Fd0IzZ6SS5MWwBn2sv2keNZ6QLkAfBS0gHH-z164bzldMfJH7aT3xxxOfCsxee64Tq0oXaWD0FK4r6i69RokuwwfPrxijVDBQ8j0xuZIDEkObK9BQvMMOHsJC944hBm-o_SS1osTikMkRNMGUxa1E9saNQaJlq1huc6hh5jo0sGkyZPCIm2HOEN5uwoq9vkxNoWpJK1F8odN7L2oYx3cAMKQqYxj8Ad5s1IvhK1ahQk24U91K44llCQ1FF2RVMXou_MVncjLAZJ8XrXQ52W4tCoE3RLlM9csDh5fUrO-9WjGTJGR7c0su0ll8dtHUybsXaKVqOzNLQ7nM0-5_6f7T7lY6jrf6txEbY",
...
}
Example with model: claude-haiku-4-5
{
"text_blocks": [
{
"type": "heading",
"snippet": "Making Cold Brew Coffee"
},
{
"type": "paragraph",
"snippet": "Cold brew is simple to make — you just steep coarsely ground coffee in cold water for 12–24 hours, then strain it. Here's how:",
"snippet_highlighted_words": ["Cold brew is simple to make"]
},
{
"type": "heading",
"snippet": "Ingredients and Equipment"
},
...
],
"markdown": "## Making Cold Brew Coffee\n\n**Cold brew is simple to make** — you just steep coarsely ground coffee in cold water for 12–24 hours, then strain it. Here's how:\n\n### Ingredients and Equipment\n- **Coarsely ground coffee** (not fine grounds, which will over-extract and taste bitter)\n- **Cold water** (filtered or tap)\n- A **jar or container** (any size works)\n- A **fine-mesh strainer, cheesecloth, or coffee filter** for straining\n- Optional: **paper towels** or **coffee filters** for extra filtration\n\n### Step-by-Step Instructions\n\n1. **Mix coffee and water** — Use a ratio of about **1 part coffee to 4 parts water** by weight. For example, 100 grams of coffee to 400 grams of water. Adjust to taste: use less water for stronger concentrate, more water for a milder brew.\n\n2. **Combine in a jar** — Add the ground coffee and cold water to your container. Stir well to make sure all the grounds are saturated.\n\n3. **Cover and steep** — Cover the jar loosely (you want air circulation) and leave it at room temperature or in the refrigerator for **12 to 24 hours**. Longer steeping creates a stronger, smoother flavor.\n\n4. **Strain** — Pour the mixture through a fine-mesh strainer lined with cheesecloth or a coffee filter into another container. Do this slowly to avoid disturbing the settled grounds at the bottom.\n\n5. **Dilute and serve** — Cold brew concentrate is strong, so dilute it with water, milk, or a milk alternative before drinking. Mix to your preferred strength (usually 1 part concentrate to 1 part water or milk, but adjust as you like).\n\n### Storage and Tips\n- **Refrigerate** your finished cold brew — it keeps for **up to 2 weeks** in the fridge.\n- **Coarse grind is essential** to prevent over-extraction and a muddy taste.\n- If you want a cleaner cup, filter through a paper filter or cheesecloth after the initial straining.\n- Cold brew is naturally smooth and less acidic than hot coffee, making it easier on the stomach for some people.",
"subsequent_request_token": "Q6Rha3icbVVLcuREEF0S0afICC-wO9qKsTEbbwjjgcARTEAwcICSlGrVdKlKVJVablbDEfhcgVOw4B4s5yS8rJLUMrCxu7OqXr6X-TL75z_i4G345de_WjdS7eiJOnVgqpypqfQ84lPTMH_290d_XlzQG3XQdk-Pcvq5nD6m081mu31cXuhAQXe9YYouoW239OH973RyA70bQqQQmXsAKx_YnGjv3WDrKRFpm5OPKrKnxnm6uf3w_rfbO2rd4MOOYssWEF7hpo4FfcWePw44He83mwuQfLJ7z7VmGwMpAH_x46D7Dl831yQ8_y8tKF5aF6nRlqcTpBpbXbU0amPIHdlf8zPSVjGhRgUZVOoImlcT8kxb0Bpt8IlrgoKoernygEvvlJdI5WyEgHxV2RMq9hPT6PwhzDeFynXHoZ3Est9R1TIHroyL7S7DpJrlXICScuXbaBNwvumjdlaZe-D1qkdBoxvZBFzFze32xfswASSVKeaVPM9VfRu5vy5P1_IfJUaWoZLTsNncFIB6o59nOlKeuQ7S-B8CYpTAyDWkSjdEvLihXvk4P4JX7lIgLG_LE42s9y2a_GXipcRVO7p59Qo9Ul0QtNXzdThhFPRQJ8fhNPXrngZwMRzCyl-Q4uyeU1Mq2AREkaRznleXFHXa1PgiFi82m9sidbwrxTBwoiJ0dtL7UNfi0n8ZW6WPi7NBCQOxckKBEmsPxXDbNDgUBpBQEljg4GnEgsLcAqcGlU8yFRg05UjTNTHJUXksvjPOJedfyiSOysLISFhpXw0mdfoqARhWR2jCaSTvXEeRO1hHMrLYBmoF0XPj9V7iLpcIHb0V5vOobrcFfZ0rmzjJ5qg8gzU0LFXfUegc_Cx1NuroPBTdiaK3yceTkG-lVJK108-JR2xRjX1Liv47J2TwF3XWsV1PDKU2vrA8tICwsjn_qhWvYZhWFplxIyoml45O11TrgPSlSBE2gWM0SLW0JqZw6WJ0HYR8KkJeazPE3P_A_shLb84rdvFdWp6pMqiLQ7r0FL1IYpJzduLEw45mUx5gEIQtOoi2ldyIcWuvrazqgmQuZ6_16Bl7WUrIwXYPyMshDDDYiZZpPHPBsymaLYuMOXWJ-VV5slRIe93oA18V86ZwXu2z4O91H9Jy_G5xi-hPbNA4HVquVz82UheIPcAtYfLU0CdPYS74IBtqch_Q6j0Xq5WOJmhkRAEx3pCglcF1vIXqI76_WOEwe-KHCg51fcrbQdCeGjpPB1WYBTFUNfS72TJn5-WNOoVlG6-8ppo4TR5UCpfzXpY0L34tbRpmaUIehWkKsaRUpWtdAUZZzNS8K3eyHMSCKBWroCV7rkqA7RR-stJacx1Tzw4rs_gHQtTDRQ",
...
}
Example with a table in the answer
{
"text_blocks": [
{
"type": "paragraph",
"snippet": "As of October 6, 2026, Apple’s newest iPhones are the iPhone 18 Pro, iPhone 18 Pro Max, and iPhone Duo. The latest conventional models also include the iPhone 17 lineup and iPhone Air. Prices below are U.S. starting prices.",
"snippet_highlighted_words": ["October 6, 2026", "iPhone 18 Pro, iPhone 18 Pro Max, and iPhone Duo"],
"reference_indexes": [0, 1, 2]
},
{
"type": "table",
"table": [
["Model", "Starting price", "Screen", "Chip / tier", "Rear cameras", "Storage", "Best for"],
["iPhone 18 Pro Max", "$1,299", "6.9″ OLED, 120Hz ProMotion, Always-On", "A20 Pro", "Triple 48MP system with variable-aperture main camera and 4×/8× telephoto", "256GB–2TB", "Maximum battery life, largest conventional display, best cameras"],
["iPhone 18 Pro", "$1,199", "6.3″ OLED, 120Hz ProMotion, Always-On", "A20 Pro", "Triple 48MP system with variable-aperture main camera and 4×/8× telephoto", "256GB–2TB", "Best overall camera and performance in a manageable size"],
...
],
"formatted": [
{
"model": "iPhone 18 Pro Max",
"starting_price": "$1,299",
"screen": "6.9″ OLED, 120Hz ProMotion, Always-On",
"chip_tier": "A20 Pro",
"rear_cameras": "Triple 48MP system with variable-aperture main camera and 4×/8× telephoto",
"storage": "256GB–2TB",
"best_for": "Maximum battery life, largest conventional display, best cameras"
},
{
"model": "iPhone 18 Pro",
"starting_price": "$1,199",
"screen": "6.3″ OLED, 120Hz ProMotion, Always-On",
"chip_tier": "A20 Pro",
"rear_cameras": "Triple 48MP system with variable-aperture main camera and 4×/8× telephoto",
"storage": "256GB–2TB",
"best_for": "Best overall camera and performance in a manageable size"
},
...
]
},
{
"type": "paragraph",
"snippet": "The iPhone 18 Pro is the strongest choice for most photography enthusiasts, while the iPhone 18 Pro Max is better if battery life and screen size matter most. The iPhone 17 offers the best mainstream value, and the iPhone Air prioritizes thinness over camera versatility. The iPhone Duo is the most capable for screen space but costs substantially more and is physically more complex.",
"snippet_highlighted_words": ["iPhone 18 Pro", "iPhone 18 Pro Max", "iPhone 17", "iPhone Air", "iPhone Duo"],
"reference_indexes": [0, 1]
}
],
"references": [
{
"title": "iPhone buying guide 2026: Which iPhone should you buy?",
"link": "https://www.macworld.com/article/670458/iphone-buying-guide.html",
"source": "macworld.com",
"source_icon": "https://external-content.duckduckgo.com/ip3/www.macworld.com.ico",
"date": "September 17, 2026",
"index": 0
},
{
"title": "iPhone",
"link": "https://www.apple.com/iphone/",
"source": "Apple",
"source_icon": "https://external-content.duckduckgo.com/ip3/www.apple.com.ico",
"index": 1
},
...
],
"related_searches": [
{
"query": "latest iPhone models 2026 comparison",
"link": "https://duckduckgo.com/?q=latest+iPhone+models+2026+comparison&t=duck_ai",
"serpapi_link": "https://serpapi.com/search.json?engine=duckduckgo&kl=us-en&q=latest+iPhone+models+2026+comparison"
},
{
"query": "iPhone 17 vs iPhone 17 Pro vs iPhone Air",
"link": "https://duckduckgo.com/?q=iPhone+17+vs+iPhone+17+Pro+vs+iPhone+Air&t=duck_ai",
"serpapi_link": "https://serpapi.com/search.json?engine=duckduckgo&kl=us-en&q=iPhone+17+vs+iPhone+17+Pro+vs+iPhone+Air"
},
...
],
"markdown": "As of **October 6, 2026**, Apple’s newest iPhones are the **iPhone 18 Pro, iPhone 18 Pro Max, and iPhone Duo**. The latest conventional models also include the iPhone 17 lineup and iPhone Air. Prices below are U.S. starting prices. [0] [1] [2]\n\n| Model | Starting price | Screen | Chip / tier | Rear cameras | Storage | Best for |\n|---|---:|---|---|---|---|---|\n| **iPhone 18 Pro Max** | **$1,299** | 6.9″ OLED, 120Hz ProMotion, Always-On | A20 Pro | Triple 48MP system with variable-aperture main camera and 4×/8× telephoto | 256GB–2TB | Maximum battery life, largest conventional display, best cameras |\n| **iPhone 18 Pro** | **$1,199** | 6.3″ OLED, 120Hz ProMotion, Always-On | A20 Pro | Triple 48MP system with variable-aperture main camera and 4×/8× telephoto | 256GB–2TB | Best overall camera and performance in a manageable size |\n| **iPhone Duo** | **$1,999** | 7.6″ inner foldable OLED + outer display, 120Hz | Latest flagship foldable platform | Dual 48MP system; 2× optical-quality zoom | 256GB–2TB | Largest screen, multitasking, foldable design |\n| **iPhone Air** | **$1,099** | 6.5″ OLED, 120Hz ProMotion, Always-On | High-end non-Pro chip | Single 48MP rear camera | 256GB–1TB | Thin, light design with a premium display |\n| **iPhone 17** | **$899** | 6.3″ OLED, 120Hz ProMotion, Always-On | Standard flagship chip | Dual 48MP main and ultrawide cameras | 256GB–512GB | Best balance of price, features, and performance |\n| **iPhone 17e** | **$699** | 6.1″ OLED | Entry-level current chip | Single 48MP rear camera | 256GB–512GB | Lowest price and basic everyday use |\n\nThe **iPhone 18 Pro** is the strongest choice for most photography enthusiasts, while the **iPhone 18 Pro Max** is better if battery life and screen size matter most. The **iPhone 17** offers the best mainstream value, and the **iPhone Air** prioritizes thinness over camera versatility. The **iPhone Duo** is the most capable for screen space but costs substantially more and is physically more complex. [0] [1]\n\n### References\n\n[0] [iPhone buying guide 2026: Which iPhone should you buy?](https://www.macworld.com/article/670458/iphone-buying-guide.html)\n[1] [iPhone](https://www.apple.com/iphone/)\n[2] [Compare iPhone models](https://www.apple.com/iphone/compare/)\n[3] [Compare iPhone models](https://www.apple.com/iphone/compare/)\n[4] [Compare iPhone models](https://www.apple.com/iphone/compare/?modelList=iphone11%2Ciphone13)",
"subsequent_request_token": "alAu03iczVVBcts4EDymyq-Yw54YUrGYWLY3J3udSg522ZUoDxiRkIhaEOACoBW6dPA-YZNDKg_IC_KEPCKVHP2SnQEF0bL2kNz2wCqSAGa6e2Yaf3_2rdXun_ffHxembtAK8JUAhV44D_KqMlpAbUqhHEgNCB5nSvx49O3EgZlDklwW3syEhUkK-X4-SZIUTppGibvbTw60WA5hHMToSbIOPD6CK2tS2PqEC3yXAuoy_j5rTZKMYDrgKoy-FtpLo1FFdKicIYiFass-Swx6CEpq0Tb3Q55IO6JcsiBUM6HMMmB7O3ozAufReqkX0ITl0d7eCi44BazgzdYa_yisEJpe_qhkA0_AS5JiBa8FWiiwFhZdOGYsLnj_KaOfG9qzt8qyjJ_f48vWQ0kfqMSyJAnw_9_GaX58HD4mo-O72y9wef7iLIVxvv_qhvdeGNaGKqGW2LnskhGe5PshzAqmVlKB4NnRxRW4znlRw1L6Cq7RSq5uho2w1BZUeKSa9zyCes--fnxy9PUjeKFEUxnP0fKDycvTu9sP-fSUvgikrNsaZui9sB1JPxcplc0udupWStco7FIqAC9FtXaZD6zHG9ZP_1esQ1nNNR1Q6v5JikjFrlFTs4TpoVdqBE4HTt6IbbahzyPV4zXVw9GEqUqtqbPmRpXhMDOHx2BaEnkQsldiBef9lMwVLhz35eYYbfMMiPactVSCe2I8h5womsbLAlX2F61K38GNMfUO2_N1NV1o_hTqVnnp0f1Jk5EOyUrh5EJvU6S5Gyjub6p58JPVfCUXVSZIWG10xmUtmB4NGGWOtbXD7N1DPg7Ip5WkiIqi-Agv9ADSQItaUt-utXzQhocR9NEvNyBZhi7RlkM11piHAoR-43YhHS0uJfnX4B2RwME4f7lptRmq0FPkwMGJSHWB3Lsu3em7B0xEpDLZUBlHKvT1QnvbZUpck98VrbU0rT8vcsR4boLt9ybJeGboZAEU1HYlids6hrU33b0KCJF0wb2dt0b3plEZjsOuWRsOyyO4sNhUHRC8qnUSnSfmy0qq_7xg1tYp2evZlkDOtwwqYOy7uR_LOiyGdP29s90KZj4XtocZvIsLSHgF1uQmqhV9EbaA9I1PihgrPaXg0zzTzgXfiFrSq0MvefYeJO7NYS1O0KHAJswZCxPBN0hKzVp2WpIEXDuj64wMl3ypo1O2p0pRSDzHkx5_8-WvxLvRv4kfu3o",
...
}
Example with code in the answer
{
"text_blocks": [
{
"type": "code_block",
"language": "python",
"code": "def reverse_string(text):\n return text[::-1]"
},
{
"type": "paragraph",
"snippet": "Example:"
},
{
"type": "code_block",
"language": "python",
"code": "print(reverse_string(\"hello\")) # olleh"
}
],
"markdown": "```python\ndef reverse_string(text):\n return text[::-1]\n```\n\nExample:\n\n```python\nprint(reverse_string(\"hello\")) # olleh\n```",
"subsequent_request_token": "GDn1TnicXYxBCgIxDADveUVYL1vEg9fefYWIXTRrC7UtaVbXi-AT9A8-an9jyyKCOYVMZh5vGTjk52taXtkJYYfpJjYG7IdwEFcWich0Ic4VZmEXTtPdGDP_wZH6L9_PtBUaRWnAMky1j_Wy1Xq13kExATZjd06eNMAvlIor7V-qseR9bJRCXGD0nmw1PvSHQiA",
...
}
Example with subsequent_request_token
Each search returns a subsequent_request_token holding the conversation so far. Send it with a new q to ask a follow-up question: in this example, the token returned for where does coffee grow?.
{
"text_blocks": [
{
"type": "paragraph",
"snippet": "Brazil produces the most coffee—by a wide margin. It is the world’s leading coffee producer, ahead of Vietnam and Colombia. Brazil grows both major types: Arabica and Robusta. Recent estimates put Brazil’s 2025–26 production at roughly 63–66 million 60-kilogram bags.",
"snippet_highlighted_words": ["Brazil", "Arabica", "Robusta", "63–66 million 60-kilogram bags"],
"reference_indexes": [0]
}
],
"references": [
{
"title": "Improved Brazil Coffee Crop Prospects Weigh on Prices",
"link": "https://www.tradingview.com/news/barchart:13929263b094b:0-improved-brazil-coffee-crop-prospects-weigh-on-prices/",
"source": "TradingView",
"source_icon": "https://external-content.duckduckgo.com/ip3/www.tradingview.com.ico",
"index": 0
},
{
"title": "Coffee Prices Hit New Highs Due to Supply Shortages",
"link": "https://www.indexbox.io/blog/coffee-prices-surge-amid-tightening-supplies-and-weather-concerns/",
"source": "indexbox.io",
"source_icon": "https://external-content.duckduckgo.com/ip3/www.indexbox.io.ico",
"index": 1
}
],
"related_searches": [
{
"query": "top coffee producing countries ranking",
"link": "https://duckduckgo.com/?q=top+coffee+producing+countries+ranking&t=duck_ai",
"serpapi_link": "https://serpapi.com/search.json?engine=duckduckgo&kl=us-en&q=top+coffee+producing+countries+ranking"
},
{
"query": "Brazil coffee production compared with Vietnam",
"link": "https://duckduckgo.com/?q=Brazil+coffee+production+compared+with+Vietnam&t=duck_ai",
"serpapi_link": "https://serpapi.com/search.json?engine=duckduckgo&kl=us-en&q=Brazil+coffee+production+compared+with+Vietnam"
},
...
],
"markdown": "**Brazil** produces the most coffee—by a wide margin. It is the world’s leading coffee producer, ahead of Vietnam and Colombia. Brazil grows both major types: **Arabica** and **Robusta**. Recent estimates put Brazil’s 2025–26 production at roughly **63–66 million 60-kilogram bags**. [0]\n\n### References\n\n[0] [Improved Brazil Coffee Crop Prospects Weigh on Prices](https://www.tradingview.com/news/barchart:13929263b094b:0-improved-brazil-coffee-crop-prospects-weigh-on-prices/)\n[1] [Coffee Prices Hit New Highs Due to Supply Shortages](https://www.indexbox.io/blog/coffee-prices-surge-amid-tightening-supplies-and-weather-concerns/)",
"subsequent_request_token": "hywLinicZVPBbtRADBUc9yt84RKyq6qIPfRStSsEFQKqUrg7iZMYJuMwMyFsT8svtFyQ4Mg38C1UnPZL8CRZtojTJON59vN79ucfoXPWX1__7GtyBIWQh1zKkggqJ_3x7f3fq_2vhwbZmjWwhVATJMl2822Kn5IJ6XbzPUkAIThpOUcDGdoC0EmnR0TQhw6DOMgo9ERjlsvhsQcpYYU2JwcRtMLWcS7OLuAsgG_RemjRhfjuaDaba_EV2eC0SHz-WrpQw0lDCsIjJXHq8IpNCisx0mSMKTzV0tSg0c8X9Elzp3BOrhtSnZQ73JNQs_LRR8_JrvV4U2l-PS_RXqGNgYs-3ow4zzjUj42cY84l5zHLW6ZgsUnhzBZiyUeYfsbjHNsO4SX1Sogt6c2Ardlw2-qFHxK_0ksHjioW62PGZ9gj81BrJ8MAXKHjLCO0s9nkRGvQatwSFdCjUxKlEx_mpdNgLsoixKQpeEIvVgV06mqJRtXqyZh5Ef8V7CUKGCtKGdQsX2NBi9i1w0zlUlZhPfisIzHOhw5GLmLIpVBzpS3M0QQOXUE6BVpOK2ijcXIuJOt8GHLE92qNh1pCiFAjvTZPhj7iQHUxuQnsh54Nuop8gNZJ0eURUYqJoAKy9V77vfV3XIjt7DxeXP96qHzyehRTfNSn06FiJTMlHys2KuDx7b0HSTIyUdr_xafF2W6-KAmEnrXpRpnyOMIT916cKbabrx4MYcG22u3bvhmsNRIpTZ2M-zA181eLUfBMdOwbfKc7pV6QP_rHngi8I_UCLijXpQEVj5tB8rYLU8KB0-HB4ePt5uZwOdGJ8gMG0A2uanU5SZaPNL5cQsPGxODyYP6ejVROeWZYea3yB1l5inY",
...
}
JSON Structure Overview
{
...
"text_blocks": [
{
"type": "String - Type of the text block. Can be 'heading', 'paragraph', 'list', 'table', or 'code_block'",
// Only for 'heading' and 'paragraph' types
"snippet": "String - Text of the text block",
"snippet_highlighted_words": [
"String - Bold text in the snippet",
...
],
"snippet_links": [
{
"text": "String - Text of the link",
"link": "String - URL of the link"
},
...
],
"reference_indexes": [
"Integer - Index of a reference cited by the text block, in the root 'references' field",
...
],
// Only for 'list' type
"list": [
{
"snippet": "String - Text of the list item",
"snippet_highlighted_words": "Array - Same as in text blocks",
"snippet_links": "Array - Same as in text blocks",
"reference_indexes": "Array - Same as in text blocks",
// Nested list
"list": "Array - Same as 'list'",
// Other blocks of the list item, like a code block
"text_blocks": "Array - Same as 'text_blocks'"
},
...
],
// Only for 'table' type
"table": [
[
"String - Table cell. The first row is the header",
...
],
...
],
"formatted": [
{
"header_of_the_column": "String - Table cell of the column",
...
},
...
],
// Only for 'code_block' type
"language": "String - Programming language of the code",
"code": "String - Code"
},
...
],
"references": [
{
"title": "String - Title of the reference",
"link": "String - URL of the reference",
"source": "String - Name or domain of the website",
"source_icon": "String - URL of the website icon",
"date": "String - Publication date of the reference",
"index": "Integer - Index of the reference"
},
...
],
"related_searches": [
{
"query": "String - Related search",
"link": "String - URL of the DuckDuckGo search",
"serpapi_link": "String - URL of the search with SerpApi's DuckDuckGo Search API"
},
...
],
"markdown": "String - Answer in markdown, with references",
"subsequent_request_token": "String - Token to continue the conversation with a follow-up prompt",
"error": "String - Error message if Duck AI hasn't answered",
...
}