API Freaks logoAPI Freaks logo
CTRL+K

    Documentation

  • Pricing

  • Resources

  • Tools

  • Contact us

CTRL+K
Sign InGet Started For Free
  • Overview
  • Documentation
  • How to Guides
  • APIFreaks
  • Organization and Teams
  • Credits Usage API
  • IP Geolocation Lookup API
  • Bulk IP Geolocation Lookup
  • Domain WHOIS Lookup
  • IP WHOIS Lookup
  • ASN Lookup
  • Domain WHOIS Historical Lookup
  • Domain WHOIS Reverse Lookup
  • Bulk Domain WHOIS Lookup
  • DNS Lookup
  • Historical DNS Lookup
  • Reverse DNS Lookup
  • Bulk DNS Lookup
  • SSL Certificate Lookup
  • Domain Availability API
  • Bulk Domain Availability API
  • Screenshot API
  • Bulk Screenshot API
  • Currencies Exchange Rates API
  • Currency Converter API
  • Currency Time Series API
  • Currency Fluctuation API
  • Geolocalized Currency Converter
  • Live Commodity Prices
  • Commodity Historical Prices
  • Commodity Fluctuation API
  • Commodity Time Series API
  • Timezone Lookup
  • Timezone Converter
  • Zipcode Lookup API
  • User Agent Parser
  • Bulk User Agent Parser
  • Astronomy API

User Agent Parser - Parse User Agent into Readable Format

Obtain detailed information about the browser, device, and operating system by parsing a User Agent String. It also provides information about crawlers and attach sources.

Bot Detection

Check if the user-agent belongs to a robot, spider, crawler, or any other type of automated software.

OS Detection

Determine the OS family, full OS name and version information.

Browser Detection

Get the name, engine, version and release year of the browser software.

Type Detection

Determine the general user-agent type e.g. check if the user-agent is a phone, tablet or desktop device.

Mobile Detection

Determine if the user-agent belongs to a mobile device and get brand and model information.

Device Specs

Retrieve device specs such as the release year, price and physical display properties.

Unlimited free access

Features

Parsed Readable Output

The User-Agent API from APIFreaks takes a complex user agent string and parses it into a detailed, readable format. This helps developers understand the browser, device, and operating system details effortlessly.

Detect Attacks

Utilize our User Agent Parser API to identify and block malicious actors. Detect malformed user-agent strings and prevent attackers from accessing your website, ensuring a secure user experience.

Documentation

API Endpoint

GET

https://api.apifreaks.com/v1.0/user-agent/lookup

Test
LANGUAGE
Python
PHP
Java
Node
Ruby
JavaScript
C#
$ pip install requests

API Request

HeaderRequiredTypeDefaultDescription
User-AgentYesString-
user-agent string to parse

API Response

For a comprehensive view of the API response structure and detailed field descriptions, explore the interactive Response Table by clicking here.

How-To-Guides

Get User-Agent Details

Pass the user agent string in the User-Agent header to get details about the user agent in a very readable json format.

# Get User-Agent Details for User-Agent header
curl -X 'GET' 'https://api.apifreaks.com/v1.0/user-agent/lookup?apiKey=API-KEY' -H 'User-Agent: User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/601.3.9 (KHTML, like Gecko) Version/9.0.2 Safari/601.3.9'
# Response { "userAgentString": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/601.3.9 (KHTML, like Gecko) Version/9.0.2 Safari/601.3.9", "name": "Safari", "type": "Browser", "version": "9.0.2", "versionMajor": "9", "device": { "name": "Apple Macintosh", "type": "Desktop", "brand": "Apple", "CPU": "Intel" }, "engine": { "name": "AppleWebKit", "type": "Browser", "version": "601.3.9", "versionMajor": "601", "build": "Unknown" }, "operatingSystem": { "name": "Mac OS X", "type": "Desktop", "version": "10.11.2", "versionMajor": "10" } }

Detect Bots and Crawlers

Crawlers and bots pass their User Agent Strings with header and our API can parse that as well and detects the type of crawler. Below is a User Agent String of Google Bot with Nexus mobile device. "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" A curl request with this header will yield:

curl -X 'GET' 'https://api.apifreaks.com/v1.0/user-agent/lookup?apiKey=API-KEY' -H 'User-Agent: Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)'
# Response { "userAgentString": "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)", "name": "Googlebot", "type": "Robot Mobile", "version": "2.1", "versionMajor": "2", "device": { "name": "Google", "type": "Robot Mobile", "brand": "Google", "CPU": null }, "engine": { "name": "Googlebot", "type": "Robot", "version": "Googlebot", "versionMajor": "Googlebot" }, "operatingSystem": { "name": "Google", "type": "Cloud", "version": "Google", "versionMajor": "Google" } }

Detect Attackers

The hackers usually malform the user agent strings and append their custom scripts with it. Whenever our API detects such anomalies, it reports back with an appropriate message. Here is an example of a malformed Google bot user agent. "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html) select name" Notice that a SQL query select name is appended to the string. Here is how our API reacts to it

curl -X 'GET' 'https://api.apifreaks.com/v1.0/user-agent/lookup?apiKey=API-KEY' -H 'User-Agent: Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html) select name'
# Response { "userAgentString": "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html) select name", "name": "Hacker", "type": "Hacker", "version": "Hacker", "versionMajor": "Hacker", "device": { "name": "Hacker", "type": "Hacker", "brand": "Hacker", "CPU": null }, "engine": { "name": "Hacker", "type": "Hacker", "version": "Hacker", "versionMajor": "Hacker" }, "operatingSystem": { "name": "Hacker", "type": "Hacker", "version": "Hacker", "versionMajor": "Hacker" } }

Ready to get started?

Sign Up for Free

APIFreaks

API Catalog

  • Geolocation APIs
  • WHOIS APIs
  • DNS APIs
  • SSL APIs
  • Domain Availability APIs
  • Screenshot APIs
  • Currency APIs
  • Commodity APIs
  • Timezone APIs
  • Zipcode APIs
  • User Agent APIs
  • Other APIs

Tools Catalog

  • Formatters & Beautifiers
  • Converters & Optimizers
  • Viewers & Validators

Docs

  • Documentation
  • Swagger Docs

Pricing & Accounts

  • Pricing
  • Sign up
  • Sign In

Company

  • About Us
  • Resources
  • Terms
  • Privacy

Copyright © 2024

Made in Pakistan