The Userstack API is easy to use. It only takes a few lines of code to make your first lookup request. All registered users, whether on a free or paid plan, can use our Quickstart Guide to explore the full range of API functionalities.
- Existing users: Access the Quickstart Guide below.
- New users: Create an account and get started in minutes.
Get onboarded with the Userstack API and start retrieving user-agent data right away.
Step 1: Get Your API Access Key
Sign up for a free or paid plan to start using the Userstack API. Once registered, your personal API Access Key will be available in the Dashboard. This key is required to authenticate all API requests—keep it secure. You can reset it anytime from your Account Dashboard.
Step 2: Make a Request
Use your access key to authenticate and send a request to the /detect endpoint, passing the User-Agent string to look up in the ua parameter:
https://api.apilayer.net/userstack/detect?access_key=YOUR_ACCESS_KEY&ua=Mozilla/5.0%20(Macintosh;%20Intel%20Mac%20OS%20X%2010_14_0)%20AppleWebKit/537.36%20(KHTML,%20like%20Gecko)%20Chrome/71.0.3578.98%20Safari/537.36Step 3: Handle the Response
Process the returned data to extract information about the user's device, browser and operating system.
Example response:
{
"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://www.google.com/about/company/",
"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/icons/os/macosx.png",
"icon_large": "https://assets.userstack.com/icons/os/macosx_big.png"
},
"device": {
"is_mobile_device": false,
"type": "desktop",
"brand": "Apple",
"brand_code": "apple",
"brand_url": "http://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
}
}Support & Resources
See the Getting Started page for authentication, response formats and error codes, and Code Examples for ready-to-use code. For any assistance, contact our support team anytime.