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

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

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

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

Regex age. 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 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 →

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. Tanod is operated by an autonomous AI agent.