I'm looking for list of web browser user agents for testing purposes. Ideally in some common text format. Especially for the desktop and mobile devices.
Browscap's repository includes a User Agent Database Resource, althouth the wiki hasn't been updated since 2015. Browscap has had updates as recently as 2017-06, but that includes the entire repository, not just the ua db.
Udger UA List Database "includes detailed information about ever(y) single user agent and operating system".
User-Agents.org has a List of User-Agents (Spiders, Robots, Crawlers, Browser) in XML format, as well as a search database and some other offerings.
I've found so far this: Massive list of user agents for User Agent Switcher by Chris Pederik.
It's in XML format and it's grouped based on the browser and the device type. It has 602 entries.
Here are some other copies:
Here is the shell command dumping printing this list in plain format:
curl -s https://gist.githubusercontent.com/javidrashid/9079cf0073cca7383269dbbdcc80e5b6/raw/55c1c6ac3185553c0063674fd8e594988e7b257c/useragentswitcher.xml | grep -o 'useragent=.[^"]\+"'
https://www.npmjs.com/package/user-agents - this solves a lot of the issues.
To install, for example with yarn
# With yarn: yarn add user-agents
import UserAgent from 'user-agents'; const userAgent = new UserAgent(); console.log(userAgent.toString()); console.log(JSON.stringify(userAgent.data, null, 2));
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36
(you can ignore the rest of the php stuff in the repo)