Docs / User agent
Parse a User-Agent
Parses a User-Agent string you send in the body.
POST
/v1/user-agentimport { Client } from "@liveapiio/liveapi";
const client = new Client({ token: process.env.LIVEAPI_TOKEN });
const ua = await client.parseUserAgent("Mozilla/5.0");Request
Send Authorization: Bearer YOUR_TOKEN. The token stays on your server. Each library reads it from the environment and calls this endpoint for you.
| Field | Type | Description |
|---|---|---|
| ua | string | The User-Agent string. Required. At most 4096 characters. |
Response
A 200 response uses one call. Returns the browser, device, operating system, and whether the client looks like a bot.
Errors
A failed request returns { "error": { "code", "message" } } and does not use a call.
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | A required field is missing or has the wrong type. |
| 401 | unauthorized | The bearer token is missing or not recognized. |