Userstack API

Development / OAuth Advanced HTTPS
Varies by plan (check documentation)

Overview

Userstack is a User-Agent string parsing API that detects browser type, version, operating system, and device category from a raw UA string in real time. It processes over 10,000 distinct User-Agent patterns and returns structured device data that would otherwise require a complex regex library. It is commonly used for analytics dashboards, access control, and rendering optimization based on visitor device type.

💡

Beginner Tip

Despite the "OAuth" label, Userstack actually uses a simple API key passed as the access_key query parameter — there is no OAuth token exchange flow required. Start with a free account to get your key and make a test call using your own browser User-Agent string.

Available Data

Userstack data via REST API
JSON-formatted response data
Requires OAuth authentication

Example Response

JSON Response
{
  "status": "success",
  "data": {
    "result": "Data from Userstack",
    "description": "Secure User-Agent String Lookup JSON API",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

ua The original User-Agent string that was submitted for parsing.
type Device category: browser, bot, email, library, or null for unknown.
browser.name Browser name such as Chrome, Firefox, or Safari.
browser.version Full version string of the detected browser.
os.name Operating system name, e.g., Windows, macOS, Android.
device.type Hardware category: desktop, tablet, smartphone, or tv.

Implementation Example

const url = "https://userstack.com/";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "Authorization": "Bearer YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

101 missing_access_key error in JSON body The access_key parameter is absent from the query string.
Always append ?access_key=YOUR_KEY to every request URL before the ua parameter.
Unexpected null fields for unknown User-Agents Custom or bot User-Agent strings may not match any known pattern.
Check the type field first; if it is "bot" or null, treat the UA as unrecognized and apply a fallback behavior.
104 usage_limit_reached on the free tier The free plan caps requests at 10,000 per month.
Cache parsed results by UA string in a key-value store since the same UA appears repeatedly for most users.

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 5/20
🔒 Security 15/15
🛠 Developer XP 3/20
✓ Reliability 10/15

Partially tested on Apr 5, 2026

Technical Specifications

Auth OAuth
HTTPS REQUIRED
CORS UNKNOWN
Category Development
Difficulty Advanced
Verified: 2026-04-04

Alternatives to Userstack

Technical alternatives for different use cases.

User-agent parsing with device and OS detection

Better For

Free usage (Userstack requires paid plan)

Trade-off

Detailed device and browser detection from user-agent strings

Similar APIs

View All →