Glossary

User agent

A user agent is the software that makes a web request on someone’s behalf, and the User-Agent header is the string it sends to identify itself to the server.

A user agent is the software that makes a request to a web server on behalf of a person or a program: a browser, a mobile app, a command-line tool, a search engine crawler or an AI agent. In everyday use the term usually means the User-Agent header, a line of text that the client sends with each HTTP request to say what it is, for example a particular version of Chrome on macOS or a named crawler with a link to its documentation. Servers use it to adapt content, gather statistics, apply robots.txt rules and spot automated traffic. For anyone doing web scraping or running a web crawler, choosing and sending an honest user agent is part of basic etiquette.

How the User-Agent header works

HTTP defines User-Agent as an optional request header. Its value is a list of product tokens, each a name and an optional version separated by a slash, with comments in brackets for extra detail. A simple client might send curl/8.5.0. A crawler might send ExampleBot/2.1 (+https://example.com/bot), where the bracketed URL tells site owners what the bot is and how to contact its operator. The server reads the header, may log it, and may change its response based on it.

Browser strings are much longer and stranger, for historical reasons. In the 1990s, sites served richer pages only to Netscape, whose browser identified itself as Mozilla. Other browsers began claiming to be Mozilla-compatible so they would receive the same pages, and each new browser added the tokens of the one it wanted to be treated like. The result is that a current Chrome string still begins with Mozilla/5.0 and mentions AppleWebKit, KHTML, Gecko and Safari, none of which describes Chrome accurately. A typical desktop string reads roughly Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36.

Client

Example User-Agent value

What it tells the server

Desktop browser

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36

Browser family, major version and platform

Search crawler

Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)

A named crawler and where to verify it

HTTP library

python-requests/2.32.3

A script using a default library setting

Custom bot

