Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Clone this wiki locally
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 browscap.org. 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.
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.
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. https://github.com/crossjoin/Browscap.
HTTP::Browscap perl module is available from http://search.cpan.org/~gwyn/HTTP-Browscap-0.06/Browscap.pm.
User @robertlabrie from @tnwinc made a Python script that parses the browscap.csv format. https://github.com/tnwinc/TA-browscap_express
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 http://www.gocher.me/browscap (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 http://www.gocher.me/browscap-apache-module (in German).
Ruby Gems exists for:
Browscap can be used in Splunk - see here