Skip to content

User-Agent Parser ​

The /agent endpoint parses a User-Agent string and returns structured information about the browser, operating system, device, rendering engine, and whether the client is a bot. If no UA is provided, the request's own User-Agent header is used.

Use Cases

Detect the browser and OS of your visitors, identify bots and crawlers, serve device-specific content (mobile vs desktop), or log structured client metadata from raw User-Agent strings.

Parameters ​

ParameterRequiredDescription
uaNoRaw User-Agent string to parse. Defaults to the request's User-Agent header.

Response Fields ​

FieldTypeDescription
rawstringThe original User-Agent string
browser.namestringDetected browser name (e.g. Chrome, Firefox, Safari)
browser.versionstringFull browser version
browser.majorstringMajor version number only
os.namestringOperating system name (e.g. macOS, Windows 10/11, iOS)
os.versionstringOS version string
device.typestringDevice category: desktop, mobile, or tablet
device.vendorstringDevice manufacturer (e.g. Apple, Samsung, Google)
engine.namestringRendering engine (e.g. Blink, Gecko, WebKit)
engine.versionstringEngine version
botbooleantrue if the UA matches a known bot or crawler pattern

Code Examples ​

curl -X GET \
  "https://api.sylvain.sh/v6/agent"

Try It ​

Error Handling ​

Error MessageDescription
A User-Agent string is required.The ua parameter is empty and no User-Agent header was sent