Low-entropy and high-entropy hints
Client hints come in two groups, and the difference decides when a browser sends them.
- Low-entropy hints reveal little and go out with every HTTPS request without the site having to ask:
sec-ch-ua(brands and major versions),sec-ch-ua-mobileandsec-ch-ua-platform. - High-entropy hints are sent only after the site has asked for them in an
Accept-CH(orCritical-CH) response header. Examples aresec-ch-ua-full-version-list,sec-ch-ua-platform-version,sec-ch-ua-arch,sec-ch-ua-bitness,sec-ch-ua-modelandsec-ch-ua-wow64.
Chrome remembers an origin's Accept-CH and keeps sending the requested hints on later requests to it. The same opt-in rule applies to the device, network and preference hints, such as sec-ch-dpr, sec-ch-viewport-width, ect, rtt and sec-ch-prefers-color-scheme.
What sec-ch-ua contains
sec-ch-ua is a list of brand and version pairs: the browser engine (Chromium), the browser itself (for example Google Chrome) and one deliberately meaningless brand. That extra entry is a GREASE value. Its name, punctuation and position change between Chrome versions, so servers cannot rely on an exact header string. They are not random, though: Chromium derives them from the major version, so every Chrome of one version sends the same value. Take it from a real browser of that version or derive it with Chromium's algorithm; a value made by bumping the numbers in an older sec-ch-ua is one no Chrome has sent. It is also why questions about "Not A Brand" in sec-ch-ua keep coming up: the entry is expected, not an error.
Why anti-bot systems compare hints with the User-Agent
Since Chrome reduced the information in its User-Agent string, the exact version and platform details live in the client hints. That makes the two easy to cross-check:
- Version mismatch: the User-Agent claims one Chrome version,
sec-ch-uaanother. - Platform mismatch: the User-Agent says Windows,
sec-ch-ua-platformsays macOS, orsec-ch-ua-mobiledisagrees with the device. - Hints from the wrong browser: a Firefox, Safari or iOS User-Agent with client hints attached, or a desktop or Android Chrome User-Agent without them on an HTTPS request.
- Hints nobody asked for: a request that carries
sec-ch-ua-full-version-listto a site that never sentAccept-CHis a request no browser makes. - Stale values: hints hardcoded from an old browser capture drift away from the User-Agent you send today.
Getting client hints right in a request-based client
- Update the User-Agent,
sec-ch-uaandsec-ch-ua-platformtogether whenever you change the Chrome version. That is one of the Hyper Solutions core requirements. - Send the three low-entropy hints on every request, as Chrome does.
- Send high-entropy hints only to origins that asked for them in
Accept-CH, and keep sending them to those origins. - Keep Chrome's header order for the hint headers as well, and its letter case: over HTTP/1.1, Chrome sends the
sec-ch-uaheaders in lowercase whileUser-AgentandAcceptare Title-Case. - Take the values from the session, not from an old capture. The Hyper Solutions APIs return the client hints for the device each payload was generated for; the client hints docs explain which to send and when.
Client hints are one layer of the fingerprint. They have to match the TLS fingerprint and the rest of the request, which is why they matter for every form of request-based scraping.
Which browsers send them
User-agent client hints are a Chromium feature: Chrome, Edge, Opera and other Chromium-based browsers send them on desktop and Android, and only over HTTPS. Firefox and Safari do not, and neither does Chrome on iOS, which runs on WebKit.