For the Enterprise solution, device data is packaged in a JSON format, which is highly compressed to reduce server footprint, and optimized for speed of search and retrieval. It can either be downloaded manually or fetched with an automated script.
In the Cloud Service, data is delivered on demand for the specific device headers submitted via the Client API. See the Getting Started guide for Cloud APIs.
Download frequency
The device data is updated daily, and we recommend that you update the data file on a regular basis to ensure you have the most up-to-date device data.
Data file types
The device data file comes in three forms:
Personal
This is the primary data file and is configurable in multiple ways:
- It contains any device data entries made through the device pages when logged into your account. This enables you to modify the specifications of a device just for your account;
- It contains the set of properties you specify at Data File Options (My Account / Data File Options). This enables fine-grained control over the footprint and performance of the deployment.
- Inclusion of desktop properties can be enabled or disabled according to the use case.
For customizing your personal JSON file, please see the Data File Configuration page.
Community
Contains all of the base data and is compatible with APIs v1.4 and above.
This option is deprecated.
Private
This option applies to v2 data files only and contains the base data, personal data and any private data that you have added to your account. Private data is an optional extra with the Enterprise License and allows you to specify your own User-Agents and properties. In addition, any options set on your Data File Options page will affect this file. An example use case is to add pre-release devices in a secure way, with no exposure of the data to any other party.
Content of data file
You can manage the content of the data file to optimise performance.
By default, the evaluation data file contains a limited property set, but these can be extended via Data File Options (My Account / Data File Options). Please note that adding properties will increase the footprint and will affect performance. Any changes made will take effect in the next data file download.
Automatic downloads
It is strongly recommended to setup a regular automated data download. The data file can be downloaded from this simple download page by passing the correct parameters in the URL. Either HTTP or HTTPs can be used to fetch the device data.
URL: https://deviceatlas.com/getJSON.php
Download parameters
The download request must use the following parameters:
licencekey=YOUR_LICENCE_KEY
License key for your account.
format=[zip|gzip]
Compression format.
version=[2|3]
Data File version, should be to relative to API version in use, default for this can be set in account's data file options page.
data=[my|priv]
JSON type to download, defaults to personal "my". The "priv" option applies to v2 data files only.
md5=[1|0]
Set to "1" to download the MD5 file for the JSON.
date=yyyy-mm-dd
Specify to download a previously generated data file.
index=[web|apps|web,apps] e.g. index=web or index=apps or index=web,apps
Data indexing method, being "web" to index by User-Agent, "apps" to index by device vendor-model name and "web,apps" to index by both User-Agent and device vendor-model name.
indexcase=[mixed|lower|upper] e.g. indexcase=lower
Alternative index casing, for "lower" option the data file is generated using lowercase strings only, "mixed" is used by default where all strings are used as seen in the traffic without any modification.
Examples
Download the latest data file in zip format:https://deviceatlas.com/getJSON.php?licencekey=LICENCE_KEY&format=zip
Download the MD5 checksum file for the latest data file:
https://deviceatlas.com/getJSON.php?licencekey=LICENCE_KEY&format=zip&md5=1
Download a past data file:
https://deviceatlas.com/getJSON.php?licencekey=LICENCE_KEY&format=zip&date=2011-08-09
Sample shell script
A sample shell script to download the latest data file and verify it with the MD5 checksum file.
Environment | Download script |
---|---|
Bash | deviceatlas_auto_download.sh |
PowerShell | deviceatlas_auto_download.ps1 |
Download verification
Verification of a downloaded data file is very important to ensure the whole file was received and it is not corrupted. Setting the MD5 parameter to "1" will download a text file containing the MD5 hash of the main data file which can then be compared against the full data file.
Downloading past files
Past data files can be requested by setting the date parameter. If a personal data file is requested for a particular date, it is required that you have already downloaded that file in the past. Community data files do not have this restriction.
Installing the data file
Once the data file is downloaded the DeviceAtlas API needs to be told to reload it. This is a simple process and can be done as follows, typically taking a fraction of a second. Device recognition is not affected during a data file reload.
Examples
Java: deviceApi.loadDataFromFile("/path/to/DeviceAtlas.json");
.NET: deviceApi.LoadDataFromFile("/path/to/DeviceAtlas.json");
PHP: $deviceApi->loadDataFromFile("/path/to/DeviceAtlas.json");
Take a look at the documentation specific to your API for further details.