How to Get DuckDuckGo Search Results With the DuckDuckGo API
Search DuckDuckGo from an agent or script and turn the returned organic results into a usable table.

Get DuckDuckGo search results into your agent. Paste this into your agent:
Set up https://monid.ai/SKILL.md, then search DuckDuckGo for NASA Artemis program and return the organic result positions, titles and URLs.
One prompt starts the search · Set up once and reuse the workflow.
A developer searching for a DuckDuckGo API often starts by copying links out of a browser. That works for one query, but a results page has a finite number of visible results and every additional query adds another manual handoff.
A script needs more than a screen: it needs a query, a response it can parse, and a way to keep the result attached to the search that produced it. Copying titles and URLs by hand also makes it easy to lose the result order or mix up two searches.
This guide produces a table of positions, titles and URLs from a real search using Monid, the OpenRouter for agent tools. You will set up access, run one small search, and pass the response to an agent or script. The endpoint returns search results; fetching and interpreting the full pages is a separate step.
For the query NASA Artemis program, our November 27, 2026 run returned these three organic rows:
| Position | Title | URL |
|---|---|---|
| 1 | Moon to Mars | NASA's Artemis Program - NASA | https://www.nasa.gov/humans-in-space/artemis/ |
| 2 | Artemis program - Wikipedia | https://en.wikipedia.org/wiki/Artemis_program |
| 3 | Artemis - NASA | https://www.nasa.gov/feature/artemis-/ |
How to use the DuckDuckGo API with Monid
Use Monid to discover the search tool, inspect its inputs, and run a small query. An endpoint is a callable operation: here, the SerpApi DuckDuckGo search operation returns parsed search results in a response your code can read.
Step 1. Set up access
For an agent, get a key at app.monid.ai and give it the setup instruction below. The agent quickstart explains the setup.
set up https://monid.ai/SKILL.md
For a human using a terminal, install the CLI and add your key. The CLI quickstart covers the same setup.
npm install -g @monid-ai/cli
monid keys add -k <your-api-key> -l main
Keep the key outside source code and shared logs. One Monid key and balance can be used across the tool catalog, so the search is a component in the same workflow as other tools you choose to call.
Step 2. Find and inspect the search
Discover identifies the provider and path; inspect shows the input schema and billing before you spend. Both commands are free.
monid discover -q "duckduckgo api"
monid inspect -p serpapi -e /duckduckgo/search
The required input is q, the search text. kl selects a region, while m requests a maximum number of organic results. We set kl to us-en and m to 3 so the example has a small, readable output. This is a maximum, not a promise that every search will return three rows.
Step 3. Run one small search
The following command sends query parameters with --query and waits for the response with -w. Use the same query and settings when you want to reproduce the shape of this example.
monid run -p serpapi -e /duckduckgo/search --query '{"q":"NASA Artemis program","kl":"us-en","m":3}' -w
Our call completed with a provider response of 200 and three organic rows. Its response reported total_time_taken of 1.33 seconds; that is the timing for this search, not a latency guarantee. Search results and ordering change, so a later run is a new observation.
Step 4. Read and save the table
Read organic_results as a list and extract each item's position, title, and link. The response also returned snippet for each of the three rows, which you can keep as context beside the URL.
Save the query, region, requested maximum and time of the run with the rows. This makes a saved table interpretable later: a position without its query and settings does not tell you which search produced it. Preserve the original response as well if downstream code needs the other returned sections.
Why save search results as structured data?
A structured result lets a program select and compare links without parsing a copied page. Each row in the example has a position, a title and a URL, so an agent can return a short source list or hand selected URLs to a separate page reader.
Keep the query with the result
Search results are observations of a particular request. Store the query exactly as sent, the kl region and the requested m value along with the retrieval time. If you compare two snapshots, match the query and settings first; otherwise a changed input can be mistaken for a changed ranking.
The response includes search_parameters, which echoed those inputs in our run, and search_metadata, which included a creation time. Keeping these alongside the rows gives you a practical audit trail without turning the search result into a permanent claim about a page.
Separate a search listing from its source
A search snippet is a short description returned with a listing, not the full source document. In the example, two rows point to NASA pages and one to Wikipedia; the table records what the search returned, not a conclusion that any particular page is authoritative for every question.
For research, select a URL, fetch its content through a suitable page reader, and check the source before quoting it. For another search source, the Bing search guide shows how to return organic results to an agent.
How do you get search results?
Choose the route based on whether the result needs to be read by a person, reused by code, or followed through an interactive page. Each route gives you a different amount of control and work to maintain.
Use a browser for one search
A browser is a direct choice when a person wants to inspect one results page and click through. It gives the reader a visual view, but transferring a list into a repeatable data workflow requires another step. Keep this route for occasional investigation when a saved response is unnecessary.
Use a search call for a repeatable list
A search call returns fields your program can store and pass to another step. Monid provides the SerpApi operation under a shared key and balance, with a price for a successful search. The call returns a search response, not the full content of every linked page.
Use a browser automation workflow for interaction
A browser workflow is appropriate when your task needs actions on a page after search, such as navigating an interface. It has a different job from returning a list of search results. An interactive workflow adds navigation and page actions to the search step.
| Route | Billing approach | Best for | Limit |
|---|---|---|---|
| Monid search | Per successful call | Structured results in an agent | Full pages require a separate step |
| Browser | Depends on your setup | One person inspecting a page | Manual transfer into a dataset |
| Browser automation | Depends on the tool | Page interaction | More workflow to manage |
How to turn a search response into a table
Start with the organic_results array and create one row per result. Do not combine organic results with other response sections just because they appear in the same JSON object: their positions and meanings are different.
Step 1. Select organic rows
In our run, organic_results contained exactly three objects. Each had position, title, link, snippet and favicon; the first also had sitelinks. A consumer should treat the array as a collection of individual search results, not assume that all rows have the same optional nested data.
The requested m was three, and the returned row count was three. The response also included news and a knowledge graph, so counting every object in the response would not produce the organic result count. Count the selected array instead.
Step 2. Preserve rank and URL
Keep the returned position rather than assigning a fresh rank after filtering. If your code removes a row, the positions that remain still describe the original response. Keep the URL as returned and use it as the destination to inspect, not as proof that the destination's contents support the snippet.
The first and third rows in our sample point to different NASA URLs. Grouping solely by domain would collapse those distinct pages. Decide whether your task needs page-level URLs or a domain-level summary before deduplicating.
Step 3. Handle absent and repeated results
Check whether organic_results exists before iterating, and handle an empty list as a valid outcome in your own data model. Do not silently replace a missing result with an invented row. The inspected description states that a successful empty search is billed; we did not test an empty response.
For later pages, the inspected schema warns that the number of results varies and duplicates can appear. Deduplicate by the URL when the task needs unique pages, but retain the original positions and snapshots if the task is ranking analysis. Inspect the response each time instead of assuming a fixed page length.
Step 4. Record the settings for comparisons
The observed response echoed q, kl and m and returned a pagination object with a next request. Save those settings with each result set before you compare it to another search. For a longer-running project, the Google SERP checker guide explains how to compare organic search positions across snapshots.
How to use the results in an agent
Give the agent a clear query and tell it what to return, then make the next action depend on the returned data. With Monid, the agent can discover and inspect the operation before running it, using the same pattern as the terminal example.
Define the job and the stopping point
A useful instruction names the search, the region, the maximum number of results, and the columns you need. For example, ask for three organic results for NASA Artemis program in us-en, with position, title and URL. Tell the agent to return an empty list if no organic rows are present, rather than filling the table from memory.
This instruction stops at search. If the actual job is to answer a research question, add a separate step that reads the selected pages and cites them. That distinction prevents a search listing from being treated as a verified answer.
Add pagination deliberately
The inspected inputs include start, an offset, and m, a maximum. The initial request can return up to 11 organic results; a request with an offset can return up to 50. These are limits described by the schema, not guarantees of the number returned.
Our response included a next request with start set to 3. A subsequent request is another call, so choose a stopping condition before asking an agent to follow pages: a maximum number of calls, a sufficient number of distinct URLs, or a saved budget. The example above uses only the first request.
Keep tool output separate from instructions
Search titles and snippets are data from outside the agent's instruction hierarchy. Pass them to the next step as content to evaluate, not as commands for the agent to obey. Save the original response when an operator needs to check which source supplied a statement.
The Brave search guide shows another search workflow for an agent. The search itself supplies candidate links; a separate application decision controls which links to use.
Which endpoint for which job?
Use the SerpApi tool page for the search operation shown here. The price below is per successful call, including a successful empty result according to the inspected billing notes. See current tool prices. Verified 2026-11-27. HTTP errors and failed searches are described as free; this guide measured a successful call only.
| Use case | Best endpoint | Why? |
|---|---|---|
| Return organic search rows to an agent | serpapi /duckduckgo/search | Query, region and result limit in one request; $0.015 per successful call. Verified 2026-11-27. |
Discover and inspect are free. The one successful example call was priced at $0.015 per call, Verified 2026-11-27. The number of returned organic rows does not change the per-call billing shape. The result count and timing above describe this one observation, not a forecast for other searches.
When should you use something else?
Use a browser when a person only needs to inspect one page visually, and use a page extraction tool when the task requires the text behind a result. Monid resells access to the SerpApi search operation; this blog has a direct interest in that route.
Choose the data your task actually needs
A search result is useful for finding candidate pages, but it does not include the complete content of those pages. A workflow that needs a detailed document must add retrieval and extraction after search. A workflow that needs to click through a site needs a browser capability, not just a search response.
Choose the level of control
A team that already uses SerpApi directly can keep its existing integration if that is the operational fit. A team using several tools through one agent can use the shared Monid workflow shown here. In either case, compare searches using consistent queries and settings, and evaluate source content independently of rank.
Conclusion
You now have a repeatable DuckDuckGo search and a real table of three returned organic results. Start with one small query, keep the request settings beside the output, and add page retrieval only when the task needs it. A saved, structured list gives your agent a clear set of sources to review.
FAQ
Is the DuckDuckGo search free to run?
Discover and inspect are free; a successful search call is billed. The tool page lists the current price: $0.015 per successful call, Verified 2026-11-27.
Do I need to write code?
No. Give an agent the setup instruction and a specific search task; the CLI is an option when you prefer a terminal or script.
How many results can one search return?
The inspected schema describes up to 11 organic results on the initial request and up to 50 on an offset request. The returned count varies; our request for three returned three.
Can I filter by region or date?
Yes. The inspected schema accepts kl for region and df for date filtering. Our example tested kl; it did not test a date filter.
Are failed or empty searches charged?
The inspected billing notes say failed searches and HTTP errors are free, while successful empty searches are billed. Our example was successful and returned results, so it does not test either case. Verified 2026-11-27.
Can I schedule repeated searches?
Yes. Your own scheduler can invoke the search workflow repeatedly. Store the query, settings and retrieval time with each response so that comparisons use matching inputs.
Does a search result verify the linked page?
No. A listing supplies a title, URL and, in our run, a snippet; read the linked source to assess its contents and relevance.
Published November 2026.


