DuckDuckGo news search API
News articles for a query with title, excerpt, source, image and date, per region and time range.
GET /v1/duckduckgo/newsBeta1 credit per callRefunded on failureimport os, requests
res = requests.get(
"https://api.groundsocial.dev/v1/duckduckgo/news?query=coffee&time_range=day",
headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()Response
200 · 1 credit{ "query": "coffee", "results": [ { "date": 1795669140, "title": "Cars and Coffee returns", "excerpt": "Ada Cars and Coffee returned to downtown Ada Saturday. Organizer Dylan Cool said he was delighted with the turnout, desp…", "url": "https://www.yahoo.com/lifestyle/articles/cars-coffee-returns-045900308.html", "source": "Yahoo", "image": "https://s.yimg.com/lo/mysterio/api/906d28ba0213896f40fdb12337e853169a241bf8f0aac9e8c9df0e73191d3815/lightyear_networkapi…", "relative_time": "19 hours ago", "fetch_image": 1, "image_token": "a76fa756cc9f47b9444d5fe2fe23538733106a1cb5dc4bd7ffe8ab9c24947bff", "syndicate": "bing", "use_relevancy": 0 }, { "date": 1795696200, "title": "Why You Should Never Store Coffee In The Fridge", "excerpt": "It definitely dulls the flavor.", "url": "https://www.msn.com/en-us/news/other/why-you-should-never-store-coffee-in-the-fridge/ar-AA2ii385", "source": "Southern Living", "image": "https://s.yimg.com/lo/mysterio/api/f0895daa994f2258736a0646f82af9562cbc2312725019272f9f1b1ae120f42b/lightyear_networkapi…", "relative_time": "12 hours ago", "fetch_image": 1, "image_token": "952494b9dce9cc42a299011761853c297de37370fce93fe21703922a08b2a8c5", "syndicate": "bing", "use_relevancy": 0 }, "… 26 more" ]}Parameters
| Name | Type | Description |
|---|---|---|
queryquery · required | string | |
regionquery | string | DuckDuckGo region (default us-en; wt-wt for none). Example: de-de. |
safe_searchquery | "strict" | "moderate" | "off" | One of strict, moderate, off. |
time_rangequery | "any" | "day" | "week" | "month" | "year" | One of any, day, week, month, year. |
limitquery | integer |
Status codes
| Status | Meaning |
|---|---|
200 | News articles. |
400 | Invalid input. Nothing was charged. |
401 | Missing or invalid API key. |
402 | Not enough credits, a spend cap was reached, or payment is required. |
403 | The target is private, or the account is suspended. |
404 | DuckDuckGo has nothing for that search. |
429 | Too many requests. Wait for Retry-After seconds. |
503 | DuckDuckGo is temporarily unavailable. Retryable; nothing was charged. |
Every error has code, message, hint and retryable. All error codes
Questions
How many?
Up to 30.
DuckDuckGo is a trademark of Duck Duck Go, Inc. We are not affiliated with or endorsed by DuckDuckGo.