Parser API
A single JSON endpoint that parses any user agent string. No key, no sign-up, CORS enabled.
Endpoints
| Method | Path | Does |
|---|---|---|
GET | /api/me | Parses the caller's own User-Agent header |
GET | /api/parse?ua=<string> | Parses a URL-encoded string you supply |
POST | /api/parse | Parses {"ua": "..."} from a JSON body |
Quick start
# What am I?
curl https://useragent.in/api/me
# Parse a specific string
curl -G https://useragent.in/api/parse \
--data-urlencode "ua=Mozilla/5.0 (iPhone; CPU iPhone OS 18_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.2 Mobile/15E148 Safari/604.1"
# POST a batch of one
curl -X POST https://useragent.in/api/parse \
-H "Content-Type: application/json" \
-d '{"ua":"curl/8.11.1"}'
Response shape
{
"ok": true,
"ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_2 like Mac OS X) ...",
"browser": { "name": "Safari", "version": "18.2", "major": "18" },
"engine": { "name": "WebKit", "version": "605.1.15" },
"os": { "name": "iOS", "version": "18.2" },
"device": { "type": "mobile", "vendor": "Apple", "model": "iPhone" },
"cpu": { "architecture": "arm64", "bitness": "64" },
"bot": { "isBot": false },
"flags": { "isMobile": true, "isWebView": false, "isBot": false, ... }
}
Errors return HTTP 400 with {"ok": false, "error": "..."}. Every field except ok and ua may be null when the string does not carry that information.
Using it from JavaScript
const res = await fetch('https://useragent.in/api/parse?ua=' +
encodeURIComponent(someUserAgent));
const data = await res.json();
if (data.ok && data.bot.isBot) {
console.log(`${data.bot.name} — ${data.bot.category}`);
}
Or skip the API entirely
The parser is a single dependency-free file with no build step. For anything client-side, running it locally is faster than a round trip and works offline:
<script src="https://useragent.in/assets/js/ua-parser.js"></script>
<script>
const result = UAParser.parse(navigator.userAgent);
console.log(result.browser.name, result.os.name);
// Or parse the live browser with Client Hints merged in
UAParser.parseCurrent().then(r => console.log(r));
</script>
It also works under Node and any CommonJS or AMD loader.
Fair use
There is no API key and no hard rate limit, but this runs on shared hosting. Please cache results — user agents map to the same parse forever — and keep sustained request rates modest. If you need volume, download the parser and run it yourself; it is the same code the API executes.
Frequently asked questions
Is the API free?
Yes, with no key and no sign-up. It is offered for reasonable use, and the parser file is available to download and self-host if you need more throughput than shared hosting can reasonably provide.
Does the API log user agents?
The endpoint itself does not write any log of its own. Standard web server access logs exist as they do for any request, and they are not used for anything beyond diagnosing errors. If that matters to you, run the parser locally instead — it produces identical results without any request.
Can I use the parser in a commercial product?
Yes. Both the parser and the dataset are free to use, including commercially. Attribution is appreciated but not required.
Why is there both an API and a JavaScript file?
They serve different situations. Use the JavaScript file for anything running in a browser or in Node — it is faster, works offline, and involves no network dependency. Use the API when you are calling from a language or environment where embedding JavaScript is impractical, such as a shell script or a database function.