User-Agent Parser

User-Agent Parser API

Development

Parse user-agent strings to identify browsers, devices, and operating systems instantly. Includes random user-agent generation for testing and development.

Authentication

All API requests require a valid API key passed in the Authorization header as a Bearer token.

Rate Limit

100 requests per minute

Endpoints

1 endpoint available

Overview

The User-Agent Parser API analyzes user-agent strings to identify browsers, devices, and operating systems. Also supports generating random user-agents for testing.

Parsed Information

  • Browser: Name and version (Chrome, Firefox, Safari, Edge, IE)
  • Operating System: Name and version (Windows, macOS, Android, iOS, Linux)
  • Device: Type (Desktop, Mobile, Tablet), vendor, model
  • CPU: Architecture

Features

  • Parse any user-agent string
  • Generate random user-agents for testing
  • Detect major browsers and operating systems

Endpoints

POST
/v1/tools/user-agent-parser
Parse a user-agent string or generate a random one

Request Body

Content-Type: application/json

ParameterTypeRequiredDescription
operation
string
Required
Operation: "parse" or "generate"
userAgent
string
OptionalUser-agent string to parse (required for "parse" operation)

Response Example

{
  "success": true,
  "data": {
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
    "browser": {
      "name": "Chrome",
      "version": "120.0"
    },
    "os": {
      "name": "Windows",
      "version": "10"
    },
    "device": {
      "type": "Desktop",
      "vendor": "Various",
      "model": "Unknown"
    },
    "cpu": {
      "architecture": "Unknown"
    }
  }
}

Error Codes

400
Bad Request - Missing user-agent for parse operation
401
Unauthorized - Invalid or missing API key
429
Too Many Requests - Rate limit exceeded
500
Internal Server Error

Code Examples

# Parse a user-agent
curl -X POST https://api.opentools.ca/v1/tools/user-agent-parser \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "operation": "parse",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
  }'

# Generate a random user-agent
curl -X POST https://api.opentools.ca/v1/tools/user-agent-parser \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "operation": "generate"
  }'

Ready to get started?

Create an API key to start using the User-Agent Parser API.