How to parse a User-Agent string into browser, OS and device

Updated 2026-11-10

Use when an agent has a User-Agent string and needs the browser, OS, device and a bot flag.

From an MCP client, add https://tanod.dev/mcp and call parse_user_agent; its free daily calls are applied automatically, no key or signup.

POST a User-Agent string to /v1/useragent. It returns the browser family and version, the OS, the device, is_mobile and a heuristic is_bot with a reason.

Request

user_agent is 1 to 1,024 characters. Parsing uses the ua-parser library and the uap-core regexes.

curl, using the free tier
curl -s -X POST https://tanod.dev/v1/useragent \
  -H 'X-Tanod-Free: 1' -H 'content-type: application/json' \
  -d '{"user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.4 Mobile/15E148 Safari/604.1"}'

Response

Response (example from the API spec, trimmed)
{
  "browser": {
    "family": "Mobile Safari",
    "major": "17",
    "minor": "4",
    "version": "17.4"
  },
  "os": {
    "family": "iOS",
    "major": "17",
    "minor": "4",
    "version": "17.4"
  },
  "device": {
    "family": "iPhone",
    "brand": "Apple",
    "model": "iPhone"
  },
  "is_bot": false,
  "is_mobile": true,
  "length": 135,
  "source": {
    "library": "ua-parser 1.0.2",
    "regexes": "ua-parser-builtins 202610 (uap-core)",
    "license": "Apache-2.0",
    "url": "https://github.com/ua-parser/uap-python"
  },
  "note": "Parsed from the string the client sent; a User-Agent is self-rep…"
}

Limits and caveats

A User-Agent is whatever the client says it is, and is easy to fake. Do not use it for security decisions.

is_bot is a heuristic that covers declared crawlers, HTTP libraries and headless browsers. A bot that sends a browser string will not be flagged.

Very new browsers or devices may be reported with a generic family until the regex set catches up.

Chrome and other browsers have reduced the detail in their User-Agent strings, so the OS and device model can be generic.

Price and free allowance

USD 0.001 per call, paid in USDC on Base, Polygon, Solana, BNB Chain or Arbitrum with x402. 10 free calls per IP per UTC day with the header X-Tanod-Free: 1. The pool is shared with FX rates, QR codes, geocoding, public holidays and the other utility endpoints (phone, validation, text, hash, convert and similar). MCP tool: parse_user_agent at https://tanod.dev/mcp, where the free tier is automatic.

All endpoints →

Use it from Claude without writing code: in claude.ai or Claude Desktop, add https://tanod.dev/mcp/util?via=user-agent-parser-api as a custom connector (steps), then ask in plain words, for example "What browser and device is behind this User-Agent string: Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15." The free daily allowance is applied automatically over MCP. Beyond it a call needs an x402 payment, which these clients can make.

Related guides: IP address to ASN lookup API (network, org, abuse contact), How to check if a URL is allowed by robots.txt, How to parse a URL into domain, subdomain, path and query with an API. Back to tanod.dev or the guide index. Results are automated and heuristic.