Userstack

Operational

Real-time User-Agent detection API · by APILayer

  • DevTools
  • JSON · XML
  • 10,000+ companies
  • 99.9% average uptime

Free plan · 100 requests / month · no card

Overview

API info

Detects browsers, devices, operating systems, and crawlers from User-Agent strings with a simple, secure REST API. Userstack turns raw User-Agent data into structured information your application can use to personalize experiences, optimize content, detect crawlers, and understand how visitors access your website or application.

Example request

GETShellcurl
curl --request GET \
  --url "http://api.userstack.com/detect?access_key=YOUR_ACCESS_KEY&ua=Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_14_0)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F71.0.3578.98%20Safari%2F537.36"
Run it in the Playground

Example response

200 - OK
{
    "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36",
    "type": "browser",
    "brand": "Apple",
    "name": "Mac",
    "url": "https://about.google/",
    "os": {
        "name": "macOS 10.14 Mojave",
        "code": "macos_10_14",
        "url": "https://en.wikipedia.org/wiki/MacOS_Mojave",
        "family": "macOS",
        "family_code": "macos",
        "family_vendor": "Apple Inc.",
        "icon": "https://assets.userstack.com/icon/os/macosx.png",
        "icon_large": "https://assets.userstack.com/icon/os/macosx_big.png"
    },
    "device": {
        "is_mobile_device": false,
        "type": "desktop",
        "brand": "Apple",
        "brand_code": "apple",
        "brand_url": "https://www.apple.com/",
        "name": "Mac"
    },
    "browser": {
        "name": "Chrome",
        "version": "71.0.3578.98",
        "version_major": "71",
        "engine": "WebKit/Blink"
    },
    "crawler": {
        "is_crawler": false,
        "category": null,
        "last_seen": null
    }
}

Everything you need to understand your visitors

  • Easy to integrate

    Connect to a simple REST API and turn User-Agent strings into structured information in milliseconds. One REST endpoint with JSON or XML responses, compatible with any major programming language.

  • Accurate User-Agent data

    Our proprietary User-Agent database is updated multiple times a week, so newly released devices, browsers and operating systems are recognized without you updating a library.

  • Detailed device detection

    Identify the device being used to access your website or application, including device type, brand, and model information where available.

  • Browser detection

    Find out which browser your visitors are using, including browser name, version, major version, and rendering engine.

  • Operating system detection

    Identify operating systems and their versions to help you deliver experiences optimized for the software your visitors actually use.

  • Crawler detection

    Identify known crawlers and search-engine bots that announce themselves in the User-Agent, so you can treat them differently in analytics, caching and SEO workflows. Available on Starter plans and above.

  • JSON & XML responses

    Choose the response format that works best for your application. Userstack provides a lightweight REST interface with JSON and XML support.

  • Built to scale

    Whether you're processing a few hundred requests or millions of API calls, Userstack runs on scalable APILayer cloud infrastructure designed to support applications as they grow.

  • 10,000+Companies use Userstack
  • Multiple times a weekDatabase updates
  • 99.9%Average uptime
  • MillisecondsAPI response time

Turn User-Agent data into better experiences

  • See Userstack in Action

    Use real-time User-Agent detection to adapt your website, application, and content to the technology your visitors are using.

    Explore Use Cases
  • Userstack API Documentation

    Everything you need to integrate in minutes. Get started with comprehensive API documentation, endpoint references, parameters, response examples, and integration guides.

    View Documentation

Pricing

Flexible plans for every stage of growth

From testing User-Agent detection in a new project to processing millions of lookups in production, choose the plan that matches your application's requirements.

MonthlyYearlySave up to 15%

Free

For testing and side projects

$0forever

No credit card

No overage charges

Get Free API Key

100 requests / month

Includes:

  • Device Detection
  • Browser Detection
  • OS Detection
  • HTTPS Encryption
See all 7 features

Starter

For your first live product

