https://github.com/tomlutzenberger/useragent
A small and easy but useful webservice to identify user-agents
https://github.com/tomlutzenberger/useragent
api browser identification navigator operating-system os user-agent webservice
Last synced: 4 months ago
JSON representation
A small and easy but useful webservice to identify user-agents
- Host: GitHub
- URL: https://github.com/tomlutzenberger/useragent
- Owner: tomlutzenberger
- License: mit
- Created: 2017-06-26T01:51:18.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-04T18:58:44.000Z (about 8 years ago)
- Last Synced: 2025-01-10T08:57:10.184Z (9 months ago)
- Topics: api, browser, identification, navigator, operating-system, os, user-agent, webservice
- Language: CSS
- Homepage: https://useragent.codes
- Size: 704 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# useragent.codes
[](https://github.com/tomlutzenberger/useragent/releases)
[](https://nodesecurity.io/orgs/tomlutzenberger/projects/fca7e226-450f-4807-a43b-da1a77afec4d)
[]()
[]()## 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](https://github.com/ua-parser/uap-php) 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](https://useragent.codes/get) and the response will look something like this:
```json
{
"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](https://tomlutzenberger.de)