Duck.ai API
Send a question to the duck_ai engine to receive a structured answer. Text answers include Markdown and text blocks. Additional result collections depend on the source answer.
To continue an answer, pass pagination.conversation_token with the next question. Keep the same model for the conversation. Web search and reasoning availability depend on the selected model. Image-only answers do not return a conversation token.
API Parameters
Search Query
-
- Name
-
q - Required
- Required
- Description
-
The question to send to Duck.ai, up to 16000 characters. The limit counts UTF-16 code units; a supplementary character such as an emoji counts as two. For a long question, use a POST request with the parameters in the JSON body instead of the URL query string.
Answer Options
-
- Name
-
model - Required
- Optional
- Description
-
The model to use. The default parameter is
gpt-6-luna. A follow-up keeps its conversation model. Supported values:gpt-6-luna,gpt-5.6-luna,gpt-5.4-mini,claude-haiku-5-5,claude-haiku-4-5,mistral-small-2603,tinfoil/gpt-oss-120b,tinfoil/gemma4-31b.
-
- Name
-
reasoning_effort - Required
- Optional
- Description
-
The reasoning effort supported by the selected model. gpt-6-luna: none, low; gpt-5.6-luna: none, low; gpt-5.4-mini: none, low; claude-haiku-5-5: none, low; claude-haiku-4-5: none, low; mistral-small-2603: omit reasoning_effort; tinfoil/gpt-oss-120b: low; tinfoil/gemma4-31b: none, low. When omitted, the first supported effort is used. Supported values:
none,low.
-
- Name
-
web_search - Required
- Optional
- Description
-
Request web search on a supported model. Supported models:
gpt-6-luna,gpt-5.6-luna,gpt-5.4-mini,claude-haiku-5-5,claude-haiku-4-5,tinfoil/gpt-oss-120b.
Conversation
-
- Name
-
conversation_token - Required
- Optional
- Description
-
Use pagination.conversation_token from a fresh response to continue the conversation. Up to 64000 characters.
Note: Tokens grow with the conversation (8KB+ after long answers). If you encounter 400, 413 or 414 errors, use a POST request with the token in the JSON body instead of the URL query string.
API key
-
- Name
-
api_key - Required
- Required
- Description
-
Your SearchAPI API key. You can also use the Authorization: Bearer header.
Zero Data Retention
-
- Name
-
zero_retention - Enterprise Only
- Enterprise Only
- Required
- Optional
- Description
-
Set to true to disable persistent storage and request logging.
Response
https://www.searchapi.io/api/v1/search?engine=duck_ai&model=gpt-6-luna&q=What+is+the+capital+of+France%3F
- 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": "duck_ai",
"q": "What is the capital of France?",
"model": "gpt-6-luna"
}
response = requests.get(url, params=params)
print(response.text)
{
"search_metadata": {
"id": "search_ZD40AeqmorqVsJ65gkyw25lR",
"status": "Success",
"created_at": "2026-11-05T17:03:55Z",
"request_time_taken": 3.95,
"parsing_time_taken": 0.0,
"total_time_taken": 3.96,
"request_url": "https://duck.ai/",
"html_url": "https://www.searchapi.io/api/v1/searches/search_ZD40AeqmorqVsJ65gkyw25lR.html",
"json_url": "https://www.searchapi.io/api/v1/searches/search_ZD40AeqmorqVsJ65gkyw25lR"
},
"search_parameters": {
"engine": "duck_ai",
"q": "What is the capital of France?",
"model": "gpt-6-luna"
},
"text_blocks": [
{
"type": "paragraph",
"answer": "Paris."
}
],
"markdown": "Paris.",
"response_metadata": {
"model": "gpt-6-luna",
"message_id": "msg_04d0b66b6df095c7016aecb6f4d65c87d1bff8bb32290bb1c0",
"is_web_search_performed": false
},
"pagination": {
"conversation_token": "eJxFi7EOgzAMBX_FejN07MDC1rlbB9TBAlMipQmyHakSyr8DSxnvTrfhmyeJ6PBZvb23sSRGAy-aDN2wQXOUoxYTPb38_KDXwk7ByBehkdfgHCnP9FBOo_Sozf9js2DOya_5yRrshvquOyvIKbc"
}
}
Web Results
https://www.searchapi.io/api/v1/search?engine=duck_ai&model=gpt-5.6-luna&q=what+is+the+capital+of+japan&web_search=true
- 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": "duck_ai",
"q": "what is the capital of japan",
"model": "gpt-5.6-luna",
"web_search": "true"
}
response = requests.get(url, params=params)
print(response.text)
{
"web_results": [
{
"position": 1,
"title": "Japan",
"link": "https://en.wikipedia.org/wiki/Japan",
"source": "Wikipedia",
"favicon": "https://external-content.duckduckgo.com/ip3/en.wikipedia.org.ico"
},
...
]
}
Reference Links and Citations
https://www.searchapi.io/api/v1/search?engine=duck_ai&model=gpt-6-luna&q=best+budget+laptops+for+students+2026
- 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": "duck_ai",
"q": "best budget laptops for students 2026",
"model": "gpt-6-luna"
}
response = requests.get(url, params=params)
print(response.text)
{
"reference_links": [
{
"index": 0,
"title": "The best student laptops in 2026: our top tested picks for ...",
"link": "https://www.techradar.com/computing/laptops/best-student-laptops",
"source": "TechRadar",
"date": "2026-09-29",
"favicon": "https://external-content.duckduckgo.com/ip3/www.techradar.com.ico"
},
...
],
"citations": [
{
"index": 314,
"source_indexes": [
0
]
},
...
]
}
Related Searches
https://www.searchapi.io/api/v1/search?engine=duck_ai&model=gpt-5.4-mini&q=best+budget+laptops+for+students+2026
- 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": "duck_ai",
"q": "best budget laptops for students 2026",
"model": "gpt-5.4-mini"
}
response = requests.get(url, params=params)
print(response.text)
{
"related_searches": [
{
"query": "best student laptop 2026 budget",
"link": "https://duckduckgo.com/?q=best%20student%20laptop%202026%20budget&t=duck_ai",
"score": 0.95
},
...
]
}
Inline Images
https://www.searchapi.io/api/v1/search?engine=duck_ai&model=gpt-5.4-mini&q=generate+an+image+of+a+red+bicycle+on+a+beach
- 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": "duck_ai",
"q": "generate an image of a red bicycle on a beach",
"model": "gpt-5.4-mini"
}
response = requests.get(url, params=params)
print(response.text)
{
"inline_images": [
{
"title": "Drawing a red bicycle on a sunny beach",
"original": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/61wnSlACEQAAAAEAAFwdanVtYgAAAB5qdW1kYzJwYQARABCAA...",
"width": 1536,
"height": 1024,
"query": "A realistic red bicycle standing on a sunny beach near the shoreline, with soft waves, golden sand, clear blue sky, and natural daylight. Composition centered o...",
"model": "GPT Image 2"
}
]
}