AcmeMonitorBot/1.0 (+https://acme.example/bot)

Who runs it and how to reach them

Headless browser

Mozilla/5.0 … HeadlessChrome/131.0.0.0 …

Automation, unless the string is overridden

The version numbers in the table are illustrative. Browsers update every few weeks, so any fixed string goes stale quickly.

User-Agent reduction and client hints

The full browser string leaks a fair amount about the user’s device and helps with fingerprinting, so browser vendors have been trimming it. Chrome’s User-Agent reduction, rolled out from 2022, freezes the minor version numbers and reduces platform detail to a fixed set of values. Sites that need more detail can ask for it with User-Agent Client Hints: the browser sends low-detail headers such as Sec-CH-UA and Sec-CH-UA-Mobile by default, and the server can request higher-detail hints, such as the full version or device model, with an Accept-CH response header. Firefox and Safari have taken different approaches to reduction, and neither supports client hints in the way Chrome does.

For scrapers and crawlers this has two effects. Parsing the User-Agent string for exact versions is less reliable than it was. And a client that claims to be a recent Chrome in its User-Agent but sends no matching client hints headers is easy to tell apart from a real browser.

How sites use the user agent

Sites use the header for four broad purposes. The first is content negotiation in the loose sense: serving a mobile layout, warning about an unsupported browser, or offering the right download for an operating system. Feature detection in JavaScript is now the recommended way to do this, but user agent checks remain common.

The second is analytics. Logs and analytics tools group traffic by browser, platform and device, and filter out known bots so that reports reflect people.

The third is crawler policy. robots.txt groups are addressed to user agent tokens, so a crawler reads the group whose token matches its own name. Sites also allow or block named crawlers at the server or CDN, and verify that a request claiming to be a well-known search crawler really comes from that operator, usually with a reverse DNS lookup or a published list of IP ranges.

The fourth is defence. Anti-bot detection treats the user agent as one weak signal among many. Default library strings such as python-requests are often blocked outright. More sophisticated systems compare the claimed browser with other evidence: whether the TLS handshake and HTTP/2 settings match that browser, whether client hints are present and consistent, whether the header order looks right, and how the page’s JavaScript behaves. A mismatch between what the client says and how it behaves weighs more heavily than the string itself.

User agents for scrapers, crawlers and AI agents

Every automated client sends some user agent, even if only a library default. The choices fall into three groups.

An honest bot string names the operator and links to a page explaining the bot, as major search engines and AI crawlers do. It lets site owners make an informed decision, target the bot in robots.txt, and contact you if something goes wrong. It may also get blocked by sites that do not want automated traffic, which is their decision to make.

A default library string, such as the one sent by an HTTP client out of the box, identifies nothing useful and is widely blocked. It is the worst of both options: it neither explains the bot nor resembles a browser.

A browser string borrowed by a script is common in scraping, and it is where practice and principle diverge. A headless browser driven by browser automation is, technically, a browser, and sending a browser string is accurate in a narrow sense. Sending a browser string from a plain HTTP client to avoid a block is impersonation, and pairing it with proxy rotation and residential proxies to evade detection is the pattern that drives sites to stricter defences and creates legal exposure. Whether a given collection is acceptable depends on more than the header, as discussed in is web scraping legal.

AI agents add a new case. A browser agent or computer use agent acting for a specific user may send that user’s browser string, while the same company’s training crawler sends a named bot token. Several providers now publish separate tokens for training crawlers and for user-initiated fetching, and site owners increasingly want to tell the two apart. The broader question of how agents should identify themselves is covered under agent identity.

A worked example

A team builds a service that fetches product pages from 40 retailers each morning to check prices. The first version uses a default HTTP library string. Within a week, 15 retailers return 403 errors or challenge pages, because their bot management blocks unidentified library traffic, and two more start returning HTTP 429 as the service retries too quickly.

The team changes three things. It switches to a named string, PriceCheckBot/1.0, with a link to a page describing the service, its schedule and an opt-out address. It reads each retailer’s robots.txt and drops the four that disallow its token or all bots. And it spaces requests to one every few seconds per site, with rate limiting on its own side. Of the 15 blocked retailers, several now allow the named bot; two offer a product feed instead, which is more reliable than scraping, a trade-off covered in web scraping vs API; and the rest remain blocked, which the team accepts. The service ends up with fewer pages but stable access and no evasion to maintain. The numbers here are illustrative.

Common mistakes

Hard-coding a browser string and never updating it is the most frequent mistake: a scraper still claiming Chrome 90 years later is conspicuous. Others include sending a desktop string while requesting mobile pages, forgetting that a headless browser announces itself as HeadlessChrome unless configured otherwise, and claiming to be Googlebot, which is easy for sites to check by IP and almost always leads to a block. On the server side, relying on the user agent alone for security is a mistake, since the header is trivially set by the client.

Where Exabase fits

Exabase handles fetching for the URLs you submit, so your application does not manage user agent strings, browser versions or rendering. Extract fetches a public page, renders JavaScript where the page needs it, and returns the title, site name and content as text chunks, which avoids the JavaScript rendering and dynamic content problems a plain HTTP client meets. The Link Preview API fetches a page’s Open Graph data and image synchronously, follows redirects, and returns richer data for providers such as YouTube and Amazon; the link preview guide and the link preview endpoint describe the request. Pages are fetched as public pages, so content behind a login returns the login page or an error.

Exabase is the fetching and extraction substrate here, not a way around a site’s policy. Which sites you collect from, and whether their robots.txt and terms permit it, stays with your team. For storing what you collect, Resources indexes bookmarked pages for Deep Search. For comparisons with browser infrastructure and preview services, see Exabase vs Browserbase, Exabase vs Microlink and the best link preview APIs. The browser agents use case covers agents that act in a browser and need somewhere to keep what they read.

Frequently asked questions

What is my user agent?

It is the User-Agent string your browser sends with every request, describing the browser, its major version and your platform. Browser developer tools show it under the Network tab in the request headers.

Why do all browsers say Mozilla in the user agent?

Because of 1990s compatibility workarounds. Sites served better pages to Netscape, which called itself Mozilla, so other browsers copied the token to receive the same pages, and it has stayed ever since.

What are User-Agent Client Hints?

They are a set of Sec-CH-UA request headers that let a server ask Chrome-based browsers for specific details, such as full version or platform, instead of reading everything from one long string.

Can websites block a user agent?

Yes. Servers and CDNs can refuse requests from named strings, default library strings or any token they choose, and robots.txt lets them ask named crawlers to stay away.

Should a web scraper use a browser user agent?

A bot that fetches pages directly should identify itself with a named string and a contact URL. Sending a browser string to avoid blocks is impersonation and often breaks a site’s terms; see anti-bot detection.

Is the user agent enough to identify a bot?

No. The header is set by the client and easy to change, so detection systems combine it with TLS fingerprints, client hints, IP reputation and behaviour.

Do I need to set a user agent when using Exabase?

No. Extract and the Link Preview API fetch the URLs you submit themselves, so your code sends only an API request with your key.

Related pages: robots.txt, Anti-bot detection, Proxy rotation, Headless browser, Browser automation, Web crawler, Screen scraping, Link preview API, Best web scraping APIs

Cut your token spend and give your agent precise context.

Get started in minutes.

Cut your token spend and give your agent precise context.

Get started in minutes.