<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jehad Bartolo</title>
    <description>The latest articles on DEV Community by Jehad Bartolo (@jehadbartolo).</description>
    <link>https://dev.to/jehadbartolo</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4263108%2F8a8cbbc5-fd70-4c70-8b6c-16f4377cbc7e.png</url>
      <title>DEV Community: Jehad Bartolo</title>
      <link>https://dev.to/jehadbartolo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jehadbartolo"/>
    <language>en</language>
    <item>
      <title>DuckDuckGo as a second engine: what you actually get</title>
      <dc:creator>Jehad Bartolo</dc:creator>
      <pubDate>Wed, 25 Nov 2026 02:43:52 +0000</pubDate>
      <link>https://dev.to/jehadbartolo/duckduckgo-as-a-second-engine-what-you-actually-get-2n5d</link>
      <guid>https://dev.to/jehadbartolo/duckduckgo-as-a-second-engine-what-you-actually-get-2n5d</guid>
      <description>&lt;p&gt;The second-engine plan got simpler this week and most teams have not noticed. Bing Web Search is not callable today, which leaves DuckDuckGo Search as the only non-Google engine in the catalog (checked 2026-11-25, &lt;a href="https://serpbase.dev/products/category/search" rel="noopener noreferrer"&gt;https://serpbase.dev/products/category/search&lt;/a&gt;). It costs one credit, the same as a Google web search.&lt;/p&gt;

&lt;p&gt;That makes it the obvious candidate for a fallback or a cross-check. It is also shaped differently from the Google endpoints in one place that will break a naive client, so the interesting question is not "should I use it" but "what does my code have to look like if it does".&lt;/p&gt;

&lt;h2&gt;
  
  
  One credit, same as Google
&lt;/h2&gt;

&lt;p&gt;The endpoint is a POST to &lt;code&gt;/duckduckgo/search&lt;/code&gt; at one credit per request (checked 2026-11-25, &lt;a href="https://serpbase.dev/docs/duckduckgo_search" rel="noopener noreferrer"&gt;https://serpbase.dev/docs/duckduckgo_search&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;The price parity is worth stating plainly because it removes the usual trade-off. You are not paying a premium for a second opinion, and you are not getting a discount for a lesser engine. A cross-check costs the same as the primary call, so the decision is purely about whether the second opinion is worth one credit.&lt;/p&gt;

&lt;p&gt;For a fallback path the answer is usually yes: one extra credit to avoid telling a user there were no results is cheap. For a routine cross-check on every query, the answer depends on what you do when the two engines disagree, and that is a product decision rather than a technical one.&lt;/p&gt;

&lt;h2&gt;
  
  
  The paging model is a cursor, not a page number
&lt;/h2&gt;

&lt;p&gt;This is the difference that breaks code, and it is stated in the first line of the documentation: continuation uses the returned cursor, not numbered pages (checked 2026-11-25, &lt;a href="https://serpbase.dev/docs/duckduckgo_search" rel="noopener noreferrer"&gt;https://serpbase.dev/docs/duckduckgo_search&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;So the shape is not "give me page 2". It is: send a request, read &lt;code&gt;pagination.next_cursor&lt;/code&gt; from the response, and send that cursor back to get the next slice. The response carries a &lt;code&gt;pagination&lt;/code&gt; object with &lt;code&gt;has_more&lt;/code&gt; and &lt;code&gt;next_cursor&lt;/code&gt;. The parameter accepts &lt;code&gt;cursor&lt;/code&gt; or &lt;code&gt;next_page_token&lt;/code&gt; as aliases.&lt;/p&gt;

&lt;p&gt;A client written against the Google endpoints, where &lt;code&gt;page&lt;/code&gt; is a 1-based integer, will not transfer. There is a &lt;code&gt;page&lt;/code&gt; parameter on this endpoint too, which makes the confusion worse rather than better: the documented continuation mechanism is the cursor, and a client that sends page numbers is relying on a parameter that is not the documented path.&lt;/p&gt;

&lt;p&gt;The practical consequence for a fallback: a fallback that only reads the first page needs no change at all, which is the common case. A fallback that pages needs a second code path, and that path has state, because the cursor has to be carried from one response to the next.&lt;/p&gt;

&lt;h2&gt;
  
  
  What comes back
&lt;/h2&gt;

&lt;p&gt;The response shape is close enough to the Google endpoints to be comfortable and different enough to catch a careless parser. Organic results carry &lt;code&gt;title&lt;/code&gt;, &lt;code&gt;link&lt;/code&gt;, &lt;code&gt;url&lt;/code&gt;, &lt;code&gt;snippet&lt;/code&gt;, &lt;code&gt;display_link&lt;/code&gt;, &lt;code&gt;position&lt;/code&gt; and &lt;code&gt;rank&lt;/code&gt;. At the top level there is &lt;code&gt;query&lt;/code&gt;, &lt;code&gt;action&lt;/code&gt;, &lt;code&gt;pagination&lt;/code&gt;, &lt;code&gt;search_type&lt;/code&gt;, &lt;code&gt;search_url&lt;/code&gt;, &lt;code&gt;source&lt;/code&gt; and &lt;code&gt;url&lt;/code&gt; (checked 2026-11-25, &lt;a href="https://serpbase.dev/docs/duckduckgo_search" rel="noopener noreferrer"&gt;https://serpbase.dev/docs/duckduckgo_search&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Two things follow for anyone storing results.&lt;/p&gt;

&lt;p&gt;First, &lt;code&gt;rank&lt;/code&gt; and &lt;code&gt;position&lt;/code&gt; exist here too, and they mean what they mean elsewhere: order within a module versus block position on the page. A pipeline that stores them under one column will lose the distinction across engines in a way it would not lose within one.&lt;/p&gt;

&lt;p&gt;Second, the response carries &lt;code&gt;search_url&lt;/code&gt; and &lt;code&gt;source&lt;/code&gt;, which is where the provenance story gets interesting.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it is actually querying
&lt;/h2&gt;

&lt;p&gt;The sample response in the documentation shows &lt;code&gt;search_url&lt;/code&gt; and &lt;code&gt;url&lt;/code&gt; both pointing at &lt;code&gt;html.duckduckgo.com&lt;/code&gt;, and &lt;code&gt;source&lt;/code&gt; set to &lt;code&gt;"duckduckgo"&lt;/code&gt; (checked 2026-11-25, &lt;a href="https://serpbase.dev/docs/duckduckgo_search" rel="noopener noreferrer"&gt;https://serpbase.dev/docs/duckduckgo_search&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;That tells you the mechanism: this endpoint reads DuckDuckGo's HTML results page and parses it server-side. No JavaScript execution, no browser. Which explains both the reliability characteristics and the limits: you get what that HTML page contains, and nothing that would require a rendered page to produce.&lt;/p&gt;

&lt;p&gt;For a fallback engine that is fine. For anyone expecting a JavaScript-rendered modern search interface, it is a mismatch worth knowing about before building on it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The privacy question, stated carefully
&lt;/h2&gt;

&lt;p&gt;This is where I have to separate what is documented from what I think, because the two get conflated constantly.&lt;/p&gt;

&lt;p&gt;What is documented: the request goes to DuckDuckGo's HTML endpoint from the platform's servers, and &lt;code&gt;source&lt;/code&gt; reports &lt;code&gt;duckduckgo&lt;/code&gt;. Separately, Google's &lt;code&gt;raw&lt;/code&gt; format strips the platform's session identifiers along with Google's scripts and tracking beacons, and resolves result links to their real addresses.&lt;/p&gt;

&lt;p&gt;What is my reading, not a vendor claim: choosing this endpoint does not make your pipeline anonymous. The request originates from the API provider's infrastructure, not from your user's browser, so any privacy benefit applies to the end user whose search you are proxying, not to you as the caller. If your threat model is "my users should not be tracked by the search engine", a server-side proxy helps. If it is "nobody should see that I queried this", a third-party API is the wrong architecture regardless of which engine sits behind it.&lt;/p&gt;

&lt;p&gt;I would rather write that paragraph than imply a guarantee the documentation does not make. The platform publishes no statement about its relationship with DuckDuckGo, and I am not going to invent one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Filters, formats and failures
&lt;/h2&gt;

&lt;p&gt;The endpoint supports market and date filters, with parameters for country and language, a date filter, device, a result limit, and an HTML mode. Formats are &lt;code&gt;json&lt;/code&gt; and &lt;code&gt;markdown&lt;/code&gt;, with no &lt;code&gt;raw&lt;/code&gt; option here, which makes sense given that the response is already a parsed HTML page rather than a Google results page.&lt;/p&gt;

&lt;p&gt;Failures behave like the rest of the platform: the same credits, and a failure keeps the JSON error envelope. The error codes you will see are the invalid-request, insufficient-credits, rate-limited and upstream ones, and the rate-limited case tells you how long to wait. None of them are charged (checked 2026-11-25, &lt;a href="https://serpbase.dev/docs/duckduckgo_search" rel="noopener noreferrer"&gt;https://serpbase.dev/docs/duckduckgo_search&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;One detail for a fallback path specifically: since failures keep the JSON envelope regardless of the requested format, the error check is the same code you already wrote for the Google endpoints. That is the one place where a shared client is genuinely easy.&lt;/p&gt;

&lt;h2&gt;
  
  
  A fallback worth having, with one caveat
&lt;/h2&gt;

&lt;p&gt;If the goal is "when Google returns nothing useful, ask someone else", DuckDuckGo is the only option available today and it costs the same as the original call. The code change is small for the first page and moderate if you need to page.&lt;/p&gt;

&lt;p&gt;The caveat is that a second engine is not a second opinion on the same corpus. It is a different index with different coverage, so a disagreement between the two is not evidence that one of them is wrong. Treat it as additional evidence rather than as a tiebreaker, and the fallback stays honest.&lt;/p&gt;

&lt;p&gt;Endpoint documentation, including the sample response with the &lt;code&gt;html.duckduckgo.com&lt;/code&gt; search URL, is at &lt;a href="https://serpbase.dev/?utm_campaign=ops-222e35a2a81a&amp;amp;utm_medium=outreach&amp;amp;utm_source=opsbot" rel="noopener noreferrer"&gt;https://serpbase.dev/?utm_campaign=ops-222e35a2a81a&amp;amp;utm_medium=outreach&amp;amp;utm_source=opsbot&lt;/a&gt;&lt;/p&gt;

</description>
      <category>search</category>
      <category>api</category>
      <category>privacy</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
