Using Browscap

Thomas Müller edited this page Sep 2, 2017 · 23 revisions

Browscap is provided in several different formats, the most commonly used is the INI format. The tool on GitHub at browscap/browscap itself can't be used directly on your site, this tool is ONLY used to generate the INI files to put on the official site at We also keep the issue tracker on here to make it easy for you to report missing/incorrect UA strings. In order to actually use the INI files, there are several options available to you, which are listed below.


Using browscap/browscap-php

This is an officially supported method of loading the files

This package is based on GaretJax/phpbrowscap, but is maintained by the official Browscap team. It is an officially supported method of loading the files (we do not support GaretJax's version, although we sometimes contribute changes back). This method of using Browscap allows you to both download and parse the file using one package.

Note: for Symfony 2 users, you can use the browscap/BrowscapBundle which is maintained by Joshua Estes.

Using get_browser()

PHP actually has a built-in method of parsing the browscap.ini file. However, for this method you must manually download the correct browscap.ini (any of the PHP versions) and configure PHP for the correct directory. This might not be possible in a shared host environment, so you might need to look at a userland implementation, e.g. the browscap/browscap-php package.

WordPress plugin WP SlimStat

The WordPress plugin WP SlimStat also uses browscap.ini, but it uses a customised version of the INI files which come bundled with the plugin. Visit getusedtoit/wp-slimstat for more info.


A complete rewrite of the browscap/browscap-php library was done by contributor @ziege and is claimed to be much more memory-friendly.


The HTTP::Browscap perl module is available from


User @robertlabrie from @tnwinc made a Python script that parses the browscap.csv format.


Using browscap.dll

You can use the browscap.dll (MSWC.BrowserType component) to parse the INI file in ASP. You would need to manaully download the browscap.ini files for this method.

C# / IIS

Udo Schmal's C# Class

Udo Schmal's ISAPI filter


Udo Schmal's Pascal Class

A contributor, Udo Schmal created a class for loading the files using Pascal. More info can be found at (in German).

Udo Schmal's Apache Module

Gocher also created an Apache module written in Pascal that loads the browscap.ini files. More info can be found at (in German).



Ruby Gems exists for:


Browscap can be used in Splunk - see here