Snail.Toolkit.Web.Search.Browser
Generated from the compiler's documentation by dotnet run --project docs/generator -- docs. Editing this file by hand is lost on the next build; edit the remark in the source instead.
The public surface of this package: 8 types. Everything else it contains is internal and is described under Decisions where it carries a measurement.
Bing
Asks Bing through a real browser.
The same engine this library already asks over plain HTTP, read the way that works. Measured on 2026-09-15 from a datacentre address, five queries each, the queries written in Russian and quoted here in English: over HTTP the engine answered «"Rusnano"» with bible sites, «Rusnano» with a hotel chain, «Rosnano» in Latin letters with Zurich tourism and «QIWI Bank licence revoked» with car parts — ten confident results per query, about something else entirely. Through a browser the same address answered «Rusnano» with the Rusnano Group, the Wikipedia article and the company's own press centre, three times out of three, and «QIWI Bank licence revoked» with «Licence for banking operations revoked from…» and «What is known about the revocation of QIWI Bank's licence».
THE FIRST READ IN A FRESH CONTEXT IS THE UNRELIABLE ONE. Of three queries measured three times each, two failed on their first attempt — one with an empty page, one with a navigation that never settled — and answered properly on the second and third. That is why the page is taken whole rather than as the document alone: DocumentOnly was measured too, and it returned the stale or wrong page where the full load returned the right one.
Every result link is wrapped in the engine's own redirect — /ck/a?…&u=a1<base64url> — and unwrapping it costs nothing, unlike Google's /goto, which has to be asked where it leads. The address is inside the wrapper, base64url after the two-character marker.
ProviderName — The name this provider is registered and configured under.
BingOptions
Which Bing front end is asked.
Domain — Gets or sets the host the query is sent to, without a scheme.
A setting rather than a constant for the same reason Brave's is: the engine runs regional front ends, and which one answers is a deployment decision. Interface language and region are not settings here — they come from the identity the page is fetched under, which is the only way they cannot contradict the user agent beside them.
SectionName — The configuration section this binds from.
Brave
Asks Brave through a real browser.
Measured against nine engines on 2026-09-12 from a datacentre address: this one answered where the others would not. Google returned a captcha both by address and through its own form, Ecosia refused outright, Yandex answered once and then demanded a captcha on the next two attempts, and Mojeek and Startpage named nothing at all. Brave returned a hundred links across twenty-six sites and did it without wrapping them — Bing and the DuckDuckGo endpoint both hide their results behind a redirect of their own, which has to be unwrapped before a link is a link.
That is the whole reason this class is short: what differs per engine is the address a query becomes and the markup it comes back as, and here neither needs any unwrapping.
It also counts requests rather than pages, and for a while that looked like a refusal. On 2026-09-14 the address it had answered with a hundred links was met with 429 on every attempt, and the signature looked like the cause: a Gecko user agent was answered twice out of four while Chrome, Safari and an unsigned client were refused outright. The real cause was cheaper and entirely ours. One ordinary page load here costs 71 to 73 requests, and the budget was being spent inside it: measured with the arms alternating and a fresh context each, the full page was refused three times out of three while the document alone was answered three times out of three, carrying all eighteen results. Hence DocumentOnly below — not a way around the engine, but the amount of it we actually needed.
ProviderName — The name this provider is registered and configured under.
BraveOptions
Which Brave front end is asked.
Domain — Gets or sets the host the query is sent to, without a scheme.
A setting rather than a constant for the same reason Google's is: the engine runs more than one front end, and which one answers is a deployment decision. Interface language and region are not settings here — they come from the identity the page is fetched under, which is the only way they cannot contradict the user agent beside them.
SectionName — The configuration section this binds from.
BrowserSearch
A search engine that only answers a real browser.
Google is not alone in this: Bing, Yandex, Brave and Baidu all meet a plain HTTP client with a consent wall or a challenge, and every one of them then needs the same handling — read the page with a browser, tell a refusal from a page that merely could not be read, drop the links that are the page's own furniture, and say so when a page that loaded fine parsed into nothing. Only two things differ per engine: the address a query becomes, and the markup it comes back as. Those are what a subclass supplies.
How the page is obtained is left to the engine, because the two ways differ in more than an address. An engine that answers a link is read through IPageReader; one that answers only a form filled in by hand is walked through by the page agent. Measured on 2026-09-13, that is not a preference: asked at its results address Google answers /sorry/ and asked through its own form it returns results, with a passing control on either side of the refusal. Either way the engine inherits the per-host gate, the coherent identity, the stealth script, challenge detection and the retry policy instead of restating them.
An engine is a type of its own rather than a configured instance because that is what lets it be registered with AddSearchProvider<T>() and stay idempotent: a factory registration could not be deduplicated and a second call would ask the same engine twice per query.
FindAsync — no summary
Bounded by Timeout, the same setting that bounds an engine asked over HTTP. Until 2026-09-20 it bounded only those: it was wired into the HTTP client's pipeline and nowhere else, so a browser engine lasted as long as its navigation timeouts times its retries — a consumer measured 136 to 392 seconds against a one-minute setting. Running out of it is a fault, as it is over HTTP, and a cancellation by the caller stays a cancellation.
Host — no summary
The same host the engine is read at, said once more where the search can see it: a caller weighing what a query costs asks the gate about this, and an engine driven through a browser is the expensive kind.
DuckDuckGo
Asks DuckDuckGo through a real browser, at the site a person uses.
Beside the provider that reads the HTML endpoint over plain HTTP, not instead of it: that one needs nothing running and answers from most addresses. This one is for the addresses it does not answer. Measured on 2026-11-07 from one such address, one query per arm with a plain request first and last as the control:
- a plain request to the HTML endpoint —
202and the challenge, both times; - Firefox at the HTML endpoint — the same challenge;
- stock headless Chromium at the site — sent to
/static-pages/home-error/418.html, twice; - Firefox at the site — ten results, four times out of four, two of them a query in Russian.
From another address the plain request answered the same query with results, so the refusal belongs to the address and not to the query.
So the site, read whole: its results are drawn by script after the document has loaded — none was in the document at DOMContentLoaded, and the first appeared 340 to 870 ms after it — which is why the reader is asked to wait for the first result rather than take the page at the document.
Its result links are the addresses themselves. The HTML endpoint wraps every one in a redirect of its own; the site does not, and there is nothing to unwrap.
It shares its type name with DuckDuckGo, as Bing and Brave are named after their engines; the namespace says which reading it is. Code that imports both namespaces names one of them in full or through an alias — using DuckDuckGoBrowser = Snail.Toolkit.Web.Search.Browser.DuckDuckGo;. Only ProviderName has to differ, and does.
ProviderName — The name this provider is registered and configured under.
Not DuckDuckGo, which names the provider over HTTP, though the type names are the same: the search keeps an engine's rest and its settings under this string, and the two readings are refused and answered separately — a challenge to the HTTP endpoint must not rest the browser, which is there for exactly that.
DuckDuckGoOptions
Which DuckDuckGo front end the browser asks.
Domain — Gets or sets the host the query is sent to, without a scheme.
The site itself rather than its HTML endpoint, because that is the whole point of reading it with a browser: the endpoint answers a browser with the same challenge it shows a plain request. A setting rather than a constant for the reason Brave's is — which front end answers is a deployment decision.
SectionName — The configuration section this binds from.
ServiceCollectionExtensions
Registers the search providers that need a real browser.
AddBing — Adds Bing, which answers a browser and not a plain request.
THE ONLY READING OF THIS ENGINE THERE IS, since 2026-09-20. It used to take the place of an HTTP provider of the same name, and this method carried the code that removed that one from the registrations; the owner had it deleted instead, so there is nothing left to displace.
Why it was deleted rather than kept for deployments without a browser: measured on 2026-09-15 from a datacentre address, the HTTP reading answered four Russian queries out of five with ten confident results about something else — bible sites for «Rusnano» (in Russian), a hotel chain, Zurich tourism, car parts — while the same address read through a browser answered with the company, its Wikipedia article and the news about its licence. A provider that keeps the shape of an answer while saying nothing is worse than a provider that is absent: absence is visible in the report.
AddBrave — Adds Brave, read at its own results address.
Registered beside Google rather than instead of it, because which engine answers a given client from a given address is a fact that changes: measured on 2026-09-12 Brave answered and Google did not, and on 2026-09-14 Brave answered 429 from the same address while Google returned six results. The aggregator is where that stops mattering. Each provider costs a page load, so a deployment that wants only one of them adds it on its own instead of taking the set.
Pulls in search and the page reader rather than assuming them, so that saying one thing is enough — the same way AddGoogle does in the package next door. Until 2026-09-14 this method registered the provider alone, so a deployment that took the remark above at its word built a container that resolved Brave into an IPageReader nobody had registered. That failure arrives on the first query rather than at startup, because validation checks settings and not the graph.
AddBrowserSearch — Registers search with the browser-backed providers included.
Pulls in both halves deliberately: browser search is HTTP search plus a page reader, and a consumer that asked for it wants the HTTP providers alongside rather than instead. Both registrations are idempotent, so calling them again elsewhere costs nothing.
Google is not here. It answers a form rather than an address — measured on 2026-09-13, its results address returns /sorry/ where its own form returns results — and walking a form needs the page agent, which this package deliberately does not depend on. It ships in Snail.Toolkit.Web.Search.Browser.Agent, and a deployment that wants both adds that one too.
AddDuckDuckGo — Adds DuckDuckGo read through a browser, at the site a person uses.
Not part of AddBrowserSearch, and on purpose: search registers the HTTP reading of the same engine already, and from an address it answers that one costs a request where this one costs a page load. This is for the address it refuses — measured on 2026-11-07, one that met the HTTP endpoint with a challenge every time was answered by the site in Firefox every time. A deployment in that position adds this and, if it likes, leaves the HTTP reading out.