100 free credits. No credit card required. Get a key

DuckDuckGo Instant Answer API

DuckDuckGo’s Instant Answer for a topic: heading, abstract and its source, image, infobox, definition and related topics.

GET /v1/duckduckgo/instant-answerBeta1 credit per callRefunded on failure
import os, requests

res = requests.get(
    "https://api.groundsocial.dev/v1/duckduckgo/instant-answer?query=Albert%20Einstein",
    headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()
Response
200 · 1 credit
{
"Heading": "Albert Einstein",
"Abstract": "Albert Einstein was a German-born theoretical physicist best known for developing the theo…",
"AbstractText": "Albert Einstein was a German-born theoretical physicist best known for developing the theo…",
"AbstractSource": "Wikipedia",
"AbstractURL": "https://en.wikipedia.org/wiki/Albert_Einstein",
"Image": "/i/267e7b7843e75cdd.jpg",
"Type": "A",
"Answer": "",
"Definition": "",
"Entity": "scientist",
"Infobox": {
"content": [
{
"data_type": "string",
"label": "Born",
"sort_order": "1",
"value": "March 14, 1879, Ulm, Kingdom of Württemberg, German Empire",
"wiki_order": 0
},
{
"data_type": "string",
"label": "Age at death",
"value": "76 years",
"wiki_order": 0
},
"… 18 more"
],
"meta": [
{
"data_type": "string",
"label": "article_title",
"value": "Albert Einstein"
},
{
"data_type": "string",
"label": "template_name",
"value": "infobox scientist"
},
"… 2 more"
]
},
"RelatedTopics": [
{
"FirstURL": "https://duckduckgo.com/c/Albert_Einstein",
"Icon": {
"Height": "",
"URL": "",
"Width": ""
},
"Result": "<a href=\"https://duckduckgo.com/c/Albert_Einstein\">Albert Einstein Category</a>",
"Text": "Albert Einstein Category"
},
{
"FirstURL": "https://duckduckgo.com/Bern_Historical_Museum",
"Icon": {
"Height": "",
"URL": "",
"Width": ""
},
"Result": "<a href=\"https://duckduckgo.com/Bern_Historical_Museum\">Bern Historical Museum</a> – Einst…",
"Text": "Bern Historical Museum – Einstein Museum."
},
"… 34 more"
],
"Results": [
{
"FirstURL": "https://alberteinstein.com",
"Icon": {
"Height": 16,
"URL": "/i/alberteinstein.com.ico",
"Width": 16
},
"Result": "<a href=\"https://alberteinstein.com\">Official site</a><a href=\"https://alberteinstein.com\"…",
"Text": "Official site - Albert Einstein"
}
],
"AnswerType": "",
"…": "9 more fields"
}

Parameters

NameTypeDescription
queryquery · requiredstringExample: Albert Einstein.
Response fields

200 with a DuckDuckGoInstantAnswer, in DuckDuckGo’s own news, video and Instant Answer JSON fields.

FieldTypeDescription
Headingstring
Abstractstring
AbstractTextstring
AbstractSourcestring
AbstractURLstring
Imagestring
Typestring
Answerobject
Definitionstring
Entitystring
Infoboxobject
RelatedTopicsobject[]
Resultsobject[]
Status codes
StatusMeaning
200The Instant Answer.
400Invalid input. Nothing was charged.
401Missing or invalid API key.
402Not enough credits, a spend cap was reached, or payment is required.
403The target is private, or the account is suspended.
404DuckDuckGo has nothing for that search.
429Too many requests. Wait for Retry-After seconds.
503DuckDuckGo is temporarily unavailable. Retryable; nothing was charged.

Every error has code, message, hint and retryable. All error codes

Questions

No answer?

The fields come back empty.

DuckDuckGo is a trademark of Duck Duck Go, Inc. We are not affiliated with or endorsed by DuckDuckGo.