User Agent Parser API

Parse any User-Agent string into browser, engine, OS, device type, vendor and model, and detect bots and crawlers. No UA given? It parses your own.

GETPOSThttps://apibox.io.vn/v1/user-agent
Developer utilities▶ Try it online

The User Agent API turns a raw User-Agent header into structured data: browser name, version and major version, rendering engine, operating system and version, device type, vendor and model, and CPU architecture when present. Simple booleans – is_mobile, is_tablet, is_desktop and is_bot – make it easy to branch in your code.

Pass the string in ua (or user_agent) via query or JSON. If you omit it, the API parses the User-Agent of the request itself, which is handy for a quick “what is my browser” check from a browser or a script.

Bot detection matches common crawlers, link-preview fetchers and HTTP clients (Googlebot, Bingbot, facebookexternalhit, Slack, Discord, Telegram and WhatsApp previews, curl, wget, python-requests, axios, headless browsers, Lighthouse, uptime monitors). Parsing is based on the open-source ua-parser-js library.

Parameters

NameInTypeRequiredDefault
uabody|querystringnoUser-Agent string to parse (alias user_agent). Default: the request’s own User-Agent header.

Example

curl "https://apibox.io.vn/v1/user-agent?ua=Mozilla%2F5.0%20(iPhone%3B%20CPU%20iPhone%20OS%2017_5%20like%20Mac%20OS%20X)%20AppleWebKit%2F605.1.15%20(KHTML%2C%20like%20Gecko)%20Version%2F17.5%20Mobile%2F15E148%20Safari%2F604.1" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Mobile/15E148 Safari/604.1",
  "browser": {
    "name": "Mobile Safari",
    "version": "17.5",
    "major": "17"
  },
  "engine": {
    "name": "WebKit",
    "version": "605.1.15"
  },
  "os": {
    "name": "iOS",
    "version": "17.5"
  },
  "device": {
    "type": "mobile",
    "vendor": "Apple",
    "model": "iPhone"
  },
  "cpu": null,
  "is_bot": false,
  "is_mobile": true,
  "is_tablet": false,
  "is_desktop": false
}

Use cases

  • Enrich analytics events with browser, OS and device data
  • Filter bots and link-preview crawlers out of visit statistics
  • Debug customer issues from the User-Agent in support logs
  • Serve device-specific content or download links

FAQ

How do I detect if a visitor is a bot?

Send their User-Agent in ua and check is_bot. Detection is pattern based (crawlers, preview fetchers, HTTP libraries, headless browsers); a bot that fakes a normal browser UA will not be detected.

Can I parse the User-Agent of my own request?

Yes, call /v1/user-agent without parameters and the API parses the User-Agent header it received.

Why is device type "desktop" when vendor and model are null?

Desktop browsers do not announce a device model, so the API falls back to desktop when the UA is not a bot and does not contain "Mobile".

Related APIs

Start with 1,000 free requests every month. Get free API key →