Parse a user-agent string
Changed onParses a user-agent string into a structured record: client (with its type, version, maker, rendering engine, and browser-family flags), the operator the traffic acts for, os, device, and classification flags like is_bot and is_ai_crawler. Supply the string via the ua query parameter, or omit it to parse the request's own User-Agent header ("what browser am I?"). Parsing is first-party: the strings you submit are never forwarded to a third-party service. A leaf the string doesn't reveal ships as null, and a block whose every leaf resolved null collapses to a single null (os, client.engine, operator, and any maker), so guard those before reading into them. See https://restcountries.com/docs/user-agent for the full reference.
Request
- Base URLhttps://api.restcountries.com
- Auth
- HTTP bearer
- or API key in query parameter api-key
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Query parameters
User-agent string to parse. Values may be sent raw, percent-encoded, or with + for spaces; a + is always read as a space. Omit it to parse the request's own User-Agent header. Strings longer than 2,048 characters are rejected with HTTP 400 (user_agent.ua_too_long).
Comma-separated dot-path projection. Only the specified fields are returned. Example: names.common,codes.alpha_2,flag.emoji
Comma-separated dot-path blocklist. The specified fields are removed from the response. Useful for trimming heavy branches like names.translations.
Set to true (a bare ?pretty, 1, or true) to pretty-print the JSON response; 0 or false keep it minified. Default is minified.
Response
Parse record for the resolved user-agent string, always a single object.
Changes
- warning
for the
queryrequest parameterua, the maxLength was set to2048 - info
added the optional property
/////to the response with the status - info
added the optional property
//////to the response with the status - info
added the optional property
//////to the response with the status - info
added the optional property
/////to the response with the status - info
added the optional property
////to the response with the status - info
added the optional property
/////to the response with the status - info
added the optional property
/////to the response with the status - info
added the optional property
////to the response with the status - info
added the optional property
/////to the response with the status - info
added the optional property
/////to the response with the status - info
added the optional property
////to the response with the status - info
added the optional property
////to the response with the status - info
added the optional property
////to the response with the status - info
added the optional property
/////to the response with the status - info
added the optional property
/////to the response with the status - info
added the optional property
////to the response with the status - info
the response property
//became required for the status - info
the response property
//became required for the status - info
the response property
//became required for the status - info
the response property
//became required for the status - info
the response property
//became required for the status - info
the response property
//became required for the status - info
the
//response's property pattern^[a-z_]+\.[a-z0-9_]+$was added for the status - info
the
//response's property pattern^[a-z_]+\.[a-z0-9_]+$was added for the status - info
the
//response's property pattern^[a-z_]+\.[a-z0-9_]+$was added for the status - info
the
//response's property pattern^[a-z_]+\.[a-z0-9_]+$was added for the status - info
the
//response's property pattern^[a-z_]+\.[a-z0-9_]+$was added for the status - info
the
//response's property pattern^[a-z_]+\.[a-z0-9_]+$was added for the status
- warning
- info
endpoint added
- info