User Agent String

User Agent Parser API · No API Key Required · Works Globally for any browser and device

TL;DR

What it does: Takes any browser user agent string and returns structured information: browser name, browser version, OS, OS version, device type (mobile/desktop/tablet), and whether the agent is a real browser, a bot, or a crawler.

Why use it: Understand what browsers, operating systems, and devices your visitors use. Essential for analytics, browser fingerprinting, bot filtering, device-aware rendering, and debugging cross-platform issues.

Quick start: curl "http://www.useragentstring.com/?uas=Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36&getJSON=all"

No API key required — just pass your user agent string as a query parameter.

Overview

User agent parsing is the process of extracting meaningful information from the User-Agent HTTP header that browsers and other HTTP clients send with every web request. This string encodes the client software name, version, operating system, and device architecture, but its freeform format makes reliable extraction difficult without a dedicated parser. The useragentstring.com API solves this by accepting any raw user agent string and returning clean, structured JSON with the browser name (Chrome, Firefox, Safari, Edge, etc.), browser type (Browser, Bot, App), OS name and version (Windows 10, macOS 14, Android 14, iOS 17), device classification, and additional metadata. This is particularly useful for server-side analytics, browser fingerprinting analysis, bot detection pipelines, and building device-aware web experiences that adapt content for mobile, tablet, or desktop visitors.

Try It Now

Here's the exact URL to call and the real response for a Chrome-on-Windows user agent:

http://www.useragentstring.com/?uas=Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/120.0.0.0+Safari/537.36&getJSON=all
Try This URL Now →
{
  "agent_type": "Browser",
  "agent_name": "Chrome",
  "agent_version": "120.0.0.0",
  "os_type": "Windows",
  "os_name": "Windows 10",
  "os_versionName": "",
  "os_versionNumber": "",
  "os_producer": "",
  "os_producerURL": "",
  "linux_distibution": "Null",
  "agent_language": "",
  "agent_languageTag": ""
}

Field Explanations

The JSON response contains the following fields that describe the parsed user agent:

agent_type
Classification of the user agent: Browser for web browsers like Chrome or Firefox, Bot for search engine crawlers and automated scrapers, or unknown for unrecognized clients. This is the primary field for bot detection and traffic filtering.
agent_name
The detected browser or client name, such as Chrome, Firefox, Safari, Edge, Opera, or unknown. Enables browser-specific feature detection and compatibility handling.
agent_version
The version number of the detected browser, e.g. 120.0.0.0 for Chrome 120. Useful for checking feature support and showing upgrade warnings for outdated browsers.
os_type
The operating system family: Windows, MacOS, Linux, Android, iOS, or empty if unrecognized. Helps with platform-conditional content delivery.
os_name
Detailed operating system name, e.g. Windows 10, macOS 14, Android 14, iOS 17. More specific than os_type for targeting specific OS versions.
os_versionNumber
Numeric OS version string extracted from the user agent, such as 10.0 for Windows NT. May be empty if the version is embedded in the os_name field instead.
os_producer / os_producerURL
The organization that produces the operating system (e.g. Microsoft, Apple, Google) and a link to their website. Useful for attribution and vendor lookup.
linux_distibution
Name of the Linux distribution if the OS is Linux, e.g. Ubuntu, Debian, Fedora. Returns Null for non-Linux or unrecognized distributions.
agent_language / agent_languageTag
The language preference sent by the browser, e.g. en-US, fr-FR, or empty if the UA string does not include language information. Useful for localization strategies.

Code Examples

JavaScript Example

const ua = navigator.userAgent;
const url = `http://www.useragentstring.com/?uas=${encodeURIComponent(ua)}&getJSON=all`;

fetch(url)
  .then(res => res.json())
  .then(data => {
    console.log(`Browser: ${data.agent_name} ${data.agent_version}`);
    console.log(`Browser type: ${data.agent_type}`);
    console.log(`OS: ${data.os_name}`);
    console.log(`Device/OS family: ${data.os_type}`);
  })
  .catch(err => console.error('Parse failed:', err));

Python Example

import requests

ua_string = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
params = {"uas": ua_string, "getJSON": "all"}
url = "http://www.useragentstring.com/"

response = requests.get(url, params=params)
data = response.json()

print(f"Browser: {data['agent_name']} {data['agent_version']}")
print(f"Type: {data['agent_type']}")
print(f"OS: {data['os_name']}")

cURL Example

# Parse Chrome on Windows
curl "http://www.useragentstring.com/?uas=Mozilla/5.0+(Windows+NT+10.0)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/120.0.0.0+Safari/537.36&getJSON=all"

# Parse Firefox on macOS
curl "http://www.useragentstring.com/?uas=Mozilla/5.0+(Macintosh;+Intel+Mac+OS+X+14.0)+Gecko/20100101+Firefox/121.0&getJSON=all"

# Parse Safari on iPhone (mobile device detection)
curl "http://www.useragentstring.com/?uas=Mozilla/5.0+(iPhone;+CPU+iPhone+OS+17_0)+AppleWebKit/605.1.15&getJSON=all"

# Detect a bot/crawler
curl "http://www.useragentstring.com/?uas=Googlebot/2.1+(+http://www.google.com/bot.html)&getJSON=all"

Frequently Asked Questions

Is the user agent parser API free to use?
Yes. useragentstring.com is completely free with no API key required and no documented rate limits for reasonable use. Just pass your user agent string as a query parameter and get back JSON.
What information can I extract from a user agent string?
Browser name (Chrome, Firefox, Safari, Edge), browser version, browser type (Browser/Bot/App), OS name and version (Windows 10, macOS 14, Android 14), OS family (Windows/MacOS/Linux/Android/iOS), OS producer, Linux distribution, device classification, and language preferences. This covers browser detection, device detection for mobile/desktop/tablet, and bot/crawler identification.
Can it detect bots, crawlers, and automated tools?
Yes. The agent_type field identifies whether a user agent belongs to a real browser, a search engine bot like Googlebot, or an automated tool. This is invaluable for analytics systems that need to filter out non-human traffic.
What response formats are available?
?getJSON=all returns the complete JSON object with all fields. ?getJSON=os returns only OS-related fields. ?getJSON=agent returns only browser-related fields. You can also omit the parameter for an HTML result page.
Can I distinguish Chrome from Firefox or Safari?
Yes. The agent_name field explicitly identifies the browser as Chrome, Firefox, Safari, Edge, Opera, or others. This allows you to build browser-specific feature detection and compatibility logic.
Is this API fast enough for real-time use?
Yes, responses are typically under 100 ms. It is suitable for server-side user agent parsing on every request, though you may want to cache results for repeated user agents to reduce external HTTP calls.

API Details

Base URL
http://www.useragentstring.com/
Method
GET
Authentication
Not Required
Parameters
uas (user agent string to parse), getJSON (all, os, or agent)
Formats
JSON (getJSON=all), HTML (default), plain text
Documentation
http://www.useragentstring.com/
Category
Development
Geographic Coverage
Global — no regional restrictions

What You Can Build