A small and easy but useful webservice to identify user-agents
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist
get
less
pug
.editorconfig
.gitattributes
.gitignore
.htmlhintrc
.stylelintrc
.yarnclean
COMMIT_TEMPLATE
LICENSE
README.md
android-chrome-192x192.png
android-chrome-256x256.png
apple-touch-icon.png
browserconfig.xml
composer.json
composer.lock
favicon-16x16.png
favicon-32x32.png
favicon.ico
index.html
logo.png
manifest.json
mstile-150x150.png
og-image.jpg
package.json
safari-pinned-tab.svg
yarn.lock

README.md

useragent.codes

Releases NSP Status David David Dev

What is useragent.codes ?

A small and easy but useful webservice to identify user-agents (browsers). I created it because I needed to identify browser + OS on another project. Browscap was not possible to use, because it gives you a 73MB JSON (minified). Not a good choice for a JavaScript-only frontend project.

Why do I need it?

Have you (as a developer) ever tried to identify you browser & OS via navigator.useragent by yourself? You have to parse this string and often it looks very different on various browsers and systems.

Believe me, you don't want to do this by yourself. It sucks.

How does it work?

It's simple: I used UA-Parser's PHP implementation and put it on a server. It returns a JSON string with all the available information.

How do I use it?

Just request https://useragent.codes/get and the response will look something like this:

{
  "info":{
    "name":"useragent.codes",
    "version":"v0.1"
  },
  "browser":{
    "fullName":"Chrome 59.0.3071",
    "name":"Chrome",
    "version":"59.0.3071",
    "major":"59",
    "minor":"0",
    "patch":"3071"
  },
  "system":{
    "fullName":"Windows 10",
    "name":"Windows 10",
    "version":"",
    "major":null,
    "minor":null,
    "patch":null,
    "patchMinor":null
  },
  "device":{
    "brand":null,
    "model":null,
    "family":"Other"
  }
}

Made with ❤

A Project by Tom Lutzenberger