AI agents: the setup steps for Userstack are in the Agents section of this page (#agents) and as Markdown at /products/userstack/agents.md. Index of every APILayer API: https://apilayer.com/llms.txt

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

Playground tab is switched off on the live page (AP-6510). Delete this widget to turn it back on.

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 "https://api.apilayer.net/userstack/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
  • Non-commercial use
See all 8 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
  • Commercial use
See all 8 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 8 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 8 features

Custom

Need more? Contact sales for custom needs.

Contact Sales

Compare all features

8 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–
Commercial use–
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
    https://api.apilayer.net/userstack
    Auth
    access_key query parameter
    Formats
    JSON, XML
    Endpoints
    • GET /detect Look up one User-Agent
    • POST /detect Bulk lookup, up to 100 User-Agents (Professional and Enterprise)
    Shell
    curl "https://api.apilayer.net/userstack/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, Commercial use
    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 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.

02.Who runs the API?

Userstack is a product built and maintained by APILayer, the company behind 17 developer APIs, including IPstack, Weatherstack and Exchange Rate API. You can learn more on the Why choose APILayer page.

03.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.

04.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.

05.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.

06.Can Userstack identify browsers?

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

07.Can Userstack identify operating systems?

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

08.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.

09.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.

10.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.

11.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.What is an API Request?

Pricing is based on the number of monthly API requests allowed. Each time the Userstack API service is used to look up a User-Agent string, one API request is consumed. API errors are not counted towards your monthly quota.

02.What is the API's uptime?

Our API's system status is closely monitored around the clock. Every effort is made to ensure the highest possible level of availability and consistency, and we are proud to have an average uptime rate of nearly 100% (99.9%), calculated based on the past 12 months.

There is a public API status page available at the following URL: status.userstack.com.

03.Does Userstack support JSON?

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

04.Does Userstack support XML?

Yes. Userstack provides both JSON and XML API responses.

05.Can I use Userstack for bulk lookups?

Yes. Bulk lookups, up to 100 user-agent strings in one request, are available on the Professional and Enterprise plans.

06.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.What is the difference between free and paid subscriptions?

The Userstack Free Plan is a way of getting familiar with the API, offering basic API functionality and a limitation of 100 monthly API lookups. As soon as you need a higher volume or advanced API features, you can choose from one of the premium subscriptions or contact us for a custom solution.

03.Which subscription plan fits my needs?

The most decisive factor when it comes to your technical requirements is the number of monthly User-Agent strings need processing per month. Other factors include HTTPS encryption and access to the Bulk Lookups and Crawler Detection features.

Signing up for the Free Plan is a great way of getting to know the API and implementing it without any commitments.

04.Which payment methods are supported?

Payments can be made via credit card (Visa, MasterCard, Discover, Diner's Club, American Express). Enterprise and high-volume customers may request annual bank transfer payments to be enabled. You can change your payment method at any given time in the "Payment" section of your account dashboard.

05.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.

06.How do I cancel/downgrade?

You can initiate a cancellation or downgrade by selecting a new plan and providing at least one reason for your decision. The customer service team will cancel or downgrade your plan. Downgrades are not effective immediately; your premium subscription will remain active until the end of the current billing period.

07.How do I change between monthly and yearly billing?

To change your subscription from monthly to yearly billing, submit a request on the Contact Us page on the website following these steps:

Step 1: Sign in to your account

Step 2: Go to Contact Us page

Step 3: Fill out the form and choose the “Sales” category for this request.

Step 4: In the text box, include your specific request for example “Change from Monthly to Yearly subscription.”

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. You can learn more about overages billing here.

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. See the table below for prices per call and an example of an overage billing.

PlanMonthly priceRequests / monthPrice per extra requestExtra requestsOverage cost
Starter$9.9950,000$0.000799210,000$7.99
Professional$49.99500,000$0.0003999210,000$4.00
Enterprise$99.992,000,000$0.0001999810,000$2.00

Note: For complete details, please refer to the overages documentation here.

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.How will I be charged for my API subscription?

You will be charged for your monthly subscription plan, plus any overage fees applied. Your credit card will be billed after the billing period has ended.

06.What happens if I don't have any overage fees?

In this case, there will be no change to your monthly invoice. Only billing cycles that incur overages will see any difference in monthly charges. The Business Continuity plan is an insurance plan to be used only if needed and guarantees your end users never see a drop in coverage from you.

07.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. Find out about our pricing plans here.

08.I would like to upgrade my plan. How can I do that?

You can easily upgrade your plan by going to your Dashboard and selecting the new plan that would be more suitable for your business needs. Additionally, you may contact your Account Manager to discuss a custom plan if you expect a continuous increase in usage.

Still have a question?

Contact support