/ua User-Agent Parser
Break a User-Agent string down into browser, operating system, rendering engine and device class. Parses whatever UA you send — pass one with -A to decode an arbitrary string.
curl -A "$UA" curlhub.sh/ua
Usage
With curl
curl curlhub.sh/ua
curl -A "Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X)..." curlhub.sh/ua
With the CLI
curlhub ua
Structured output for scripts
curl -s curlhub.sh/ua -H 'Accept: application/json'
Output
curl -A "$UA" curlhub.sh/ua
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) Chrome/120.0
Browser: Chrome 120
OS: macOS
Engine: Blink
Device: desktop
Parameters
| Input | What it does |
|---|---|
-A "string" | Set the User-Agent to parse an arbitrary string, not just your own. |
Accept: application/json | Return {browser, os, engine, device} as JSON. |
Recipes
Decode a UA from a log line
curl -A "$(grep -oP '"\K[^"]+(?=" *$)' access.log | tail -1)" curlhub.sh/ua
Check how a bot identifies
curl -A "Googlebot/2.1 (+http://www.google.com/bot.html)" curlhub.sh/ua