Instant Answer
curl --request GET \
--url https://scrapebadger.com/v1/duckduckgo/instant \
--header 'X-API-Key: <x-api-key>'import requests
url = "https://scrapebadger.com/v1/duckduckgo/instant"
headers = {"X-API-Key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<x-api-key>'}};
fetch('https://scrapebadger.com/v1/duckduckgo/instant', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://scrapebadger.com/v1/duckduckgo/instant",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://scrapebadger.com/v1/duckduckgo/instant"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://scrapebadger.com/v1/duckduckgo/instant")
.header("X-API-Key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://scrapebadger.com/v1/duckduckgo/instant")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"query": "<string>",
"abstract": "<string>",
"abstract_text": "<string>",
"abstract_source": "<string>",
"abstract_url": "<string>",
"heading": "<string>",
"answer": "<string>",
"answer_type": "<string>",
"definition": "<string>",
"definition_source": "<string>",
"definition_url": "<string>",
"image": "<string>",
"type": "<string>",
"redirect": "<string>",
"related_topics": [
{
"text": "<string>",
"url": "<string>",
"icon": {}
}
]
}Reference
Instant Answer
Query the DuckDuckGo Instant Answer API — abstract, definition, direct answer, related topics.
GET
/
v1
/
duckduckgo
/
instant
Instant Answer
curl --request GET \
--url https://scrapebadger.com/v1/duckduckgo/instant \
--header 'X-API-Key: <x-api-key>'import requests
url = "https://scrapebadger.com/v1/duckduckgo/instant"
headers = {"X-API-Key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<x-api-key>'}};
fetch('https://scrapebadger.com/v1/duckduckgo/instant', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://scrapebadger.com/v1/duckduckgo/instant",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://scrapebadger.com/v1/duckduckgo/instant"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://scrapebadger.com/v1/duckduckgo/instant")
.header("X-API-Key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://scrapebadger.com/v1/duckduckgo/instant")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"query": "<string>",
"abstract": "<string>",
"abstract_text": "<string>",
"abstract_source": "<string>",
"abstract_url": "<string>",
"heading": "<string>",
"answer": "<string>",
"answer_type": "<string>",
"definition": "<string>",
"definition_source": "<string>",
"definition_url": "<string>",
"image": "<string>",
"type": "<string>",
"redirect": "<string>",
"related_topics": [
{
"text": "<string>",
"url": "<string>",
"icon": {}
}
]
}Query the DuckDuckGo Instant Answer API. Best for reference queries — entities,
people, places, definitions and calculations.
Credits: 1
Instant Answers are entity-shaped: most long-tail search phrases return
an empty payload. That is DuckDuckGo’s behaviour, not an error — use
/search for general queries.Authorization
string
required
Your ScrapeBadger API key.
Query Parameters
string
required
Query for the Instant Answer API, e.g.
Nikola Tesla.Response
string
Echo of the requested query.
string
Abstract, may contain HTML.
string
Abstract as plain text.
string
e.g.
Wikipedia.string
string
The topic name.
string
Direct answer for calculation/conversion queries.
string
e.g.
calc, ip, color_code.string
Dictionary definition, when applicable.
string
string
string
string
Answer category:
A (article), D (disambiguation), C (category), N (name), E (exclusive).string
Set for
!bang redirect queries.Example
curl "https://scrapebadger.com/v1/duckduckgo/instant?query=Nikola+Tesla" \
-H "X-API-Key: YOUR_API_KEY"
const res = await fetch(
"https://scrapebadger.com/v1/duckduckgo/instant?" +
new URLSearchParams({ query: "Nikola Tesla" }),
{ headers: { "X-API-Key": process.env.SCRAPEBADGER_API_KEY } },
);
const data = await res.json();
import requests
res = requests.get(
"https://scrapebadger.com/v1/duckduckgo/instant",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"query": "Nikola Tesla"},
)
data = res.json()
Response
{
"query": "Nikola Tesla",
"abstract": "Nikola Tesla was a Serbian-American inventor, electrical engineer...",
"abstract_text": "Nikola Tesla was a Serbian-American inventor, electrical engineer...",
"abstract_source": "Wikipedia",
"abstract_url": "https://en.wikipedia.org/wiki/Nikola_Tesla",
"heading": "Nikola Tesla",
"answer": "",
"answer_type": "",
"definition": "",
"definition_source": "",
"definition_url": "",
"image": "/i/ee2712bd.jpg",
"type": "A",
"redirect": "",
"related_topics": [
{
"text": "Wardenclyffe Tower - An early experimental wireless transmission station...",
"url": "https://duckduckgo.com/Wardenclyffe_Tower",
"icon": null
}
]
}