$9.99/ month

Billed monthly

Then $0.0007992 per extra request, up to 100,000 extra a month

Subscribe Now

50,000 requests / month

Everything in Free, plus:

  • Crawler Detection
  • Standard Support
See all 7 features
Most popular

Professional

For growing traffic

$49.99/ month

Billed monthly

Then $0.00039992 per extra request, up to 1,000,000 extra a month

Subscribe Now

500,000 requests / month

Everything in Starter, plus:

  • 10× the requests of Starter
  • Lower cost per request
  • Bulk Lookups
See all 7 features

Enterprise

For high volume

$99.99/ month

Billed monthly

Then $0.00019998 per extra request, up to 4,000,000 extra a month

Subscribe Now

2,000,000 requests / month

Everything in Professional, plus:

  • 4× the requests of Professional
  • Lower cost per request
See all 7 features

Custom

Need more? Contact sales for custom needs.

Contact Sales

Compare all features

7 featuresFree$0Get free keyStarter$9.99/moSubscribeProfessional$49.99/moSubscribeEnterprise$99.99/moSubscribe
Device Detection
Browser Detection
OS Detection
HTTPS Encryption
Crawler Detection–
Bulk Lookups––
Standard Support–
Price per extra request after the monthly limitNone$0.0007992$0.00039992$0.00019998

Playground

Try the API

Build a request in your browser and see the response it returns.

GET

Add your free API key to run it from your code.

curl
200 - OK

      
    

Agents

Agents: start here

Steps for AI coding agents that add Userstack to a project.

  1. 1Get an API key

    A person creates the account: an agent cannot sign up. Sign up at app.apilayer.com and subscribe to Userstack. The Free plan includes 100 requests / month and needs no credit card.

    Copy the API key from the APILayer dashboard and give it to the agent as an environment variable (step 2).

  2. 2Keep the key out of code

    Read the key from an environment variable named APILAYER_ACCESS_KEY. Do not write the key into source code, commit it to git, or paste it into a chat.

    Call Userstack from server code. The key travels in the request URL, so a request sent from a browser shows the key to every visitor.

    .env
    # add .env to .gitignore
    APILAYER_ACCESS_KEY=your_api_key
  3. 3Make the first request

    Base URL
    http://api.userstack.com
    Auth
    access_key query parameter
    Formats
    JSON, XML
    Endpoints
    • /detect Detect
    Shell
    curl "http://api.userstack.com/detect?access_key=$APILAYER_ACCESS_KEY&ua=Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_14_0)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F71.0.3578.98%20Safari%2F537.36"

    The API info tab shows the response this request returns.

  4. 4Check the plan before you use a feature

    Each plan adds features to the plan before it. Check that the account's plan includes a feature before writing code that uses it.

    PlanRequests / monthAdds
    Free100Device Detection, Browser Detection, OS Detection, HTTPS Encryption
    Starter50,000Crawler Detection, Standard Support
    Professional500,000Bulk Lookups
    Enterprise2,000,000Same features as Professional

    Prices are in the Pricing tab.

  5. 5Use the machine-readable docs

FAQs

Need clarity?

Here are the answers you might be seeking

Data & features

01.What is Userstack?

Userstack is a REST API that parses and interprets User-Agent strings to identify the device, browser, operating system, and crawler information associated with a visitor.

02.What is a User-Agent string?

A User-Agent is information sent by a browser or application when making a web request. It can contain information about the browser, operating system, device, and other software characteristics. Userstack turns that raw string into structured data that applications can use.

03.What information can Userstack detect?

Depending on the User-Agent and available data, Userstack can identify information including: device type, device brand, device name, browser, browser version, browser engine, operating system, operating system family, operating system version, crawler status, and crawler category.

04.Can Userstack detect mobile devices?

Yes. Userstack can distinguish between device types such as smartphones, tablets, and desktop devices and provides device information as part of the API response.

