← Our tools

Detect user agent

The user agent request header contains a characteristic string that allows the network protocol peers to identify the application type, operating system, software vendor or software version of the requesting software user agent.

What is a user agent?

Everyone that is browsing the web right now has a user agent. It's the software that acts as the bridge between you, the user, and the internet. It's easiest to understand user agents if we backtrack and look at the evolution of the web, so we can understand the benefits of user agents.

When the internet was a text-based system, right back at the beginning of its use, users had to type commands to navigate and send messages. Now, we have browsers to do that for us. We simply point and click, and the browser is acting as our "agent," turning our actions into commands.

When your browser (or similar device) loads a website, it identifies itself as an agent when it retrieves the content you've requested. Along with that user agent identification, the browser sends a host of information about the device and network that it's on. This is a really set of data for web developers, since it allows them to customize the experience depending on the user agent that's loaded the page.

User agents types

Browsers are a straightforward example of a user agent, but other tools can act as agents. Crucially, not all user agents are controlled or instructed by humans, in real time. Search engine crawlers are a good example of a user agent that is (largely) automated — a robot that trawls the web without a user at the helm.

Here's a list of some of the user agents you'll encounter:

  • Browsers: Including Internet Explorer, Firefox, Safari, Chrome, Edge, BlackBerry, Opera, Minimo, Beonex and the AOL browser.
  • Crawlers: Google, Google Images, Yahoo! Slurp, and hundreds more.
  • Consoles: PlayStation 3, Wii, PlayStation Portable and Bunjalloo — the Nintendo DS' built-in browser.
  • Legacy operating systems (for example, AmigaVoyager).
  • Offline browsers and similar (for example, Wget and Offline Explorer).
  • Link checkers (for example, W3C-checklink).
  • Plus a whole range of feed readers, validators, cloud platforms, media players, email libraries, and scripts.

User agent spoofing

Using user agent strings to control how a site behaves is not completely a fool-proof method, because some user agents are not what they seem.

It's possible to send a fake user agent, a process known as "spoofing." This can be used for innocent purposes — like usability, or testing. It can also be used to manipulate content or impersonate another device maliciously.

  • On the positive side, many browsers can identify themselves as other browsers, for compatibility or development purposes. The browser on Android devices is set to spoof Safari to avoid problems when loading content, and the Dolphin browser on Android has a very useful desktop spoofing mode.
  • On the negative side, spoofing can be used maliciously. For example, a script could spoof a regular web browser in order to clone content without being detected as a malicious, automated tool. A robot could also impersonate a different user agent to get around robots.txt restrictions, or to disguise repeated visits.

If you see strange visitor behavior, and you suspect it's a spoofed user agent or malicious crawler, the best thing to do is to block the IP address to be absolutely sure it can't visit your site.

© 2001- NFINITY Web Solutions. All rights reserved. Privacy policy