Sand AISand AI MAGI-2MAGI-2 現已登上 SandBase:支援原生音訊的 1080p 影片立即試用

DuckDuckGo Search

API 文件
https://api.sandbase.ai/v1/api/duckduckgo/search

DuckDuckGo organic search results for a keyword, with region and safe-search options.

價格
$0.015美元/次呼叫
方法
POST
回應
JSON
參數
1 個必填 · 1 個選填

Playground

輸入
max 500 chars
region code, e.g. us-en
輸出就緒

您的輸出會顯示在這裡

完成輸入後,點擊執行。

API README

DuckDuckGo Search API

This API returns DuckDuckGo organic search results for a keyword. Each result has a title, link, snippet and position, and the response also lists related searches. It needs a query in q and accepts an optional region code in kl.

Use cases

  • Track which pages rank for a keyword in a given region, such as us-en.
  • Collect titles, links and snippets of top results to research a topic or a brand.
  • Read sitelinks to see which sub-pages DuckDuckGo shows under a main result.
  • Use related_searches to find follow-up queries for keyword research.

Request

curl -X POST "https://api.sandbase.ai/v1/api/duckduckgo/search" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"q": "apple", "kl": "us-en"}'

The result is returned in outputs[0].data.

Parameters

NameTypeRequiredDescription
qstringYesmax 500 chars
klstringNoregion code, e.g. us-en

Example response

Real response for the request above, trimmed: lists keep their first item and long strings are cut.

{
  "organic_results": [
    {
      "favicon": "https://external-content.duckduckgo.com/ip3/www.apple.com.ico",
      "link": "https://www.apple.com/",
      "position": 1,
      "sitelinks": [
        {
          "link": "https://www.apple.com/shop/buy-iphone/iphone-18-pro",
          "snippet": "Get $35-$885 off a new iPhone 18 Pro or iPhone 18 Pro Max when you trade in an i…",
          "title": "Shop Iphone 18 Pro"
        }
      ],
      "snippet": "Discover the innovative world of Apple and shop everything iPhone, iPad, Apple W…",
      "title": "Apple"
    }
  ],
  "related_searches": [
    {
      "link": "https://duckduckgo.com/?q=apple%20music%20login&origin=related",
      "query": "apple music login"
    }
  ],
  "search_information": {
    "organic_results_state": "Results for exact spelling"
  }
}

Response fields

FieldMeaning
organic_results[].titleTitle of the search result.
organic_results[].linkURL of the result page.
organic_results[].snippetShort text excerpt shown under the result title.
organic_results[].positionRank of the result in the list. The first result has position 1.
organic_results[].faviconURL of the site's icon image.
organic_results[].sitelinks[].title / organic_results[].sitelinks[].link / organic_results[].sitelinks[].snippetTitle, URL and snippet of a sub-page shown under a result. Only some results have sitelinks.
related_searches[].queryText of a related search suggestion.
related_searches[].linkDuckDuckGo URL that runs the related search.
search_information.organic_results_stateShort note on how the results match the query, for example Results for exact spelling.

Notes

  • q is required and can be up to 500 characters. kl sets the region and language, for example us-en.
  • The response has no pagination fields, and the request has no page parameter.
  • For news articles on a topic, call DuckDuckGo News Search. For places, call DuckDuckGo Maps.

Pricing

$0.015 per successful call. Failed calls are not charged.

探索更多

相關 APIs

所有 APIs
API價格回應
DuckDuckGo每次呼叫 $0.015JSON
DuckDuckGo每次呼叫 $0.01JSON
DuckDuckGo每次呼叫 $0.01JSON
DuckDuckGo每次呼叫 $0.00015非同步 JSON
DuckDuckGo每次呼叫 $0.015JSON
DuckDuckGo每次呼叫 $0.01JSON

問題

常見問題

我要如何使用 DuckDuckGo Search API?

使用 POST 請求將您的 SandBase API 金鑰放在 Authorization 標頭(Bearer)中,並以 JSON 主體傳入參數,即可呼叫 https://api.sandbase.ai/v1/api/duckduckgo/search。您也可以直接在本頁的 Playground 試用,不必撰寫程式碼。

DuckDuckGo Search API 的費用是多少?

每次 $0.015,並從您的 SandBase 餘額中扣款。您只會為實際發出的呼叫付費;沒有訂閱方案。

DuckDuckGo Search API 接受哪些參數?

必要:q (string)。 選填:kl (string)。 本頁的 Parameters 表格與 Playground 會列出每個欄位。

DuckDuckGo Search API 會回傳什麼?

在同一個 HTTP 請求中回傳的 JSON 回應(同步)。 本頁的 README 包含範例回應。

我需要 DuckDuckGo 開發者帳號或 API 金鑰嗎?

不需要。DuckDuckGo Search 是透過 SandBase 運作,因此一組 SandBase API 金鑰即可使用此端點以及目錄中的其他所有 API 和模型。您不需要另外申請 DuckDuckGo API 存取權。