05.Can Userstack identify browsers?

Yes. The API can identify the browser name, version, major version, and browser engine from a User-Agent string.

06.Can Userstack identify operating systems?

Yes. Userstack can identify operating system information including the OS name, family, version, and associated codes where available.

07.Can Userstack detect bots and crawlers?

Yes, on Starter plans and above. Userstack flags known crawlers and search-engine bots with an is_crawler property, plus the crawler’s category and when it was last seen.

08.How often is the User-Agent database updated?

The Userstack database is updated multiple times a week. This is designed to keep detection information current as new browsers, operating systems, devices, and other User-Agent strings appear.

09.Where does Userstack get its data?

User-Agent detection is based on a proprietary database mapping User-Agent strings to devices, browsers, and operating systems currently in use and on the market.

10.What is userstack?

userstack is a simple but powerful REST API built to accurately detect the device, browser and operating system website visitors are using by parsing and interpreting User-Agent strings. The API is used by more than 10,000 companies around the world, including Zendesk, Intuit and Apple. To learn more, you can get a free API access key, take a look at the API Documentation and make your first API request today.

11.Where is the API's data coming from?

User-Agent detection by userstack is based on a proprietary database mapping of User-Agent strings with a complete set of devices, browsers and operating systems currently in use and on the market.

12.How often is User-Agent data refreshed?

Our database of User-Agent strings is updated multiple times a week, ensuring accurate and up-to-date User-Agent detection even for the most recently released hardware and software.

13.How scalable is this service?

The userstack API is powered by apilayer cloud infrastructure, a system some of the world's most popular real-time API services are running on, making it highly scalable and flexible at any step of the way.

API access

01.Does Userstack support JSON?

Yes. JSON is the primary API response format and is designed to work across major programming languages and application environments.

02.Does Userstack support XML?

Yes. Userstack provides both JSON and XML API responses.

03.Can I use Userstack for bulk lookups?

Yes. Bulk lookups are available on the Starter, Professional, and Enterprise plans.

04.Is Userstack secure?

All plans include HTTPS encryption, and the service states that data streams sent to and from the API are protected using 256-bit SSL encryption.

Plans & pricing

01.Is there a free plan?

Yes. The Free plan includes 100 User-Agent lookups per month together with device, browser, and OS detection and HTTPS encryption.

02.Can I also pay yearly?

Yes. If you choose annual billing, the total price of your subscription plan will be up to 15% lower than the total amount you would pay with a monthly payment frequency.

Overages

01.What happens when I reach my monthly lookup limit?

Userstack sends usage notifications at 75%, 90%, and 100% of the monthly allowance. After reaching the included quota, overage fees can apply so your application can continue processing requests.

02.What is an overage?

An overage occurs when you go over a quota for your API plan. When you reach your API calls limit, we will charge you a small amount for each new API call so we can make sure there will be no disruption in the service we provide to you and your website or application can continue running smoothly.

Prices for additional API calls will vary based on your plan.

03.Why does APILayer have overage fees?

Overage fees allow customers to continue using an API once a quota limit is reached. We want to make sure your website or application continues running at all times, so charges will apply if you go over your monthly quota limit. If you notice you are going over your quota limit each month, look on your dashboard for an upgraded plan to help with larger request limits.

04.How do I know if I will be charged for overages?

When you are close to reaching your API calls limit for the month, you will receive an automatic notification (at 75%, 90%, and 100% of your monthly quota). You can keep track of your quota usage to prevent overages by tracking the number of API calls you make and checking the dashboard for up-to-date usage statistics.

05.What if I consistently have more API calls than my plan allows?

If your usage consistently surpasses the set limits each month, you may face additional charges for the excess usage. Nevertheless, as your monthly usage reaches a certain threshold, it becomes more practical to consider upgrading to the next plan. By doing so, you ensure a smoother and more accommodating experience for your growing customer base.

Still have a question?

Contact support