User Agents Database - Documentation

Data formats

This database is provided in a MySQL database dump, CSV and plain text formats.

MySQL

The MySQL data format is a series of INSERT statements (along with a seperate file which provides the appropriate table structure) for storing all the user agents as well as the results from our user agent parser for each user agent (and also, the number of times each user agent was seen, the first date/time and the last date/time).

CSV

The CSV data format is a standard Comma Seperated Variable file also containing all of our user agents as well as seperate fields for the results from our user agent parser for each user agent (and also, the number of times each user agent was seen, the first date/time and the last date/time).

Plain Text

The TXT data format is a standard plain text file containing all of our user agents, each on a seperate line. Note that due to the plain text format, it's not possible to include the parse results (use the CSV file if you want that). This is basically a huge text file containing lots of user agents.

Sample data

Here is a sample MySQL database dump for you to inspect. It contains the first 10,000 user agents in our database (which pass our "sanitization" rules"). It also includes the script to create the appropriate table to store the data. You can experiment with loading it in to your system and inspect the exact format that you'll receive from the full database dump.

Choose sample data format

Indexes

Please note, we have intentionally not added any indexes to the table structure other than the Primary Key. We didn't want to assume how you were going to be using the database and potentially waste your resources with unnecessary indexes. However due to the large number of records in the database, if you're doing any sort of querying against it (which we assume you are) the first thing you're going to want to do is put your own index/es on the fields you use in your WHERE queries to help speed them up.

We have built this system to make it easy for you to automate downloading and loading the latest database dump. If you want to do this; please regularly query the API for the latest database dump. When you notice that the SHASUM256, URL or created_at values have changed, it means there's a new database available for you to consume. We create new database dumps weekly; each Sunday morning (UTC). Download the tar.gz from the provided URL and unpack it. There will be three files:

  • README.txt
  • create-table-whatismybrowser_useragent.sql
  • whatismybrowser-user-agent-database.sql.

Each MySQL database download includes this file (as a separate .sql which you can choose to load into your database).

For easy reference, here's the database structure for the user agent data we provide:

CREATE TABLE `whatismybrowser_useragent` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_agent` longtext, `times_seen` int(11) NOT NULL, `simple_software_string` varchar(255) DEFAULT NULL, `simple_sub_description_string` varchar(255) DEFAULT NULL, `simple_operating_platform_string` varchar(255) DEFAULT NULL, `software` varchar(255) DEFAULT NULL, `software_name` varchar(255) DEFAULT NULL, `software_name_code` varchar(255) DEFAULT NULL, `software_version` varchar(255) DEFAULT NULL, `software_version_full` varchar(255) DEFAULT NULL, `operating_system` varchar(255) DEFAULT NULL, `operating_system_name` varchar(255) DEFAULT NULL, `operating_system_name_code` varchar(255) DEFAULT NULL, `operating_system_version` varchar(255) DEFAULT NULL, `operating_system_version_full` varchar(255) DEFAULT NULL, `operating_system_flavour` varchar(255) DEFAULT NULL, `operating_system_flavour_code` varchar(255) DEFAULT NULL, `operating_system_frameworks` longtext, `operating_platform` varchar(255) DEFAULT NULL, `operating_platform_code` varchar(255) DEFAULT NULL, `operating_platform_code_name` varchar(255) DEFAULT NULL, `operating_platform_vendor_name` varchar(255) DEFAULT NULL, `software_type` varchar(255) DEFAULT NULL, `software_sub_type` varchar(255) DEFAULT NULL, `software_type_specific` varchar(255) DEFAULT NULL, `hardware_type` varchar(255) DEFAULT NULL, `hardware_sub_type` varchar(255) DEFAULT NULL, `hardware_sub_sub_type` varchar(255) DEFAULT NULL, `hardware_type_specific` varchar(255) DEFAULT NULL, `layout_engine_name` varchar(255) DEFAULT NULL, `layout_engine_version` varchar(255) DEFAULT NULL, `extra_info` longtext, `extra_info_dict` longtext, `capabilities` longtext, `detected_addons` longtext, `first_seen_at` datetime(6) NOT NULL, `last_seen_at` datetime(6) NOT NULL, `updated_at` datetime(6) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Handling the CSV file

Have a look at the great csvkit toolkit for some handy utilities.

Having problems?

Do you have any questions or problems regarding the User Agent Database? Please read our Frequently Asked Questions page for solutions to common problems to using the database.