It's easy to use our Browser Detection API with Python, to get the most detailed and complete approach to decoding user agents. We are always updating our custom-built user agent parser, so you'll never need to worry about updating your software libraries again! Just send a simple HTTP request and get the result instantly.
Simply sign up and get your API key, then include it when you make API requests.
Here's an example of calling our API with Python to decode a user agent - this will output the Browser Name, Version, Operating System Name & Version in a readable string - there are lots of extra fields in the response which you can use as well. It also checks if the web browser is up to date and warns you if it isn't.
The above snippit of code is quite straight-forward and is just intended to get you started. We have more detailed sample code for Python and many other languages. The sample code also shows you how use the other API End Points - so that you can send hundreds of user agents in a single batch, get all the latest web browser and operating system version numbers, or even download or search our database of over 410 million user agents.
There are lots of reasons you might need to use Python to parse user agents. The primary one is that you need to warn your visitors that their web browser is out of date and might not work on your site. You might also want to customise your content, Calls to Action, and promotions based on the type of hardware and/or software that they're using.
As well as that, decoding your visitor's user agents can help you understand the general trends on your website - how many visitors access your site on mobile devices each month? What about Smart TVs?! With our API you can find out the answer to these sorts of questions, and use the information to help plan, design, and run your site even better.
The API is free to use and easy to set up, so why not get started right now.
Do you have a question? Get in touch! We'd love to help you.