What is it?
The Diwigo user agent API reads a browser user agent and returns the browser, version, operating system, device type and whether it is a bot.
It answers with JSON and is included in the free plan: 10,000 requests per API key and per month.
Example request
GET https://landing.diwigo.com/api/?key=YOUR_API_KEY&ua=Mozilla/5.0%20(iPhone;%20CPU%20iPhone%20OS%2018_1%20like%20Mac%20OS%20X)
Parameters
| Parameter | Description |
|---|---|
key | Your API key (required) |
ua | User agent string (optional) |
Code examples
curl "https://landing.diwigo.com/api/?key=YOUR_API_KEY&ua=Mozilla/5.0%20(iPhone;%20CPU%20iPhone%20OS%2018_1%20like%20Mac%20OS%20X)"
const res = await fetch("https://landing.diwigo.com/api/?key=YOUR_API_KEY&ua=Mozilla/5.0%20(iPhone;%20CPU%20iPhone%20OS%2018_1%20like%20Mac%20OS%20X)");
const data = await res.json();
console.log(data);
<?php
$response = file_get_contents("https://landing.diwigo.com/api/?key=YOUR_API_KEY&ua=Mozilla/5.0%20(iPhone;%20CPU%20iPhone%20OS%2018_1%20like%20Mac%20OS%20X)");
$data = json_decode($response, true);
print_r($data);
import requests
response = requests.get("https://landing.diwigo.com/api/?key=YOUR_API_KEY&ua=Mozilla/5.0%20(iPhone;%20CPU%20iPhone%20OS%2018_1%20like%20Mac%20OS%20X)")
print(response.json())
Use cases
- Analytics without heavy libraries
- Adapt pages to mobile or desktop
- Detect bots in logs
User agent parser: questions and answers
What does the User agent parser API do?
The Diwigo user agent API reads a browser user agent and returns the browser, version, operating system, device type and whether it is a bot.
How do I call the User agent parser API?
Send a GET request to https://landing.diwigo.com/api/?key=YOUR_API_KEY&ua=Mozilla/5.0%20(iPhone;%20CPU%20iPhone%20OS%2018_1%20like%20Mac%20OS%20X) with your own API key instead of YOUR_API_KEY. It answers with JSON.
Is the User agent parser API free?
Yes, it is included in the free plan: 10,000 requests per API key and per calendar month, shared by all Diwigo endpoints. Higher limits are available on request.