{"__v":1,"_id":"55fcb263a1dbbe0d001a139e","api":{"auth":"required","params":[],"results":{"codes":[]},"settings":"","url":""},"body":"Handset Detection is a powerful detection library that can detect millions of combinations device, operating system, browser and app. \n\nYou'll need to signup, and grab an account before you can get started.","category":"55fcb262a1dbbe0d001a139b","createdAt":"2015-09-19T00:34:03.808Z","excerpt":"This page will help you get started with HandsetDetection. You'll be up and running in no time at all.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"55fcad7951dbf70d00c61b3b","slug":"getting-started","sync_unique":"","title":"Getting Started","type":"basic","updates":[],"user":"55fcad15b652110d00758ada","version":"55fcb261a1dbbe0d001a139a","childrenPages":[]}

Getting Started

This page will help you get started with HandsetDetection. You'll be up and running in no time at all.

Handset Detection is a powerful detection library that can detect millions of combinations device, operating system, browser and app. You'll need to signup, and grab an account before you can get started.
{"__v":3,"_id":"55fdfe795130171900235a80","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"body":"We have 3 detection methods to choose from. \n\n## Express Detection\n\nExpress Detection is our most popular detection option. Its perfect for redirecting mobile visitors to a mobile website, calling out the device type on a webpage or optimising a redirect based on carrier, location or device properties. There’s no server scripts or complicated setup. Tick a few boxes, fill out a field, then copy and paste a code snippet (javascript) into the <head> section of your web pages. Job Done. \n\nFor more information see the APIv4 - Express Detection page.\n\n## Cloud Detection\n\nCloud Detection is our medium tech solution. Choose an API Kit, configure it with your access credentials and you’re detecting devices. API kits are small footprint and give you full control over the detection process. Simply pass the HTTP headers from your web request to the API kit and it’ll pass back the detection results.\n\n## Ultimate Detection\n\nUltimate Detection is our high tech, high performance detection solution. It uses the same API kits as Cloud Detection, just flicked over into Ultimate (local) mode. Expect performance in the thousands of detections per second range on modest hardware. There are no database dependencies and everything runs completely in memory, so its blazingly fast.\n\n## Cloud Detection vs Ultimate Detection\n\nCloud and Ultimate are both built into each each supported API kit. You can switch between Cloud and Ultimate simply by changing a config file option in each kit. They also share identical API calls and identical API replies, so its a breeze to start with one and switch to the other if requirements change in the future.\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"body\": \"You will need an Ultimate licence to download the datafiles necessary for local detection.\",\n  \"title\": \"Ultimate Licence\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"High Accuracy\",\n  \"body\": \"All our services contain enhanced checks for device type, operating system (platform), browser and app. We dig deep into the information to ensure our results are as accurate as possible and don't simply rely on the operating system or browser that shipped with a device.\"\n}\n[/block]","category":"55fcb262a1dbbe0d001a139b","createdAt":"2015-09-20T00:31:53.133Z","excerpt":"3 ways to detect devices.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":1,"parentDoc":null,"project":"55fcad7951dbf70d00c61b3b","slug":"integrations","sync_unique":"","title":"Integrations","type":"basic","updates":[],"user":"55fcad15b652110d00758ada","version":"55fcb261a1dbbe0d001a139a","childrenPages":[]}

Integrations

3 ways to detect devices.

We have 3 detection methods to choose from. ## Express Detection Express Detection is our most popular detection option. Its perfect for redirecting mobile visitors to a mobile website, calling out the device type on a webpage or optimising a redirect based on carrier, location or device properties. There’s no server scripts or complicated setup. Tick a few boxes, fill out a field, then copy and paste a code snippet (javascript) into the <head> section of your web pages. Job Done. For more information see the APIv4 - Express Detection page. ## Cloud Detection Cloud Detection is our medium tech solution. Choose an API Kit, configure it with your access credentials and you’re detecting devices. API kits are small footprint and give you full control over the detection process. Simply pass the HTTP headers from your web request to the API kit and it’ll pass back the detection results. ## Ultimate Detection Ultimate Detection is our high tech, high performance detection solution. It uses the same API kits as Cloud Detection, just flicked over into Ultimate (local) mode. Expect performance in the thousands of detections per second range on modest hardware. There are no database dependencies and everything runs completely in memory, so its blazingly fast. ## Cloud Detection vs Ultimate Detection Cloud and Ultimate are both built into each each supported API kit. You can switch between Cloud and Ultimate simply by changing a config file option in each kit. They also share identical API calls and identical API replies, so its a breeze to start with one and switch to the other if requirements change in the future. [block:callout] { "type": "warning", "body": "You will need an Ultimate licence to download the datafiles necessary for local detection.", "title": "Ultimate Licence" } [/block] [block:callout] { "type": "info", "title": "High Accuracy", "body": "All our services contain enhanced checks for device type, operating system (platform), browser and app. We dig deep into the information to ensure our results are as accurate as possible and don't simply rely on the operating system or browser that shipped with a device." } [/block]
We have 3 detection methods to choose from. ## Express Detection Express Detection is our most popular detection option. Its perfect for redirecting mobile visitors to a mobile website, calling out the device type on a webpage or optimising a redirect based on carrier, location or device properties. There’s no server scripts or complicated setup. Tick a few boxes, fill out a field, then copy and paste a code snippet (javascript) into the <head> section of your web pages. Job Done. For more information see the APIv4 - Express Detection page. ## Cloud Detection Cloud Detection is our medium tech solution. Choose an API Kit, configure it with your access credentials and you’re detecting devices. API kits are small footprint and give you full control over the detection process. Simply pass the HTTP headers from your web request to the API kit and it’ll pass back the detection results. ## Ultimate Detection Ultimate Detection is our high tech, high performance detection solution. It uses the same API kits as Cloud Detection, just flicked over into Ultimate (local) mode. Expect performance in the thousands of detections per second range on modest hardware. There are no database dependencies and everything runs completely in memory, so its blazingly fast. ## Cloud Detection vs Ultimate Detection Cloud and Ultimate are both built into each each supported API kit. You can switch between Cloud and Ultimate simply by changing a config file option in each kit. They also share identical API calls and identical API replies, so its a breeze to start with one and switch to the other if requirements change in the future. [block:callout] { "type": "warning", "body": "You will need an Ultimate licence to download the datafiles necessary for local detection.", "title": "Ultimate Licence" } [/block] [block:callout] { "type": "info", "title": "High Accuracy", "body": "All our services contain enhanced checks for device type, operating system (platform), browser and app. We dig deep into the information to ensure our results are as accurate as possible and don't simply rely on the operating system or browser that shipped with a device." } [/block]
{"__v":5,"_id":"55fe01b2b652110d00758b8f","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"body":"Our API is presently at v4. Its a small API with a few endpoints. Documentation for previous API versions can be found at http://www.handsetdetection.com/resources\n\nWe revise our API when we offer major functionality updates or introduce breaking changes into our detection system.\n\n## API v1 2008 - 2010\n\n- Basic device detection.\n- API Key based Authentication\n\n## API v2 2009 - Still supported\n\n- Device and Tablet detection.\n- X-WSSE Authentication (Token in HTTP Headers)\n\n## API v3 2012 - Still supported\n\n- Device & Tablet detection.\n- Custom detection for mobile platforms (operating systems) and mobile browsers.\n- HTTP auth digest authentication (modified for performance - see below).\n- Introduced Ultimate detection (our stand alone detection product).\n\n## API v4 2015 - Still supported\n\n- Detection for the internet of everything - computers, handsets, tablets, sensors, bots, TVs & more.\n- Custom detection for all platforms (all operating systems), all browsers and mobile apps.\n- Multiple detection methods\n  - Detection via HTTP headers for web apps.\n  - Detection via native build information for native apps.","category":"55fcb262a1dbbe0d001a139b","createdAt":"2015-09-20T00:45:38.723Z","excerpt":"A little API history","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":2,"parentDoc":null,"project":"55fcad7951dbf70d00c61b3b","slug":"api-versions","sync_unique":"","title":"API Versions","type":"basic","updates":[],"user":"55fcad15b652110d00758ada","version":"55fcb261a1dbbe0d001a139a","childrenPages":[]}

API Versions

A little API history

Our API is presently at v4. Its a small API with a few endpoints. Documentation for previous API versions can be found at http://www.handsetdetection.com/resources We revise our API when we offer major functionality updates or introduce breaking changes into our detection system. ## API v1 2008 - 2010 - Basic device detection. - API Key based Authentication ## API v2 2009 - Still supported - Device and Tablet detection. - X-WSSE Authentication (Token in HTTP Headers) ## API v3 2012 - Still supported - Device & Tablet detection. - Custom detection for mobile platforms (operating systems) and mobile browsers. - HTTP auth digest authentication (modified for performance - see below). - Introduced Ultimate detection (our stand alone detection product). ## API v4 2015 - Still supported - Detection for the internet of everything - computers, handsets, tablets, sensors, bots, TVs & more. - Custom detection for all platforms (all operating systems), all browsers and mobile apps. - Multiple detection methods - Detection via HTTP headers for web apps. - Detection via native build information for native apps.
Our API is presently at v4. Its a small API with a few endpoints. Documentation for previous API versions can be found at http://www.handsetdetection.com/resources We revise our API when we offer major functionality updates or introduce breaking changes into our detection system. ## API v1 2008 - 2010 - Basic device detection. - API Key based Authentication ## API v2 2009 - Still supported - Device and Tablet detection. - X-WSSE Authentication (Token in HTTP Headers) ## API v3 2012 - Still supported - Device & Tablet detection. - Custom detection for mobile platforms (operating systems) and mobile browsers. - HTTP auth digest authentication (modified for performance - see below). - Introduced Ultimate detection (our stand alone detection product). ## API v4 2015 - Still supported - Detection for the internet of everything - computers, handsets, tablets, sensors, bots, TVs & more. - Custom detection for all platforms (all operating systems), all browsers and mobile apps. - Multiple detection methods - Detection via HTTP headers for web apps. - Detection via native build information for native apps.
{"__v":1,"_id":"55fe0f6a5c67200d00fa2f1d","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"body":"Version 4 of our API uses http digest for authentication over both http, and optionally https. While http digest is great for authentication and security it does involve a challenge and its response, which doubles the request overhead.\n\nTo overcome the challenge response all API Kits 'pre compute' the challenge and send a fully formed digest header with each query. This speeds up requests and ensures web service queries can be answered in one reply. \n\n[Auth Digest at Wikipedia](http://en.wikipedia.org/wiki/Digest_access_authentication \"Auth Digest\")\n\nTo pre-compute the digest we set the realm to 'APIv4' and the nonce (from the server) to 'APIv4', then follow the [RFC-2617](https://tools.ietf.org/html/rfc2617 \"RFC 2617\") calculation for the auth digest header (which is more easily grock'd from the Wikipedia page above).","category":"55fcb262a1dbbe0d001a139b","createdAt":"2015-09-20T01:44:10.606Z","excerpt":"HTTP Digest authentication performance in API kits.","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":3,"parentDoc":null,"project":"55fcad7951dbf70d00c61b3b","slug":"authentication","sync_unique":"","title":"Authentication","type":"basic","updates":[],"user":"55fcad15b652110d00758ada","version":"55fcb261a1dbbe0d001a139a","childrenPages":[]}

Authentication

HTTP Digest authentication performance in API kits.

Version 4 of our API uses http digest for authentication over both http, and optionally https. While http digest is great for authentication and security it does involve a challenge and its response, which doubles the request overhead. To overcome the challenge response all API Kits 'pre compute' the challenge and send a fully formed digest header with each query. This speeds up requests and ensures web service queries can be answered in one reply. [Auth Digest at Wikipedia](http://en.wikipedia.org/wiki/Digest_access_authentication "Auth Digest") To pre-compute the digest we set the realm to 'APIv4' and the nonce (from the server) to 'APIv4', then follow the [RFC-2617](https://tools.ietf.org/html/rfc2617 "RFC 2617") calculation for the auth digest header (which is more easily grock'd from the Wikipedia page above).
Version 4 of our API uses http digest for authentication over both http, and optionally https. While http digest is great for authentication and security it does involve a challenge and its response, which doubles the request overhead. To overcome the challenge response all API Kits 'pre compute' the challenge and send a fully formed digest header with each query. This speeds up requests and ensures web service queries can be answered in one reply. [Auth Digest at Wikipedia](http://en.wikipedia.org/wiki/Digest_access_authentication "Auth Digest") To pre-compute the digest we set the realm to 'APIv4' and the nonce (from the server) to 'APIv4', then follow the [RFC-2617](https://tools.ietf.org/html/rfc2617 "RFC 2617") calculation for the auth digest header (which is more easily grock'd from the Wikipedia page above).
{"__v":5,"_id":"56f8918ed4939e0e006b43a3","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"body":"Pre made API kits are available from our GitHub repos at http://github.com/HandsetDetection\n\nKits are available for [PHP](https://github.com/HandsetDetection/php-apikit \"PHP API Kit\"), [Java](https://github.com/HandsetDetection/java-apikit \"Java API Kit\"), [Python](https://github.com/HandsetDetection/python-apikit \"Python API Kit\"), [.NET](https://github.com/HandsetDetection/dotnet40-apikit \".NET API Kit\") and [Ruby on Rails](https://github.com/HandsetDetection/rails-apikit \"Ruby on Rails API Kit\") \n\nAll kits operate in both web service and local (on premise) mode and you can toggle between modes by simply changing a config file option.","category":"55fcb262a1dbbe0d001a139b","createdAt":"2016-03-28T02:06:06.306Z","excerpt":"Get started fast with our pre-made API kits.","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"http://github.com/HandsetDetection","order":4,"parentDoc":null,"project":"55fcad7951dbf70d00c61b3b","slug":"api-kits","sync_unique":"","title":"API Kits","type":"basic","updates":[],"user":"55fcad15b652110d00758ada","version":"55fcb261a1dbbe0d001a139a","childrenPages":[]}

API Kits

Get started fast with our pre-made API kits.

Pre made API kits are available from our GitHub repos at http://github.com/HandsetDetection Kits are available for [PHP](https://github.com/HandsetDetection/php-apikit "PHP API Kit"), [Java](https://github.com/HandsetDetection/java-apikit "Java API Kit"), [Python](https://github.com/HandsetDetection/python-apikit "Python API Kit"), [.NET](https://github.com/HandsetDetection/dotnet40-apikit ".NET API Kit") and [Ruby on Rails](https://github.com/HandsetDetection/rails-apikit "Ruby on Rails API Kit") All kits operate in both web service and local (on premise) mode and you can toggle between modes by simply changing a config file option.
Pre made API kits are available from our GitHub repos at http://github.com/HandsetDetection Kits are available for [PHP](https://github.com/HandsetDetection/php-apikit "PHP API Kit"), [Java](https://github.com/HandsetDetection/java-apikit "Java API Kit"), [Python](https://github.com/HandsetDetection/python-apikit "Python API Kit"), [.NET](https://github.com/HandsetDetection/dotnet40-apikit ".NET API Kit") and [Ruby on Rails](https://github.com/HandsetDetection/rails-apikit "Ruby on Rails API Kit") All kits operate in both web service and local (on premise) mode and you can toggle between modes by simply changing a config file option.
{"__v":2,"_id":"55fe075e948a830d0023a5aa","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"body":"","category":"55fdfec0b652110d00758b8d","createdAt":"2015-09-20T01:09:50.593Z","excerpt":"Setting up Express Detection","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"55fcad7951dbf70d00c61b3b","slug":"set-up","sync_unique":"","title":"Set up with the Wizard","type":"basic","updates":[],"user":"55fcad15b652110d00758ada","version":"55fcb261a1dbbe0d001a139a","childrenPages":[]}

Set up with the Wizard

Setting up Express Detection

{"__v":2,"_id":"55fe07735c67200d00fa2f10","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"body":"Login to Handset Detection, create your site and setup any redirection rules. \n\nAfter you’ve completed that grab the Site ID, this is the unique number which we use to reference your site internally.\n\nPaste the script below into your wordpress theme’s function.php file by Logging in to WordPress, then click Dashboard > Appearance > Editor. \n\nFrom the menu on the right hand side choose the Theme Functions (functions.php) file.\nCopy and the snippet below and paste it into the very end of the file. \n\nAfter pasting, substitute your Site ID for xxx, then save the file.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"/**\\n ** Handset Detection\\n **/\\nif (! is_admin()) {\\n    wp_enqueue_script('handsetdetection', 'http://api.handsetdetection.com/sites/js/xxx.js', '1' , 0);\\n}\\n\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]\nJob done ! Now test.\n\nThis snippet ensures that detection will only take place on the standard pages for the WordPress website, not the admin pages. \n\nFor best results enable ‘Smart Redirection’ on your website settings in Handset Detection.","category":"55fdfec0b652110d00758b8d","createdAt":"2015-09-20T01:10:11.143Z","excerpt":"Using Express Detection with Wordpress","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":1,"parentDoc":null,"project":"55fcad7951dbf70d00c61b3b","slug":"with-wordpress","sync_unique":"","title":"With Wordpress","type":"basic","updates":[],"user":"55fcad15b652110d00758ada","version":"55fcb261a1dbbe0d001a139a","childrenPages":[]}

With Wordpress

Using Express Detection with Wordpress

Login to Handset Detection, create your site and setup any redirection rules. After you’ve completed that grab the Site ID, this is the unique number which we use to reference your site internally. Paste the script below into your wordpress theme’s function.php file by Logging in to WordPress, then click Dashboard > Appearance > Editor. From the menu on the right hand side choose the Theme Functions (functions.php) file. Copy and the snippet below and paste it into the very end of the file. After pasting, substitute your Site ID for xxx, then save the file. [block:code] { "codes": [ { "code": "/**\n ** Handset Detection\n **/\nif (! is_admin()) {\n wp_enqueue_script('handsetdetection', 'http://api.handsetdetection.com/sites/js/xxx.js', '1' , 0);\n}\n", "language": "php" } ] } [/block] Job done ! Now test. This snippet ensures that detection will only take place on the standard pages for the WordPress website, not the admin pages. For best results enable ‘Smart Redirection’ on your website settings in Handset Detection.
Login to Handset Detection, create your site and setup any redirection rules. After you’ve completed that grab the Site ID, this is the unique number which we use to reference your site internally. Paste the script below into your wordpress theme’s function.php file by Logging in to WordPress, then click Dashboard > Appearance > Editor. From the menu on the right hand side choose the Theme Functions (functions.php) file. Copy and the snippet below and paste it into the very end of the file. After pasting, substitute your Site ID for xxx, then save the file. [block:code] { "codes": [ { "code": "/**\n ** Handset Detection\n **/\nif (! is_admin()) {\n wp_enqueue_script('handsetdetection', 'http://api.handsetdetection.com/sites/js/xxx.js', '1' , 0);\n}\n", "language": "php" } ] } [/block] Job done ! Now test. This snippet ensures that detection will only take place on the standard pages for the WordPress website, not the admin pages. For best results enable ‘Smart Redirection’ on your website settings in Handset Detection.
{"__v":2,"_id":"55fe07899f5a880d00a6c26e","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"body":"Variable substitution provides a simple and powerful way of creating custom redirects based on the source page and device detection results. You can preserve query parameters and include detection results in your redirects. \n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"$vendor$\",\n    \"0-1\": \"The device vendor\",\n    \"1-0\": \"$model$\",\n    \"1-1\": \"The device model\",\n    \"2-0\": \"$os$\",\n    \"2-1\": \"The device operating system\",\n    \"3-0\": \"$osversion$\",\n    \"3-1\": \"The device operating system version\",\n    \"4-0\": \"$browser$\",\n    \"4-1\": \"The device browser\",\n    \"5-0\": \"$browserversion$\",\n    \"5-1\": \"The device browser version\",\n    \"6-0\": \"$formfactor$\",\n    \"6-1\": \"Bar, Clamshell, Slide, Dual Slide, Swivel, Tablet\",\n    \"7-0\": \"$class$\",\n    \"7-1\": \"Mobile, Tablet, Console, Camera, Glass\",\n    \"8-0\": \"$width$\",\n    \"8-1\": \"Screen width in normal orientation (pixels)\",\n    \"9-0\": \"$height$\",\n    \"9-1\": \"Screen height in normal orientation (pixels)\",\n    \"10-0\": \"$country$\",\n    \"10-1\": \"The country the device is being used in\",\n    \"11-0\": \"$isp$\",\n    \"11-1\": \"The ISP or Carrier the device is accessing the internet through\",\n    \"12-0\": \"$scheme$\",\n    \"12-1\": \"http or https (how the script was called)\",\n    \"13-0\": \"$host$\",\n    \"13-1\": \"The website that downloaded this detection script (eg www.example.com)\",\n    \"14-0\": \"$path$\",\n    \"14-1\": \"The path to the page that called this detection script. (eg /some/path/page.html)\",\n    \"15-0\": \"$query$\",\n    \"15-1\": \"Any query variables from the page that called this script (eg q=red+shoes&category=shoes)\",\n    \"16-0\": \"$fragment$\",\n    \"16-1\": \"Anything after the # from the page that called this script\"\n  },\n  \"cols\": 2,\n  \"rows\": 17\n}\n[/block]","category":"55fdfec0b652110d00758b8d","createdAt":"2015-09-20T01:10:33.742Z","excerpt":"Substitute variables into your redirection URL.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":2,"parentDoc":null,"project":"55fcad7951dbf70d00c61b3b","slug":"variable-substitution","sync_unique":"","title":"Variable substitution","type":"basic","updates":[],"user":"55fcad15b652110d00758ada","version":"55fcb261a1dbbe0d001a139a","childrenPages":[]}

Variable substitution

Substitute variables into your redirection URL.

Variable substitution provides a simple and powerful way of creating custom redirects based on the source page and device detection results. You can preserve query parameters and include detection results in your redirects. [block:parameters] { "data": { "0-0": "$vendor$", "0-1": "The device vendor", "1-0": "$model$", "1-1": "The device model", "2-0": "$os$", "2-1": "The device operating system", "3-0": "$osversion$", "3-1": "The device operating system version", "4-0": "$browser$", "4-1": "The device browser", "5-0": "$browserversion$", "5-1": "The device browser version", "6-0": "$formfactor$", "6-1": "Bar, Clamshell, Slide, Dual Slide, Swivel, Tablet", "7-0": "$class$", "7-1": "Mobile, Tablet, Console, Camera, Glass", "8-0": "$width$", "8-1": "Screen width in normal orientation (pixels)", "9-0": "$height$", "9-1": "Screen height in normal orientation (pixels)", "10-0": "$country$", "10-1": "The country the device is being used in", "11-0": "$isp$", "11-1": "The ISP or Carrier the device is accessing the internet through", "12-0": "$scheme$", "12-1": "http or https (how the script was called)", "13-0": "$host$", "13-1": "The website that downloaded this detection script (eg www.example.com)", "14-0": "$path$", "14-1": "The path to the page that called this detection script. (eg /some/path/page.html)", "15-0": "$query$", "15-1": "Any query variables from the page that called this script (eg q=red+shoes&category=shoes)", "16-0": "$fragment$", "16-1": "Anything after the # from the page that called this script" }, "cols": 2, "rows": 17 } [/block]
Variable substitution provides a simple and powerful way of creating custom redirects based on the source page and device detection results. You can preserve query parameters and include detection results in your redirects. [block:parameters] { "data": { "0-0": "$vendor$", "0-1": "The device vendor", "1-0": "$model$", "1-1": "The device model", "2-0": "$os$", "2-1": "The device operating system", "3-0": "$osversion$", "3-1": "The device operating system version", "4-0": "$browser$", "4-1": "The device browser", "5-0": "$browserversion$", "5-1": "The device browser version", "6-0": "$formfactor$", "6-1": "Bar, Clamshell, Slide, Dual Slide, Swivel, Tablet", "7-0": "$class$", "7-1": "Mobile, Tablet, Console, Camera, Glass", "8-0": "$width$", "8-1": "Screen width in normal orientation (pixels)", "9-0": "$height$", "9-1": "Screen height in normal orientation (pixels)", "10-0": "$country$", "10-1": "The country the device is being used in", "11-0": "$isp$", "11-1": "The ISP or Carrier the device is accessing the internet through", "12-0": "$scheme$", "12-1": "http or https (how the script was called)", "13-0": "$host$", "13-1": "The website that downloaded this detection script (eg www.example.com)", "14-0": "$path$", "14-1": "The path to the page that called this detection script. (eg /some/path/page.html)", "15-0": "$query$", "15-1": "Any query variables from the page that called this script (eg q=red+shoes&category=shoes)", "16-0": "$fragment$", "16-1": "Anything after the # from the page that called this script" }, "cols": 2, "rows": 17 } [/block]
{"__v":1,"_id":"55fe07a05c67200d00fa2f12","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"body":"","category":"55fdfec0b652110d00758b8d","createdAt":"2015-09-20T01:10:56.895Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":3,"parentDoc":null,"project":"55fcad7951dbf70d00c61b3b","slug":"calling-out-detection-results","sync_unique":"","title":"Calling out detection results","type":"basic","updates":[],"user":"55fcad15b652110d00758ada","version":"55fcb261a1dbbe0d001a139a","childrenPages":[]}

Calling out detection results


{"__v":3,"_id":"55fe07d0cc468e0d008dcddc","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"body":"Legendary kung fu master Bruce Lee practiced the art of fighting without fighting. Similarly, you can tap this great power. Use it wisely.\n\nExpress Detection (our fancy name for javascript device detection) happens in two parts. \n\nEach detection dynamically generates javascript which gets sent to the device with the detection results embedded in the script. The device reads the script and performs a redirection based on rules setup inside the site’s settings on Handset Detection.\n\nBy creating a site with no redirection rules the script acts as just a detector. \n\nYou can then access the detection results directly from javascript.\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Ensure the script has loaded before accessing the hdRequestInfo object.\"\n}\n[/block]\nThe Basic Detector (<script type=’text/javascript’ src=’http://api.localhost/sites/js/[your-site-id].js’></script>) makes this easy, or rig up something to execute after the script has been loaded.\n\nThe examples below contain the results for a Google Nexus 7 detection and a standard desktop browser (or a mobile after the detection quota has been reached). \n\nAccess the variables via hdRequestInfo.ismobile, hdRequestInfo.os, hdRequestInfo.hdclass etc … The full list of variables are below.\n\nGoogle Nexus 7\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"var hdRequestInfo = {\\n\\tismobile : false,\\n\\tistablet : true,\\n\\tisconsole : false,\\n\\twidth :\\t1920,\\n\\theight : 1200,\\n\\tformfactor : \\\"tablet\\\",\\n\\thdclass : \\\"tablet\\\",\\n\\tvendor : \\\"google\\\",\\n\\tmodel : \\\"nexus 7\\\", \\n\\tos : \\\"android\\\",\\n\\tosversion : \\\"4.3\\\",\\n\\tbrowser : \\\"android chrome\\\", \\n\\tbrowserversion : \\\"42.0\\\",\\n\\turls : [\\\"www.starport.net\\\",\\\"m.starport.net\\\",\\\"t.starport.net\\\",\\\"www.jones.com\\\"],\\n\\tcountry : \\\"au\\\",\\n\\tcity : \\\"caloundra\\\",\\n\\tregion : \\\"queensland\\\",\\n\\tisp : \\\"optus\\\",\\n\\tcompany : \\\"optus wireless\\\",\\n\\tsid : \\\"5607d295370e760b4003c598\\\",\\n\\tinternalreferrer : 0,\\n\\tdisplaysize : 7,\\n\\taliases : \\\"\\\",\\n\\tppi : 323,\\n\\tfeatures : \\\"Unlimited entries,Calendar,Alarm,Document viewer,Calculator,IMAP,POP3,SMTP,Microsoft Exchange,Email,Google Talk,Mass storage device,USB charging,Computer sync,OTA sync,Music ringtones (MP3),Polyphonic ringtones,Vibration,Flight mode,Silent mode,Speakerphone,Accelerometer,Gyroscope,CompassVoice commands,Voice recording,Light sensor,Proximity sensor,Scratch-resistant glass,Games,Qi Integrated\\\",\\n\\tconnectors : \\\"USB 2.0,MicroUSB,3.5mm Audio\\\"\\n}\\n  \",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nApple OS X Laptop\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"// Script version 4.14\\nvar hdRequestInfo = {\\n\\tismobile : false,\\n\\tistablet : false,\\n\\tisconsole : false,\\n\\twidth :\\t1280,\\n\\theight : 800,\\n\\tformfactor : \\\"varies\\\",\\n\\thdclass : \\\"computer\\\",\\n\\tvendor : \\\"generic\\\",\\n\\tmodel : \\\"os x pc\\\", \\n\\tos : \\\"os x\\\",\\n\\tosversion : \\\"10.10\\\",\\n\\tbrowser : \\\"chrome\\\", \\n\\tbrowserversion : \\\"\\\",\\n\\turls : [\\\"www.starport.net\\\",\\\"m.starport.net\\\",\\\"t.starport.net\\\",\\\"www.jones.com\\\"],\\n\\tcountry : \\\"au\\\",\\n\\tcity : \\\"caloundra\\\",\\n\\tregion : \\\"queensland\\\",\\n\\tisp : \\\"optus\\\",\\n\\tcompany : \\\"optus wireless\\\",\\n\\tsid : \\\"5607d33f370e76897203ca5b\\\",\\n\\tinternalreferrer : 0,\\n\\tdisplaysize : 13.3,\\n\\taliases : \\\"\\\",\\n\\tppi : 113,\\n\\tfeatures : \\\"\\\",\\n\\tconnectors : \\\"\\\"\\n}\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Take care using Width and Height variables.\",\n  \"body\": \"Take care using width and height. Devices without screens may have these variables to 0.\"\n}\n[/block]","category":"55fdfec0b652110d00758b8d","createdAt":"2015-09-20T01:11:44.821Z","excerpt":"With great power, comes great responsibility !","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":4,"parentDoc":null,"project":"55fcad7951dbf70d00c61b3b","slug":"detection-without-redirection","sync_unique":"","title":"Detection without redirection","type":"basic","updates":[],"user":"55fcad15b652110d00758ada","version":"55fcb261a1dbbe0d001a139a","childrenPages":[]}

Detection without redirection

With great power, comes great responsibility !

Legendary kung fu master Bruce Lee practiced the art of fighting without fighting. Similarly, you can tap this great power. Use it wisely. Express Detection (our fancy name for javascript device detection) happens in two parts. Each detection dynamically generates javascript which gets sent to the device with the detection results embedded in the script. The device reads the script and performs a redirection based on rules setup inside the site’s settings on Handset Detection. By creating a site with no redirection rules the script acts as just a detector. You can then access the detection results directly from javascript. [block:callout] { "type": "warning", "title": "Ensure the script has loaded before accessing the hdRequestInfo object." } [/block] The Basic Detector (<script type=’text/javascript’ src=’http://api.localhost/sites/js/[your-site-id].js’></script>) makes this easy, or rig up something to execute after the script has been loaded. The examples below contain the results for a Google Nexus 7 detection and a standard desktop browser (or a mobile after the detection quota has been reached). Access the variables via hdRequestInfo.ismobile, hdRequestInfo.os, hdRequestInfo.hdclass etc … The full list of variables are below. Google Nexus 7 [block:code] { "codes": [ { "code": "var hdRequestInfo = {\n\tismobile : false,\n\tistablet : true,\n\tisconsole : false,\n\twidth :\t1920,\n\theight : 1200,\n\tformfactor : \"tablet\",\n\thdclass : \"tablet\",\n\tvendor : \"google\",\n\tmodel : \"nexus 7\", \n\tos : \"android\",\n\tosversion : \"4.3\",\n\tbrowser : \"android chrome\", \n\tbrowserversion : \"42.0\",\n\turls : [\"www.starport.net\",\"m.starport.net\",\"t.starport.net\",\"www.jones.com\"],\n\tcountry : \"au\",\n\tcity : \"caloundra\",\n\tregion : \"queensland\",\n\tisp : \"optus\",\n\tcompany : \"optus wireless\",\n\tsid : \"5607d295370e760b4003c598\",\n\tinternalreferrer : 0,\n\tdisplaysize : 7,\n\taliases : \"\",\n\tppi : 323,\n\tfeatures : \"Unlimited entries,Calendar,Alarm,Document viewer,Calculator,IMAP,POP3,SMTP,Microsoft Exchange,Email,Google Talk,Mass storage device,USB charging,Computer sync,OTA sync,Music ringtones (MP3),Polyphonic ringtones,Vibration,Flight mode,Silent mode,Speakerphone,Accelerometer,Gyroscope,CompassVoice commands,Voice recording,Light sensor,Proximity sensor,Scratch-resistant glass,Games,Qi Integrated\",\n\tconnectors : \"USB 2.0,MicroUSB,3.5mm Audio\"\n}\n ", "language": "text" } ] } [/block] Apple OS X Laptop [block:code] { "codes": [ { "code": "// Script version 4.14\nvar hdRequestInfo = {\n\tismobile : false,\n\tistablet : false,\n\tisconsole : false,\n\twidth :\t1280,\n\theight : 800,\n\tformfactor : \"varies\",\n\thdclass : \"computer\",\n\tvendor : \"generic\",\n\tmodel : \"os x pc\", \n\tos : \"os x\",\n\tosversion : \"10.10\",\n\tbrowser : \"chrome\", \n\tbrowserversion : \"\",\n\turls : [\"www.starport.net\",\"m.starport.net\",\"t.starport.net\",\"www.jones.com\"],\n\tcountry : \"au\",\n\tcity : \"caloundra\",\n\tregion : \"queensland\",\n\tisp : \"optus\",\n\tcompany : \"optus wireless\",\n\tsid : \"5607d33f370e76897203ca5b\",\n\tinternalreferrer : 0,\n\tdisplaysize : 13.3,\n\taliases : \"\",\n\tppi : 113,\n\tfeatures : \"\",\n\tconnectors : \"\"\n}", "language": "text" } ] } [/block] [block:callout] { "type": "warning", "title": "Take care using Width and Height variables.", "body": "Take care using width and height. Devices without screens may have these variables to 0." } [/block]
Legendary kung fu master Bruce Lee practiced the art of fighting without fighting. Similarly, you can tap this great power. Use it wisely. Express Detection (our fancy name for javascript device detection) happens in two parts. Each detection dynamically generates javascript which gets sent to the device with the detection results embedded in the script. The device reads the script and performs a redirection based on rules setup inside the site’s settings on Handset Detection. By creating a site with no redirection rules the script acts as just a detector. You can then access the detection results directly from javascript. [block:callout] { "type": "warning", "title": "Ensure the script has loaded before accessing the hdRequestInfo object." } [/block] The Basic Detector (<script type=’text/javascript’ src=’http://api.localhost/sites/js/[your-site-id].js’></script>) makes this easy, or rig up something to execute after the script has been loaded. The examples below contain the results for a Google Nexus 7 detection and a standard desktop browser (or a mobile after the detection quota has been reached). Access the variables via hdRequestInfo.ismobile, hdRequestInfo.os, hdRequestInfo.hdclass etc … The full list of variables are below. Google Nexus 7 [block:code] { "codes": [ { "code": "var hdRequestInfo = {\n\tismobile : false,\n\tistablet : true,\n\tisconsole : false,\n\twidth :\t1920,\n\theight : 1200,\n\tformfactor : \"tablet\",\n\thdclass : \"tablet\",\n\tvendor : \"google\",\n\tmodel : \"nexus 7\", \n\tos : \"android\",\n\tosversion : \"4.3\",\n\tbrowser : \"android chrome\", \n\tbrowserversion : \"42.0\",\n\turls : [\"www.starport.net\",\"m.starport.net\",\"t.starport.net\",\"www.jones.com\"],\n\tcountry : \"au\",\n\tcity : \"caloundra\",\n\tregion : \"queensland\",\n\tisp : \"optus\",\n\tcompany : \"optus wireless\",\n\tsid : \"5607d295370e760b4003c598\",\n\tinternalreferrer : 0,\n\tdisplaysize : 7,\n\taliases : \"\",\n\tppi : 323,\n\tfeatures : \"Unlimited entries,Calendar,Alarm,Document viewer,Calculator,IMAP,POP3,SMTP,Microsoft Exchange,Email,Google Talk,Mass storage device,USB charging,Computer sync,OTA sync,Music ringtones (MP3),Polyphonic ringtones,Vibration,Flight mode,Silent mode,Speakerphone,Accelerometer,Gyroscope,CompassVoice commands,Voice recording,Light sensor,Proximity sensor,Scratch-resistant glass,Games,Qi Integrated\",\n\tconnectors : \"USB 2.0,MicroUSB,3.5mm Audio\"\n}\n ", "language": "text" } ] } [/block] Apple OS X Laptop [block:code] { "codes": [ { "code": "// Script version 4.14\nvar hdRequestInfo = {\n\tismobile : false,\n\tistablet : false,\n\tisconsole : false,\n\twidth :\t1280,\n\theight : 800,\n\tformfactor : \"varies\",\n\thdclass : \"computer\",\n\tvendor : \"generic\",\n\tmodel : \"os x pc\", \n\tos : \"os x\",\n\tosversion : \"10.10\",\n\tbrowser : \"chrome\", \n\tbrowserversion : \"\",\n\turls : [\"www.starport.net\",\"m.starport.net\",\"t.starport.net\",\"www.jones.com\"],\n\tcountry : \"au\",\n\tcity : \"caloundra\",\n\tregion : \"queensland\",\n\tisp : \"optus\",\n\tcompany : \"optus wireless\",\n\tsid : \"5607d33f370e76897203ca5b\",\n\tinternalreferrer : 0,\n\tdisplaysize : 13.3,\n\taliases : \"\",\n\tppi : 113,\n\tfeatures : \"\",\n\tconnectors : \"\"\n}", "language": "text" } ] } [/block] [block:callout] { "type": "warning", "title": "Take care using Width and Height variables.", "body": "Take care using width and height. Devices without screens may have these variables to 0." } [/block]
{"__v":1,"_id":"55fe082a948a830d0023a5ac","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"body":"There’s a few advanced edge cases where you might want to force disable javascript redirection. \n\nHere’s how to do it.\n\n1) Check the ‘Manual Override’ box on your site profile.\n2) Append the &expressredirect=false to your URL.\n\nJob Done – That was easy. :)","category":"55fdfec0b652110d00758b8d","createdAt":"2015-09-20T01:13:14.065Z","excerpt":"Prevent express redirection when required.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":5,"parentDoc":null,"project":"55fcad7951dbf70d00c61b3b","slug":"manual-override","sync_unique":"","title":"Manual override","type":"basic","updates":[],"user":"55fcad15b652110d00758ada","version":"55fcb261a1dbbe0d001a139a","childrenPages":[]}

Manual override

Prevent express redirection when required.

There’s a few advanced edge cases where you might want to force disable javascript redirection. Here’s how to do it. 1) Check the ‘Manual Override’ box on your site profile. 2) Append the &expressredirect=false to your URL. Job Done – That was easy. :)
There’s a few advanced edge cases where you might want to force disable javascript redirection. Here’s how to do it. 1) Check the ‘Manual Override’ box on your site profile. 2) Append the &expressredirect=false to your URL. Job Done – That was easy. :)
{"__v":2,"_id":"55fe12bd5c67200d00fa2f20","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"body":"[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"The following notes apply to Cloud and Ultimate detection only !\",\n  \"body\": \"Express Detection has this functionality built into it.\"\n}\n[/block]\nHandset Detection uses HTTP headers (user-agent and others) to detect devices. Unfortunately many devices, by Apple in particular, share the same HTTP headers which makes it difficult to tell them apart. \n\nTo differentiate between devices that have the same HTTP headers we've developed a small javascript snippet that collects a few pieces of hardware information. When passed to a detection request it radially improves the accuracy of the result.\n\nThe script does the following things\n - Collects the screen width\n - Collects the screen height\n - Collects the device pixel ratio\n - Runs a micro benchmark (50 milliseconds)\n - Sets the information in a cookie (hd41)\n\nThe following script example loads a javascript at www.yourdomain.com/page.html with the results appended as a query string eg www.yourdomain.com/page.html?w=480&h=800&r=150&b=525\n\nYou could equally trigger a page reload with the string appended, include this inside any other script you have, or step new visitors through a temporary page.\n\nPass this information through to the detection engine by setting 'x-local-hardwareinfo' in the request body, and transforming the string into {width}:{height}:{ratio}:{benchmark}  eg 480:800:150:525\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"(function () {\\n\\tfunction serialize( obj ) {\\n\\t  return '?'+Object.keys(obj).reduce(function(a,k){a.push(k+'='+encodeURIComponent(obj[k]));return a},[]).join('&');\\n\\t}\\n\\tvar b = {},bd = [],bmt =+ new Date() +50;\\n\\tb.w = window.screen.width || 0;\\n\\tb.h = window.screen.height || 0;\\n\\tb.r = ~~((window.devicePixelRatio || 1) * 100);\\n\\t\\n\\tdo {\\n\\t\\tvar t,count=0,tt =+ new Date();\\n\\t\\tdo { t =+ new Date(); } while (t === tt)\\n\\t\\tdo { count++; tt= +new Date(); } while (t === tt)\\n\\t\\tif ((tt-t) === 1) { bd[bd.length] = count; }\\n\\t} while ((bd.length < 20) && (t < bmt))\\n\\n\\tvar sum = 0, n = bd.length || 1;\\n\\twhile (bd.length) { sum += bd.pop(); }\\n\\tb.m = ~~sum/n;\\n\\tvar d = new Date(); d.setTime(d.getTime() + (7 * 24 * 60 * 60 * 1000));\\n\\tvar str = serialize(b);\\n\\tdocument.cookie = (\\\"hd41=\\\" + str + \\\";path=/;expires=\\\" + d.toGMTString());\\n\\n\\t// Trigger page reload with query params\\n  // \\n\\n\\tvar di = document.createElement('script');\\n\\tdi.async = true;\\n\\tdi.src = '//www.yourdomain.com/page.html' + str;\\n\\tdocument.getElementsByTagName('head')[0].appendChild(di);\\n}());\\n\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]","category":"55fe128bcc468e0d008dcde3","createdAt":"2015-09-20T01:58:21.325Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"55fcad7951dbf70d00c61b3b","slug":"enhancing-detection-results","sync_unique":"","title":"Enhancing detection results","type":"basic","updates":[],"user":"55fcad15b652110d00758ada","version":"55fcb261a1dbbe0d001a139a","childrenPages":[]}

Enhancing detection results


[block:callout] { "type": "danger", "title": "The following notes apply to Cloud and Ultimate detection only !", "body": "Express Detection has this functionality built into it." } [/block] Handset Detection uses HTTP headers (user-agent and others) to detect devices. Unfortunately many devices, by Apple in particular, share the same HTTP headers which makes it difficult to tell them apart. To differentiate between devices that have the same HTTP headers we've developed a small javascript snippet that collects a few pieces of hardware information. When passed to a detection request it radially improves the accuracy of the result. The script does the following things - Collects the screen width - Collects the screen height - Collects the device pixel ratio - Runs a micro benchmark (50 milliseconds) - Sets the information in a cookie (hd41) The following script example loads a javascript at www.yourdomain.com/page.html with the results appended as a query string eg www.yourdomain.com/page.html?w=480&h=800&r=150&b=525 You could equally trigger a page reload with the string appended, include this inside any other script you have, or step new visitors through a temporary page. Pass this information through to the detection engine by setting 'x-local-hardwareinfo' in the request body, and transforming the string into {width}:{height}:{ratio}:{benchmark} eg 480:800:150:525 [block:code] { "codes": [ { "code": "(function () {\n\tfunction serialize( obj ) {\n\t return '?'+Object.keys(obj).reduce(function(a,k){a.push(k+'='+encodeURIComponent(obj[k]));return a},[]).join('&');\n\t}\n\tvar b = {},bd = [],bmt =+ new Date() +50;\n\tb.w = window.screen.width || 0;\n\tb.h = window.screen.height || 0;\n\tb.r = ~~((window.devicePixelRatio || 1) * 100);\n\t\n\tdo {\n\t\tvar t,count=0,tt =+ new Date();\n\t\tdo { t =+ new Date(); } while (t === tt)\n\t\tdo { count++; tt= +new Date(); } while (t === tt)\n\t\tif ((tt-t) === 1) { bd[bd.length] = count; }\n\t} while ((bd.length < 20) && (t < bmt))\n\n\tvar sum = 0, n = bd.length || 1;\n\twhile (bd.length) { sum += bd.pop(); }\n\tb.m = ~~sum/n;\n\tvar d = new Date(); d.setTime(d.getTime() + (7 * 24 * 60 * 60 * 1000));\n\tvar str = serialize(b);\n\tdocument.cookie = (\"hd41=\" + str + \";path=/;expires=\" + d.toGMTString());\n\n\t// Trigger page reload with query params\n // \n\n\tvar di = document.createElement('script');\n\tdi.async = true;\n\tdi.src = '//www.yourdomain.com/page.html' + str;\n\tdocument.getElementsByTagName('head')[0].appendChild(di);\n}());\n", "language": "javascript" } ] } [/block]
[block:callout] { "type": "danger", "title": "The following notes apply to Cloud and Ultimate detection only !", "body": "Express Detection has this functionality built into it." } [/block] Handset Detection uses HTTP headers (user-agent and others) to detect devices. Unfortunately many devices, by Apple in particular, share the same HTTP headers which makes it difficult to tell them apart. To differentiate between devices that have the same HTTP headers we've developed a small javascript snippet that collects a few pieces of hardware information. When passed to a detection request it radially improves the accuracy of the result. The script does the following things - Collects the screen width - Collects the screen height - Collects the device pixel ratio - Runs a micro benchmark (50 milliseconds) - Sets the information in a cookie (hd41) The following script example loads a javascript at www.yourdomain.com/page.html with the results appended as a query string eg www.yourdomain.com/page.html?w=480&h=800&r=150&b=525 You could equally trigger a page reload with the string appended, include this inside any other script you have, or step new visitors through a temporary page. Pass this information through to the detection engine by setting 'x-local-hardwareinfo' in the request body, and transforming the string into {width}:{height}:{ratio}:{benchmark} eg 480:800:150:525 [block:code] { "codes": [ { "code": "(function () {\n\tfunction serialize( obj ) {\n\t return '?'+Object.keys(obj).reduce(function(a,k){a.push(k+'='+encodeURIComponent(obj[k]));return a},[]).join('&');\n\t}\n\tvar b = {},bd = [],bmt =+ new Date() +50;\n\tb.w = window.screen.width || 0;\n\tb.h = window.screen.height || 0;\n\tb.r = ~~((window.devicePixelRatio || 1) * 100);\n\t\n\tdo {\n\t\tvar t,count=0,tt =+ new Date();\n\t\tdo { t =+ new Date(); } while (t === tt)\n\t\tdo { count++; tt= +new Date(); } while (t === tt)\n\t\tif ((tt-t) === 1) { bd[bd.length] = count; }\n\t} while ((bd.length < 20) && (t < bmt))\n\n\tvar sum = 0, n = bd.length || 1;\n\twhile (bd.length) { sum += bd.pop(); }\n\tb.m = ~~sum/n;\n\tvar d = new Date(); d.setTime(d.getTime() + (7 * 24 * 60 * 60 * 1000));\n\tvar str = serialize(b);\n\tdocument.cookie = (\"hd41=\" + str + \";path=/;expires=\" + d.toGMTString());\n\n\t// Trigger page reload with query params\n // \n\n\tvar di = document.createElement('script');\n\tdi.async = true;\n\tdi.src = '//www.yourdomain.com/page.html' + str;\n\tdocument.getElementsByTagName('head')[0].appendChild(di);\n}());\n", "language": "javascript" } ] } [/block]
{"__v":2,"_id":"56c420bc4f0aed1700afabb0","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"body":"[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"general_vendor\",\n    \"0-1\": \"String\",\n    \"0-2\": \"Vendor name eg Nokia, Apple\",\n    \"1-0\": \"general_model\",\n    \"1-1\": \"String\",\n    \"1-2\": \"Model Name eg iPhone, N95\",\n    \"2-0\": \"general_platform\",\n    \"2-1\": \"String\",\n    \"2-2\": \"Platform or OS, if known, eg Symbian, Android\",\n    \"3-0\": \"general_platform_version\",\n    \"3-1\": \"String\",\n    \"3-2\": \"Platform version, eg 7.1 or 4.2.3\",\n    \"5-0\": \"general_browser\",\n    \"5-1\": \"String\",\n    \"5-2\": \"The detected browser eg Mobile Safari, Andriod Webkit, Android Chrome\",\n    \"6-0\": \"general_browser_version\",\n    \"6-2\": \"Browser version, eg 7.1, 28 or R3\",\n    \"7-0\": \"general_image\",\n    \"7-2\": \"An Image for the handset images available in 80×80 and 160×160\",\n    \"8-0\": \"general_aliases\",\n    \"8-1\": \"Array of Strings\",\n    \"8-2\": \"Aliases for this handset with vendor and model name eg [‘Motorola Droid’,’Motorola Milestone’]\",\n    \"9-0\": \"general_eusar\",\n    \"9-1\": \"String\",\n    \"7-1\": \"String\",\n    \"6-1\": \"String\",\n    \"9-2\": \"EU SAR rating taken at the head\",\n    \"10-0\": \"general_battery\",\n    \"10-1\": \"Array of Strings\",\n    \"10-2\": \"An array of Battery type and battery model number\",\n    \"11-0\": \"general_type\",\n    \"11-1\": \"String\",\n    \"11-2\": \"Mobile, Tablet, Console, TV, SetTopBox, Bot, Watch etc..\",\n    \"13-0\": \"general_cpu\",\n    \"13-1\": \"Array of Strings\",\n    \"13-2\": \"Architecture type and speed if available\",\n    \"19-0\": \"design_formfactor\",\n    \"19-2\": \"Device Shape eg Bar, Clamshell,\",\n    \"20-0\": \"design_dimensions\",\n    \"20-2\": \"Dimensions in millimeters\",\n    \"20-1\": \"String\",\n    \"19-1\": \"String\",\n    \"21-0\": \"design_weight\",\n    \"21-1\": \"String\",\n    \"21-2\": \"Device weight in grams\",\n    \"22-0\": \"design_antenna\",\n    \"22-2\": \"Antenna (Internal/External)\",\n    \"22-1\": \"String\",\n    \"23-0\": \"design_keyboard\",\n    \"23-2\": \"Keyboard Type\",\n    \"23-1\": \"String\",\n    \"24-0\": \"design_softkeys\",\n    \"24-1\": \"String\",\n    \"24-2\": \"Number of Softkeys\",\n    \"25-0\": \"design_sidekeys\",\n    \"25-1\": \"Array of Strings\",\n    \"25-2\": \"List of side keys\",\n    \"26-0\": \"display_type\",\n    \"26-2\": \"Display Technology\",\n    \"26-1\": \"String\",\n    \"27-0\": \"display_color\",\n    \"27-1\": \"String\",\n    \"27-2\": \"Is it Color ? Yes / No\",\n    \"28-0\": \"display_colors\",\n    \"28-1\": \"String\",\n    \"28-2\": \"Number of Colors, eg 65536, 16M\",\n    \"29-0\": \"display_size\",\n    \"29-1\": \"String\",\n    \"29-2\": \"Display Size – Diagonal in Inches\",\n    \"30-0\": \"display_x\",\n    \"30-1\": \"String\",\n    \"30-2\": \"Display width in pixels\",\n    \"31-0\": \"display_y\",\n    \"31-1\": \"String\",\n    \"31-2\": \"Display height in pixels\",\n    \"34-0\": \"display_other\",\n    \"34-1\": \"Array of Strings\",\n    \"34-2\": \"Anything else interesting eg Capacitive Touch\",\n    \"35-0\": \"memory_internal\",\n    \"36-0\": \"memory_slot\",\n    \"35-2\": \"Device Memory\",\n    \"36-2\": \"Device Memory Slot, type and max size\",\n    \"35-1\": \"Array of Strings\",\n    \"36-1\": \"Array of Strings\",\n    \"37-0\": \"network\",\n    \"38-0\": \"media_camera\",\n    \"37-1\": \"Array of Strings\",\n    \"38-1\": \"Array of Strings\",\n    \"39-1\": \"Array of Strings\",\n    \"40-1\": \"Array of Strings\",\n    \"41-1\": \"Array of Strings\",\n    \"42-1\": \"Array of Strings\",\n    \"43-1\": \"Array of Strings\",\n    \"44-1\": \"Array of Strings\",\n    \"37-2\": \"Cellular Network, Wifi and any other comms\",\n    \"38-2\": \"Main Camera Information\",\n    \"39-0\": \"media_secondcamera\",\n    \"40-0\": \"media_videocapture\",\n    \"41-0\": \"media_videoplayback\",\n    \"42-0\": \"media_audio\",\n    \"43-0\": \"media_other\",\n    \"44-0\": \"features\",\n    \"45-0\": \"connectors\",\n    \"45-1\": \"Array of Strings\",\n    \"39-2\": \"Secondary Camera Information\",\n    \"40-2\": \"Video Capture format & features\",\n    \"41-2\": \"Video playback formats\",\n    \"42-2\": \"Audio playback formats\",\n    \"43-2\": \"Any other interesting media features\",\n    \"44-2\": \"Any other interesting general features\",\n    \"45-2\": \"External Connectors\",\n    \"12-0\": \"general_virtual\",\n    \"12-1\": \"Boolean\",\n    \"12-2\": \"True if this a virtual device.\",\n    \"14-0\": \"general_app\",\n    \"14-1\": \"String\",\n    \"15-0\": \"general_app_version\",\n    \"16-0\": \"general_app_category\",\n    \"17-0\": \"general_language\",\n    \"18-0\": \"general_language_full\",\n    \"17-1\": \"String\",\n    \"17-2\": \"An ISO international language code eg 'da' or 'en-gb'\",\n    \"18-1\": \"String\",\n    \"18-2\": \"The full name for a language eg. English (Australian)\",\n    \"15-1\": \"String\",\n    \"16-1\": \"String\",\n    \"14-2\": \"If an application is detected then this is its name eg Facebook\",\n    \"15-2\": \"The app's version eg 7.2\",\n    \"16-2\": \"The apps category, eg messaging, social, reader etc..\",\n    \"32-0\": \"display_ppi\",\n    \"32-1\": \"Number\",\n    \"32-2\": \"Number of pixels per inch (or DPI in the old parlance) eg 162\",\n    \"33-0\": \"display_pixel_ratio\",\n    \"33-1\": \"String\",\n    \"33-2\": \"The ratio between physical pixels and logical pixels. eg 2.0, 1.0, 1.33, 1.5 etc...\",\n    \"4-0\": \"general_platform_version_max\",\n    \"4-1\": \"String\",\n    \"4-2\": \"The maximum advertised OS version for a device that has reached End Of Life. For example the iPhone 3G has a maximum iOS version of 4.2.1\",\n    \"46-0\": \"benchmark_min\",\n    \"46-1\": \"Number\",\n    \"46-2\": \"A minimum benchmark for this device\",\n    \"47-0\": \"benchmark_max\",\n    \"47-1\": \"Number\",\n    \"47-2\": \"A maximum benchmark for this device\"\n  },\n  \"cols\": 3,\n  \"rows\": 48\n}\n[/block]\nExample of the device description of a Nokia N95\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n\\t\\\"general_vendor\\\": \\\"Nokia\\\",\\n\\t\\\"general_model\\\": \\\"N95\\\",\\n\\t\\\"general_platform\\\": \\\"Symbian\\\",\\n\\t\\\"general_platform_version\\\": \\\"9.2\\\",\\n\\t\\\"general_browser\\\": \\\"\\\",\\n\\t\\\"general_browser_version\\\": \\\"\\\",\\n\\t\\\"general_image\\\": \\\"nokian95-1403496370-0.gif\\\",\\n\\t\\\"general_aliases\\\": [],\\n\\t\\\"general_eusar\\\": \\\"0.50\\\",\\n\\t\\\"general_battery\\\": [\\\"Li-Ion 950 mAh\\\", \\\"BL-5F\\\"],\\n\\t\\\"general_type\\\": \\\"Mobile\\\",\\n\\t\\\"general_cpu\\\": [\\\"Dual ARM 11\\\", \\\"332MHz\\\"],\\n\\t\\\"design_formfactor\\\": \\\"Dual Slide\\\",\\n\\t\\\"design_dimensions\\\": \\\"99 x 53 x 21\\\",\\n\\t\\\"design_weight\\\": \\\"120\\\",\\n\\t\\\"design_antenna\\\": \\\"Internal\\\",\\n\\t\\\"design_keyboard\\\": \\\"Numeric\\\",\\n\\t\\\"design_softkeys\\\": \\\"2\\\",\\n\\t\\\"design_sidekeys\\\": [\\\"Volume\\\", \\\"Camera\\\"],\\n\\t\\\"display_type\\\": \\\"TFT\\\",\\n\\t\\\"display_color\\\": \\\"Yes\\\",\\n\\t\\\"display_colors\\\": \\\"16M\\\",\\n\\t\\\"display_size\\\": \\\"2.6\\\\\\\"\\\",\\n\\t\\\"display_x\\\": \\\"240\\\",\\n\\t\\\"display_y\\\": \\\"320\\\",\\n\\t\\\"display_other\\\": [],\\n\\t\\\"memory_internal\\\": [\\\"160MB\\\", \\\"64MB RAM\\\", \\\"256MB ROM\\\"],\\n\\t\\\"memory_slot\\\": [\\\"microSD\\\", \\\"8GB\\\", \\\"128MB\\\"],\\n\\t\\\"network\\\": [\\\"GSM850\\\", \\\"GSM900\\\", \\\"GSM1800\\\", \\\"GSM1900\\\", \\\"UMTS2100\\\", \\\"HSDPA2100\\\", \\\"Infrared\\\", \\\"Bluetooth 2.0\\\", \\\"802.11b\\\", \\\"802.11g\\\", \\\"GPRS Class 10\\\", \\\"EDGE Class 32\\\"],\\n\\t\\\"media_camera\\\": [\\\"5MP\\\", \\\"2592x1944\\\"],\\n\\t\\\"media_secondcamera\\\": [\\\"QVGA\\\"],\\n\\t\\\"media_videocapture\\\": [\\\"VGA@30fps\\\"],\\n\\t\\\"media_videoplayback\\\": [\\\"MPEG4\\\", \\\"H.263\\\", \\\"H.264\\\", \\\"3GPP\\\", \\\"RealVideo 8\\\", \\\"RealVideo 9\\\", \\\"RealVideo 10\\\"],\\n\\t\\\"media_audio\\\": [\\\"MP3\\\", \\\"AAC\\\", \\\"AAC+\\\", \\\"eAAC+\\\", \\\"WMA\\\"],\\n\\t\\\"media_other\\\": [\\\"Auto focus\\\", \\\"Video stabilizer\\\", \\\"Video calling\\\", \\\"Carl Zeiss optics\\\", \\\"LED Flash\\\"],\\n\\t\\\"features\\\": [\\\"Unlimited entries\\\", \\\"Multiple numbers per contact\\\", \\\"Picture ID\\\", \\\"Ring ID\\\", \\\"Calendar\\\", \\\"Alarm\\\", \\\"To-Do\\\", \\\"Document viewer\\\", \\\"Calculator\\\", \\\"Notes\\\", \\\"UPnP\\\", \\\"Computer sync\\\", \\\"VoIP\\\", \\\"Music ringtones (MP3)\\\", \\\"Vibration\\\", \\\"Phone profiles\\\", \\\"Speakerphone\\\", \\\"Accelerometer\\\", \\\"Voice dialing\\\", \\\"Voice commands\\\", \\\"Voice recording\\\", \\\"Push-to-Talk\\\", \\\"SMS\\\", \\\"MMS\\\", \\\"Email\\\", \\\"Instant Messaging\\\", \\\"Stereo FM radio\\\", \\\"Visual radio\\\", \\\"Dual slide design\\\", \\\"Organizer\\\", \\\"Word viewer\\\", \\\"Excel viewer\\\", \\\"PowerPoint viewer\\\", \\\"PDF viewer\\\", \\\"Predictive text input\\\", \\\"Push to talk\\\", \\\"Voice memo\\\", \\\"Games\\\"],\\n\\t\\\"connectors\\\": [\\\"USB\\\", \\\"MiniUSB\\\", \\\"3.5mm Audio\\\", \\\"TV Out\\\"],\\n\\t\\\"general_platform_version_max\\\": \\\"\\\",\\n\\t\\\"general_app\\\": \\\"\\\",\\n\\t\\\"general_app_version\\\": \\\"\\\",\\n\\t\\\"general_language\\\": \\\"\\\",\\n  \\\"general_language_full\\\":\\\"\\\",\\n\\t\\\"display_ppi\\\": 154,\\n\\t\\\"display_pixel_ratio\\\": \\\"1.0\\\",\\n\\t\\\"benchmark_min\\\": 0,\\n\\t\\\"benchmark_max\\\": 0,\\n\\t\\\"general_app_category\\\": \\\"\\\",\\n\\t\\\"general_virtual\\\": 0\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","category":"55fe128bcc468e0d008dcde3","createdAt":"2016-02-17T07:26:52.362Z","excerpt":"APIv4 Device Schema","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":1,"parentDoc":null,"project":"55fcad7951dbf70d00c61b3b","slug":"device-schema","sync_unique":"","title":"Device Schema","type":"basic","updates":[],"user":"55fcad15b652110d00758ada","version":"55fcb261a1dbbe0d001a139a","childrenPages":[]}

Device Schema

APIv4 Device Schema

[block:parameters] { "data": { "h-0": "Field", "h-1": "Type", "h-2": "Description", "0-0": "general_vendor", "0-1": "String", "0-2": "Vendor name eg Nokia, Apple", "1-0": "general_model", "1-1": "String", "1-2": "Model Name eg iPhone, N95", "2-0": "general_platform", "2-1": "String", "2-2": "Platform or OS, if known, eg Symbian, Android", "3-0": "general_platform_version", "3-1": "String", "3-2": "Platform version, eg 7.1 or 4.2.3", "5-0": "general_browser", "5-1": "String", "5-2": "The detected browser eg Mobile Safari, Andriod Webkit, Android Chrome", "6-0": "general_browser_version", "6-2": "Browser version, eg 7.1, 28 or R3", "7-0": "general_image", "7-2": "An Image for the handset images available in 80×80 and 160×160", "8-0": "general_aliases", "8-1": "Array of Strings", "8-2": "Aliases for this handset with vendor and model name eg [‘Motorola Droid’,’Motorola Milestone’]", "9-0": "general_eusar", "9-1": "String", "7-1": "String", "6-1": "String", "9-2": "EU SAR rating taken at the head", "10-0": "general_battery", "10-1": "Array of Strings", "10-2": "An array of Battery type and battery model number", "11-0": "general_type", "11-1": "String", "11-2": "Mobile, Tablet, Console, TV, SetTopBox, Bot, Watch etc..", "13-0": "general_cpu", "13-1": "Array of Strings", "13-2": "Architecture type and speed if available", "19-0": "design_formfactor", "19-2": "Device Shape eg Bar, Clamshell,", "20-0": "design_dimensions", "20-2": "Dimensions in millimeters", "20-1": "String", "19-1": "String", "21-0": "design_weight", "21-1": "String", "21-2": "Device weight in grams", "22-0": "design_antenna", "22-2": "Antenna (Internal/External)", "22-1": "String", "23-0": "design_keyboard", "23-2": "Keyboard Type", "23-1": "String", "24-0": "design_softkeys", "24-1": "String", "24-2": "Number of Softkeys", "25-0": "design_sidekeys", "25-1": "Array of Strings", "25-2": "List of side keys", "26-0": "display_type", "26-2": "Display Technology", "26-1": "String", "27-0": "display_color", "27-1": "String", "27-2": "Is it Color ? Yes / No", "28-0": "display_colors", "28-1": "String", "28-2": "Number of Colors, eg 65536, 16M", "29-0": "display_size", "29-1": "String", "29-2": "Display Size – Diagonal in Inches", "30-0": "display_x", "30-1": "String", "30-2": "Display width in pixels", "31-0": "display_y", "31-1": "String", "31-2": "Display height in pixels", "34-0": "display_other", "34-1": "Array of Strings", "34-2": "Anything else interesting eg Capacitive Touch", "35-0": "memory_internal", "36-0": "memory_slot", "35-2": "Device Memory", "36-2": "Device Memory Slot, type and max size", "35-1": "Array of Strings", "36-1": "Array of Strings", "37-0": "network", "38-0": "media_camera", "37-1": "Array of Strings", "38-1": "Array of Strings", "39-1": "Array of Strings", "40-1": "Array of Strings", "41-1": "Array of Strings", "42-1": "Array of Strings", "43-1": "Array of Strings", "44-1": "Array of Strings", "37-2": "Cellular Network, Wifi and any other comms", "38-2": "Main Camera Information", "39-0": "media_secondcamera", "40-0": "media_videocapture", "41-0": "media_videoplayback", "42-0": "media_audio", "43-0": "media_other", "44-0": "features", "45-0": "connectors", "45-1": "Array of Strings", "39-2": "Secondary Camera Information", "40-2": "Video Capture format & features", "41-2": "Video playback formats", "42-2": "Audio playback formats", "43-2": "Any other interesting media features", "44-2": "Any other interesting general features", "45-2": "External Connectors", "12-0": "general_virtual", "12-1": "Boolean", "12-2": "True if this a virtual device.", "14-0": "general_app", "14-1": "String", "15-0": "general_app_version", "16-0": "general_app_category", "17-0": "general_language", "18-0": "general_language_full", "17-1": "String", "17-2": "An ISO international language code eg 'da' or 'en-gb'", "18-1": "String", "18-2": "The full name for a language eg. English (Australian)", "15-1": "String", "16-1": "String", "14-2": "If an application is detected then this is its name eg Facebook", "15-2": "The app's version eg 7.2", "16-2": "The apps category, eg messaging, social, reader etc..", "32-0": "display_ppi", "32-1": "Number", "32-2": "Number of pixels per inch (or DPI in the old parlance) eg 162", "33-0": "display_pixel_ratio", "33-1": "String", "33-2": "The ratio between physical pixels and logical pixels. eg 2.0, 1.0, 1.33, 1.5 etc...", "4-0": "general_platform_version_max", "4-1": "String", "4-2": "The maximum advertised OS version for a device that has reached End Of Life. For example the iPhone 3G has a maximum iOS version of 4.2.1", "46-0": "benchmark_min", "46-1": "Number", "46-2": "A minimum benchmark for this device", "47-0": "benchmark_max", "47-1": "Number", "47-2": "A maximum benchmark for this device" }, "cols": 3, "rows": 48 } [/block] Example of the device description of a Nokia N95 [block:code] { "codes": [ { "code": "{\n\t\"general_vendor\": \"Nokia\",\n\t\"general_model\": \"N95\",\n\t\"general_platform\": \"Symbian\",\n\t\"general_platform_version\": \"9.2\",\n\t\"general_browser\": \"\",\n\t\"general_browser_version\": \"\",\n\t\"general_image\": \"nokian95-1403496370-0.gif\",\n\t\"general_aliases\": [],\n\t\"general_eusar\": \"0.50\",\n\t\"general_battery\": [\"Li-Ion 950 mAh\", \"BL-5F\"],\n\t\"general_type\": \"Mobile\",\n\t\"general_cpu\": [\"Dual ARM 11\", \"332MHz\"],\n\t\"design_formfactor\": \"Dual Slide\",\n\t\"design_dimensions\": \"99 x 53 x 21\",\n\t\"design_weight\": \"120\",\n\t\"design_antenna\": \"Internal\",\n\t\"design_keyboard\": \"Numeric\",\n\t\"design_softkeys\": \"2\",\n\t\"design_sidekeys\": [\"Volume\", \"Camera\"],\n\t\"display_type\": \"TFT\",\n\t\"display_color\": \"Yes\",\n\t\"display_colors\": \"16M\",\n\t\"display_size\": \"2.6\\\"\",\n\t\"display_x\": \"240\",\n\t\"display_y\": \"320\",\n\t\"display_other\": [],\n\t\"memory_internal\": [\"160MB\", \"64MB RAM\", \"256MB ROM\"],\n\t\"memory_slot\": [\"microSD\", \"8GB\", \"128MB\"],\n\t\"network\": [\"GSM850\", \"GSM900\", \"GSM1800\", \"GSM1900\", \"UMTS2100\", \"HSDPA2100\", \"Infrared\", \"Bluetooth 2.0\", \"802.11b\", \"802.11g\", \"GPRS Class 10\", \"EDGE Class 32\"],\n\t\"media_camera\": [\"5MP\", \"2592x1944\"],\n\t\"media_secondcamera\": [\"QVGA\"],\n\t\"media_videocapture\": [\"VGA@30fps\"],\n\t\"media_videoplayback\": [\"MPEG4\", \"H.263\", \"H.264\", \"3GPP\", \"RealVideo 8\", \"RealVideo 9\", \"RealVideo 10\"],\n\t\"media_audio\": [\"MP3\", \"AAC\", \"AAC+\", \"eAAC+\", \"WMA\"],\n\t\"media_other\": [\"Auto focus\", \"Video stabilizer\", \"Video calling\", \"Carl Zeiss optics\", \"LED Flash\"],\n\t\"features\": [\"Unlimited entries\", \"Multiple numbers per contact\", \"Picture ID\", \"Ring ID\", \"Calendar\", \"Alarm\", \"To-Do\", \"Document viewer\", \"Calculator\", \"Notes\", \"UPnP\", \"Computer sync\", \"VoIP\", \"Music ringtones (MP3)\", \"Vibration\", \"Phone profiles\", \"Speakerphone\", \"Accelerometer\", \"Voice dialing\", \"Voice commands\", \"Voice recording\", \"Push-to-Talk\", \"SMS\", \"MMS\", \"Email\", \"Instant Messaging\", \"Stereo FM radio\", \"Visual radio\", \"Dual slide design\", \"Organizer\", \"Word viewer\", \"Excel viewer\", \"PowerPoint viewer\", \"PDF viewer\", \"Predictive text input\", \"Push to talk\", \"Voice memo\", \"Games\"],\n\t\"connectors\": [\"USB\", \"MiniUSB\", \"3.5mm Audio\", \"TV Out\"],\n\t\"general_platform_version_max\": \"\",\n\t\"general_app\": \"\",\n\t\"general_app_version\": \"\",\n\t\"general_language\": \"\",\n \"general_language_full\":\"\",\n\t\"display_ppi\": 154,\n\t\"display_pixel_ratio\": \"1.0\",\n\t\"benchmark_min\": 0,\n\t\"benchmark_max\": 0,\n\t\"general_app_category\": \"\",\n\t\"general_virtual\": 0\n}", "language": "json" } ] } [/block]
[block:parameters] { "data": { "h-0": "Field", "h-1": "Type", "h-2": "Description", "0-0": "general_vendor", "0-1": "String", "0-2": "Vendor name eg Nokia, Apple", "1-0": "general_model", "1-1": "String", "1-2": "Model Name eg iPhone, N95", "2-0": "general_platform", "2-1": "String", "2-2": "Platform or OS, if known, eg Symbian, Android", "3-0": "general_platform_version", "3-1": "String", "3-2": "Platform version, eg 7.1 or 4.2.3", "5-0": "general_browser", "5-1": "String", "5-2": "The detected browser eg Mobile Safari, Andriod Webkit, Android Chrome", "6-0": "general_browser_version", "6-2": "Browser version, eg 7.1, 28 or R3", "7-0": "general_image", "7-2": "An Image for the handset images available in 80×80 and 160×160", "8-0": "general_aliases", "8-1": "Array of Strings", "8-2": "Aliases for this handset with vendor and model name eg [‘Motorola Droid’,’Motorola Milestone’]", "9-0": "general_eusar", "9-1": "String", "7-1": "String", "6-1": "String", "9-2": "EU SAR rating taken at the head", "10-0": "general_battery", "10-1": "Array of Strings", "10-2": "An array of Battery type and battery model number", "11-0": "general_type", "11-1": "String", "11-2": "Mobile, Tablet, Console, TV, SetTopBox, Bot, Watch etc..", "13-0": "general_cpu", "13-1": "Array of Strings", "13-2": "Architecture type and speed if available", "19-0": "design_formfactor", "19-2": "Device Shape eg Bar, Clamshell,", "20-0": "design_dimensions", "20-2": "Dimensions in millimeters", "20-1": "String", "19-1": "String", "21-0": "design_weight", "21-1": "String", "21-2": "Device weight in grams", "22-0": "design_antenna", "22-2": "Antenna (Internal/External)", "22-1": "String", "23-0": "design_keyboard", "23-2": "Keyboard Type", "23-1": "String", "24-0": "design_softkeys", "24-1": "String", "24-2": "Number of Softkeys", "25-0": "design_sidekeys", "25-1": "Array of Strings", "25-2": "List of side keys", "26-0": "display_type", "26-2": "Display Technology", "26-1": "String", "27-0": "display_color", "27-1": "String", "27-2": "Is it Color ? Yes / No", "28-0": "display_colors", "28-1": "String", "28-2": "Number of Colors, eg 65536, 16M", "29-0": "display_size", "29-1": "String", "29-2": "Display Size – Diagonal in Inches", "30-0": "display_x", "30-1": "String", "30-2": "Display width in pixels", "31-0": "display_y", "31-1": "String", "31-2": "Display height in pixels", "34-0": "display_other", "34-1": "Array of Strings", "34-2": "Anything else interesting eg Capacitive Touch", "35-0": "memory_internal", "36-0": "memory_slot", "35-2": "Device Memory", "36-2": "Device Memory Slot, type and max size", "35-1": "Array of Strings", "36-1": "Array of Strings", "37-0": "network", "38-0": "media_camera", "37-1": "Array of Strings", "38-1": "Array of Strings", "39-1": "Array of Strings", "40-1": "Array of Strings", "41-1": "Array of Strings", "42-1": "Array of Strings", "43-1": "Array of Strings", "44-1": "Array of Strings", "37-2": "Cellular Network, Wifi and any other comms", "38-2": "Main Camera Information", "39-0": "media_secondcamera", "40-0": "media_videocapture", "41-0": "media_videoplayback", "42-0": "media_audio", "43-0": "media_other", "44-0": "features", "45-0": "connectors", "45-1": "Array of Strings", "39-2": "Secondary Camera Information", "40-2": "Video Capture format & features", "41-2": "Video playback formats", "42-2": "Audio playback formats", "43-2": "Any other interesting media features", "44-2": "Any other interesting general features", "45-2": "External Connectors", "12-0": "general_virtual", "12-1": "Boolean", "12-2": "True if this a virtual device.", "14-0": "general_app", "14-1": "String", "15-0": "general_app_version", "16-0": "general_app_category", "17-0": "general_language", "18-0": "general_language_full", "17-1": "String", "17-2": "An ISO international language code eg 'da' or 'en-gb'", "18-1": "String", "18-2": "The full name for a language eg. English (Australian)", "15-1": "String", "16-1": "String", "14-2": "If an application is detected then this is its name eg Facebook", "15-2": "The app's version eg 7.2", "16-2": "The apps category, eg messaging, social, reader etc..", "32-0": "display_ppi", "32-1": "Number", "32-2": "Number of pixels per inch (or DPI in the old parlance) eg 162", "33-0": "display_pixel_ratio", "33-1": "String", "33-2": "The ratio between physical pixels and logical pixels. eg 2.0, 1.0, 1.33, 1.5 etc...", "4-0": "general_platform_version_max", "4-1": "String", "4-2": "The maximum advertised OS version for a device that has reached End Of Life. For example the iPhone 3G has a maximum iOS version of 4.2.1", "46-0": "benchmark_min", "46-1": "Number", "46-2": "A minimum benchmark for this device", "47-0": "benchmark_max", "47-1": "Number", "47-2": "A maximum benchmark for this device" }, "cols": 3, "rows": 48 } [/block] Example of the device description of a Nokia N95 [block:code] { "codes": [ { "code": "{\n\t\"general_vendor\": \"Nokia\",\n\t\"general_model\": \"N95\",\n\t\"general_platform\": \"Symbian\",\n\t\"general_platform_version\": \"9.2\",\n\t\"general_browser\": \"\",\n\t\"general_browser_version\": \"\",\n\t\"general_image\": \"nokian95-1403496370-0.gif\",\n\t\"general_aliases\": [],\n\t\"general_eusar\": \"0.50\",\n\t\"general_battery\": [\"Li-Ion 950 mAh\", \"BL-5F\"],\n\t\"general_type\": \"Mobile\",\n\t\"general_cpu\": [\"Dual ARM 11\", \"332MHz\"],\n\t\"design_formfactor\": \"Dual Slide\",\n\t\"design_dimensions\": \"99 x 53 x 21\",\n\t\"design_weight\": \"120\",\n\t\"design_antenna\": \"Internal\",\n\t\"design_keyboard\": \"Numeric\",\n\t\"design_softkeys\": \"2\",\n\t\"design_sidekeys\": [\"Volume\", \"Camera\"],\n\t\"display_type\": \"TFT\",\n\t\"display_color\": \"Yes\",\n\t\"display_colors\": \"16M\",\n\t\"display_size\": \"2.6\\\"\",\n\t\"display_x\": \"240\",\n\t\"display_y\": \"320\",\n\t\"display_other\": [],\n\t\"memory_internal\": [\"160MB\", \"64MB RAM\", \"256MB ROM\"],\n\t\"memory_slot\": [\"microSD\", \"8GB\", \"128MB\"],\n\t\"network\": [\"GSM850\", \"GSM900\", \"GSM1800\", \"GSM1900\", \"UMTS2100\", \"HSDPA2100\", \"Infrared\", \"Bluetooth 2.0\", \"802.11b\", \"802.11g\", \"GPRS Class 10\", \"EDGE Class 32\"],\n\t\"media_camera\": [\"5MP\", \"2592x1944\"],\n\t\"media_secondcamera\": [\"QVGA\"],\n\t\"media_videocapture\": [\"VGA@30fps\"],\n\t\"media_videoplayback\": [\"MPEG4\", \"H.263\", \"H.264\", \"3GPP\", \"RealVideo 8\", \"RealVideo 9\", \"RealVideo 10\"],\n\t\"media_audio\": [\"MP3\", \"AAC\", \"AAC+\", \"eAAC+\", \"WMA\"],\n\t\"media_other\": [\"Auto focus\", \"Video stabilizer\", \"Video calling\", \"Carl Zeiss optics\", \"LED Flash\"],\n\t\"features\": [\"Unlimited entries\", \"Multiple numbers per contact\", \"Picture ID\", \"Ring ID\", \"Calendar\", \"Alarm\", \"To-Do\", \"Document viewer\", \"Calculator\", \"Notes\", \"UPnP\", \"Computer sync\", \"VoIP\", \"Music ringtones (MP3)\", \"Vibration\", \"Phone profiles\", \"Speakerphone\", \"Accelerometer\", \"Voice dialing\", \"Voice commands\", \"Voice recording\", \"Push-to-Talk\", \"SMS\", \"MMS\", \"Email\", \"Instant Messaging\", \"Stereo FM radio\", \"Visual radio\", \"Dual slide design\", \"Organizer\", \"Word viewer\", \"Excel viewer\", \"PowerPoint viewer\", \"PDF viewer\", \"Predictive text input\", \"Push to talk\", \"Voice memo\", \"Games\"],\n\t\"connectors\": [\"USB\", \"MiniUSB\", \"3.5mm Audio\", \"TV Out\"],\n\t\"general_platform_version_max\": \"\",\n\t\"general_app\": \"\",\n\t\"general_app_version\": \"\",\n\t\"general_language\": \"\",\n \"general_language_full\":\"\",\n\t\"display_ppi\": 154,\n\t\"display_pixel_ratio\": \"1.0\",\n\t\"benchmark_min\": 0,\n\t\"benchmark_max\": 0,\n\t\"general_app_category\": \"\",\n\t\"general_virtual\": 0\n}", "language": "json" } ] } [/block]
{"__v":2,"_id":"571847bfc7b52619003f61c8","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"body":"All API kits are broadly the same and follow similar design patterns, however sometimes config options can vary a bit from kit to kit.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n$hdconfig['username'] = \\\"***API-USERNAME***\\\";\\n$hdconfig['secret'] = \\\"***API-SECRET***\\\";\\n$hdconfig['site_id'] = \\\"***SITE-ID***\\\";\\n$hdconfig['use_local'] = false;\\n$hdconfig['filesdir'] = '/tmp';\\n$hdconfig['debug'] = false;\\n$hdconfig['api_server'] = 'api.handsetdetection.com';\\n$hdconfig['cache_requests'] = false;\\n$hdconfig['geoip'] = true;\\n$hdconfig['timeout'] = 10;\\n$hdconfig['use_proxy'] = false;\\n$hdconfig['proxy_server'] = '';\\n$hdconfig['proxy_port'] = '';\\n$hdconfig['proxy_user'] = '';\\n$hdconfig['proxy_pass'] = '';\\n$hdconfig['retries'] = 3;\\n?>\",\n      \"language\": \"php\"\n    },\n    {\n      \"code\": \"#common\\ncommon.username=***API-USERNAME***\\ncommon.secret=***API-SECRET***\\ncommon.site_id=***SITE-ID***\\ncommon.non_mobile=\\ncommon.match_filter=\\ncommon.use_local=false\\n\\n#socket connection timeouts\\nconnection.connect_timeout=5\\nconnection.read_timeout=5\\n\\n#proxy\\nproxy.enabled=false\\nproxy.address=\\nproxy.port=\\nproxy.username=\\nproxy.password=\\n\\n#local directory for downloaded files (Ultimate only)\\nlocal.files.directory=/tmp\\n\\n#logging\\nlogger.enabled=true\",\n      \"language\": \"java\"\n    },\n    {\n      \"code\": \"config:\\n  api_username: ***API-USERNAME***\\n  api_secret: ***API-SECRET***\\n  site_id: '***SITE-ID***'\\n  use_local: False\\n  filesdir: /tmp\\n  debug: false\\n  api_server: api.handsetdetection.com\\n  cache_requests: False\\n  timeout: 10\\n  use_proxy: false\\n  proxy_server:\\n  proxy_port:\\n  proxy_user:\\n  proxy_pass:\\n  retries: 3\\n\\n#\\n# Dogpile.cache settings.\\n# The cache defaults to backend: dogpile.cache.memory, expiry: 3600, arguments: { cache_dict: hd40cache }\\n#\\ncache:\\n  backend: dogpile.cache.memcached\\n  expiry: 3600\\n  arguments:\\n    url: 127.0.0.1:11211\",\n      \"language\": \"python\"\n    },\n    {\n      \"code\": \"// dotNet 4.0\\n{  \\n   \\\"username\\\":\\\"***API-USERNAME***\\\",\\n   \\\"secret\\\":\\\"***API-SECRET***\\\",\\n   \\\"site_id\\\":\\\"***SITE-ID***\\\",\\n   \\\"use_local\\\":\\\"false\\\",\\n   \\\"filesdir\\\":\\\"\\\",\\n   \\\"debug\\\":\\\"false\\\",\\n   \\\"api_server\\\":\\\"api.handsetdetection.com\\\",\\n   \\\"cache_requests\\\":\\\"false\\\",\\n   \\\"geoip\\\":\\\"true\\\",\\n   \\\"timeout\\\":\\\"10\\\",\\n   \\\"use_proxy\\\":\\\"false\\\",\\n   \\\"proxy_server\\\":\\\"\\\",\\n   \\\"proxy_port\\\":\\\"\\\",\\n   \\\"proxy_user\\\":\\\"\\\",\\n   \\\"proxy_pass\\\":\\\"\\\",\\n   \\\"retries\\\":\\\"3\\\",\\n   \\\"log_unknown\\\":\\\"true\\\"\\n}\",\n      \"language\": \"csharp\"\n    }\n  ]\n}\n[/block]\nusername and secret are your API connection credentials. You can find them either from the dashboard (Click on your Avatar, Select Change Settings and scroll down a little to API Connection Information, where you can also modify the details if desired), or from the site settings icon (from your main dashboard page scroll down to 'Manage Sites', then look across to the Actions section, click the 3 little orange cogs or gears, once the site settings page has loaded click the 'Ultimate' tab).\n\nsite_id, is the id of the site you wish to perform detections or downloads for.\n\nuse_local, set this to true to flip your API kit into Ultimate (local detection) mode. Set to false for cloud detection. Note : Cloud and Ultimate detection replies are virtually identical (ultimate has no GeoIP information), so you can switch between modes at the flick of a switch.\n\ndebug, set this to false, its used while debugging api kit issues and has a bit of performance overhead.\n\napi_server, this should always be api.handsetdetection.com\n\ncache_requests, a new option in api v4.0, set this to true to locally cache detection replies. Setting this to true will cause 'hot' http headers to be locally cached. This will reduce detection lookups and speed up performance in cloud mode, however as side effect it will distort analytics as cache 'hits' will not be tracked.\n\ngeoip, deprecated, this enables geoip lookups in cloud mode.\n\ntimeout, maximum duration for a cloud web service request.\n\nretires, how many times to re-try a cloud request (if it fails or timeouts).\n\nproxy options, set these if you're making cloud queries through a web proxy.\n\nThe default config filenames differ from kit to kit and the main detection classes in each language have a method of supplying a custom config file name, making switching credentials from test to production easy. See your kit of choice for examples and information.\n\nAll API kits can be found at our [Device Detection GitHub Repo](https://github.com/HandsetDetection)","category":"55fe128bcc468e0d008dcde3","createdAt":"2016-04-21T03:23:43.364Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":3,"parentDoc":null,"project":"55fcad7951dbf70d00c61b3b","slug":"configuring-api-kits","sync_unique":"","title":"Configuring API kits","type":"basic","updates":[],"user":"55fcad15b652110d00758ada","version":"55fcb261a1dbbe0d001a139a","childrenPages":[]}

Configuring API kits


All API kits are broadly the same and follow similar design patterns, however sometimes config options can vary a bit from kit to kit. [block:code] { "codes": [ { "code": "<?php\n$hdconfig['username'] = \"***API-USERNAME***\";\n$hdconfig['secret'] = \"***API-SECRET***\";\n$hdconfig['site_id'] = \"***SITE-ID***\";\n$hdconfig['use_local'] = false;\n$hdconfig['filesdir'] = '/tmp';\n$hdconfig['debug'] = false;\n$hdconfig['api_server'] = 'api.handsetdetection.com';\n$hdconfig['cache_requests'] = false;\n$hdconfig['geoip'] = true;\n$hdconfig['timeout'] = 10;\n$hdconfig['use_proxy'] = false;\n$hdconfig['proxy_server'] = '';\n$hdconfig['proxy_port'] = '';\n$hdconfig['proxy_user'] = '';\n$hdconfig['proxy_pass'] = '';\n$hdconfig['retries'] = 3;\n?>", "language": "php" }, { "code": "#common\ncommon.username=***API-USERNAME***\ncommon.secret=***API-SECRET***\ncommon.site_id=***SITE-ID***\ncommon.non_mobile=\ncommon.match_filter=\ncommon.use_local=false\n\n#socket connection timeouts\nconnection.connect_timeout=5\nconnection.read_timeout=5\n\n#proxy\nproxy.enabled=false\nproxy.address=\nproxy.port=\nproxy.username=\nproxy.password=\n\n#local directory for downloaded files (Ultimate only)\nlocal.files.directory=/tmp\n\n#logging\nlogger.enabled=true", "language": "java" }, { "code": "config:\n api_username: ***API-USERNAME***\n api_secret: ***API-SECRET***\n site_id: '***SITE-ID***'\n use_local: False\n filesdir: /tmp\n debug: false\n api_server: api.handsetdetection.com\n cache_requests: False\n timeout: 10\n use_proxy: false\n proxy_server:\n proxy_port:\n proxy_user:\n proxy_pass:\n retries: 3\n\n#\n# Dogpile.cache settings.\n# The cache defaults to backend: dogpile.cache.memory, expiry: 3600, arguments: { cache_dict: hd40cache }\n#\ncache:\n backend: dogpile.cache.memcached\n expiry: 3600\n arguments:\n url: 127.0.0.1:11211", "language": "python" }, { "code": "// dotNet 4.0\n{ \n \"username\":\"***API-USERNAME***\",\n \"secret\":\"***API-SECRET***\",\n \"site_id\":\"***SITE-ID***\",\n \"use_local\":\"false\",\n \"filesdir\":\"\",\n \"debug\":\"false\",\n \"api_server\":\"api.handsetdetection.com\",\n \"cache_requests\":\"false\",\n \"geoip\":\"true\",\n \"timeout\":\"10\",\n \"use_proxy\":\"false\",\n \"proxy_server\":\"\",\n \"proxy_port\":\"\",\n \"proxy_user\":\"\",\n \"proxy_pass\":\"\",\n \"retries\":\"3\",\n \"log_unknown\":\"true\"\n}", "language": "csharp" } ] } [/block] username and secret are your API connection credentials. You can find them either from the dashboard (Click on your Avatar, Select Change Settings and scroll down a little to API Connection Information, where you can also modify the details if desired), or from the site settings icon (from your main dashboard page scroll down to 'Manage Sites', then look across to the Actions section, click the 3 little orange cogs or gears, once the site settings page has loaded click the 'Ultimate' tab). site_id, is the id of the site you wish to perform detections or downloads for. use_local, set this to true to flip your API kit into Ultimate (local detection) mode. Set to false for cloud detection. Note : Cloud and Ultimate detection replies are virtually identical (ultimate has no GeoIP information), so you can switch between modes at the flick of a switch. debug, set this to false, its used while debugging api kit issues and has a bit of performance overhead. api_server, this should always be api.handsetdetection.com cache_requests, a new option in api v4.0, set this to true to locally cache detection replies. Setting this to true will cause 'hot' http headers to be locally cached. This will reduce detection lookups and speed up performance in cloud mode, however as side effect it will distort analytics as cache 'hits' will not be tracked. geoip, deprecated, this enables geoip lookups in cloud mode. timeout, maximum duration for a cloud web service request. retires, how many times to re-try a cloud request (if it fails or timeouts). proxy options, set these if you're making cloud queries through a web proxy. The default config filenames differ from kit to kit and the main detection classes in each language have a method of supplying a custom config file name, making switching credentials from test to production easy. See your kit of choice for examples and information. All API kits can be found at our [Device Detection GitHub Repo](https://github.com/HandsetDetection)
All API kits are broadly the same and follow similar design patterns, however sometimes config options can vary a bit from kit to kit. [block:code] { "codes": [ { "code": "<?php\n$hdconfig['username'] = \"***API-USERNAME***\";\n$hdconfig['secret'] = \"***API-SECRET***\";\n$hdconfig['site_id'] = \"***SITE-ID***\";\n$hdconfig['use_local'] = false;\n$hdconfig['filesdir'] = '/tmp';\n$hdconfig['debug'] = false;\n$hdconfig['api_server'] = 'api.handsetdetection.com';\n$hdconfig['cache_requests'] = false;\n$hdconfig['geoip'] = true;\n$hdconfig['timeout'] = 10;\n$hdconfig['use_proxy'] = false;\n$hdconfig['proxy_server'] = '';\n$hdconfig['proxy_port'] = '';\n$hdconfig['proxy_user'] = '';\n$hdconfig['proxy_pass'] = '';\n$hdconfig['retries'] = 3;\n?>", "language": "php" }, { "code": "#common\ncommon.username=***API-USERNAME***\ncommon.secret=***API-SECRET***\ncommon.site_id=***SITE-ID***\ncommon.non_mobile=\ncommon.match_filter=\ncommon.use_local=false\n\n#socket connection timeouts\nconnection.connect_timeout=5\nconnection.read_timeout=5\n\n#proxy\nproxy.enabled=false\nproxy.address=\nproxy.port=\nproxy.username=\nproxy.password=\n\n#local directory for downloaded files (Ultimate only)\nlocal.files.directory=/tmp\n\n#logging\nlogger.enabled=true", "language": "java" }, { "code": "config:\n api_username: ***API-USERNAME***\n api_secret: ***API-SECRET***\n site_id: '***SITE-ID***'\n use_local: False\n filesdir: /tmp\n debug: false\n api_server: api.handsetdetection.com\n cache_requests: False\n timeout: 10\n use_proxy: false\n proxy_server:\n proxy_port:\n proxy_user:\n proxy_pass:\n retries: 3\n\n#\n# Dogpile.cache settings.\n# The cache defaults to backend: dogpile.cache.memory, expiry: 3600, arguments: { cache_dict: hd40cache }\n#\ncache:\n backend: dogpile.cache.memcached\n expiry: 3600\n arguments:\n url: 127.0.0.1:11211", "language": "python" }, { "code": "// dotNet 4.0\n{ \n \"username\":\"***API-USERNAME***\",\n \"secret\":\"***API-SECRET***\",\n \"site_id\":\"***SITE-ID***\",\n \"use_local\":\"false\",\n \"filesdir\":\"\",\n \"debug\":\"false\",\n \"api_server\":\"api.handsetdetection.com\",\n \"cache_requests\":\"false\",\n \"geoip\":\"true\",\n \"timeout\":\"10\",\n \"use_proxy\":\"false\",\n \"proxy_server\":\"\",\n \"proxy_port\":\"\",\n \"proxy_user\":\"\",\n \"proxy_pass\":\"\",\n \"retries\":\"3\",\n \"log_unknown\":\"true\"\n}", "language": "csharp" } ] } [/block] username and secret are your API connection credentials. You can find them either from the dashboard (Click on your Avatar, Select Change Settings and scroll down a little to API Connection Information, where you can also modify the details if desired), or from the site settings icon (from your main dashboard page scroll down to 'Manage Sites', then look across to the Actions section, click the 3 little orange cogs or gears, once the site settings page has loaded click the 'Ultimate' tab). site_id, is the id of the site you wish to perform detections or downloads for. use_local, set this to true to flip your API kit into Ultimate (local detection) mode. Set to false for cloud detection. Note : Cloud and Ultimate detection replies are virtually identical (ultimate has no GeoIP information), so you can switch between modes at the flick of a switch. debug, set this to false, its used while debugging api kit issues and has a bit of performance overhead. api_server, this should always be api.handsetdetection.com cache_requests, a new option in api v4.0, set this to true to locally cache detection replies. Setting this to true will cause 'hot' http headers to be locally cached. This will reduce detection lookups and speed up performance in cloud mode, however as side effect it will distort analytics as cache 'hits' will not be tracked. geoip, deprecated, this enables geoip lookups in cloud mode. timeout, maximum duration for a cloud web service request. retires, how many times to re-try a cloud request (if it fails or timeouts). proxy options, set these if you're making cloud queries through a web proxy. The default config filenames differ from kit to kit and the main detection classes in each language have a method of supplying a custom config file name, making switching credentials from test to production easy. See your kit of choice for examples and information. All API kits can be found at our [Device Detection GitHub Repo](https://github.com/HandsetDetection)
{"__v":1,"_id":"5718416c951a050e00645688","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"body":"Ultimate Detection is our stand alone detection product. It includes everything you need to run local high performance device, platform (operating system), browser and app detections locally on your own servers. \n\nThe system is composed of two main components, 1) an API Kit and 2) a ZIP archive containing all the files needed to detect things (devices, platforms, browsers, applications and their detection trees). The archive has over 27,000 files, one for each thing.\n\nThe archive can be fetched via the dashboard and installed manually or fetched via an API kit, which fetches, unpacks and installs everything ready for use. Both options require you to configure your API Kit before the files can be used. \n\nSee the 'Configuring API kits' section for more information.\n\n**Manual installation can be a little tricky**. Here's a few pro tips to get you through the dark night. The API kit will look for a directory called hd40store in the directory specified in your API kit config file.  So, if you specify /tmp as the target directory then unzip the archive to /tmp/hd40store. Ensure the files and directory have appropriate permissions for read access by your web server or any other accounts using the API kit.","category":"55fe128bcc468e0d008dcde3","createdAt":"2016-04-21T02:56:44.505Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":999,"parentDoc":null,"project":"55fcad7951dbf70d00c61b3b","slug":"getting-started-with-ultimate-community-full-editions","sync_unique":"","title":"Getting started with Ultimate (community & full editions).","type":"basic","updates":[],"user":"55fcad15b652110d00758ada","version":"55fcb261a1dbbe0d001a139a","childrenPages":[]}

Getting started with Ultimate (community & full editions).


Ultimate Detection is our stand alone detection product. It includes everything you need to run local high performance device, platform (operating system), browser and app detections locally on your own servers. The system is composed of two main components, 1) an API Kit and 2) a ZIP archive containing all the files needed to detect things (devices, platforms, browsers, applications and their detection trees). The archive has over 27,000 files, one for each thing. The archive can be fetched via the dashboard and installed manually or fetched via an API kit, which fetches, unpacks and installs everything ready for use. Both options require you to configure your API Kit before the files can be used. See the 'Configuring API kits' section for more information. **Manual installation can be a little tricky**. Here's a few pro tips to get you through the dark night. The API kit will look for a directory called hd40store in the directory specified in your API kit config file. So, if you specify /tmp as the target directory then unzip the archive to /tmp/hd40store. Ensure the files and directory have appropriate permissions for read access by your web server or any other accounts using the API kit.
Ultimate Detection is our stand alone detection product. It includes everything you need to run local high performance device, platform (operating system), browser and app detections locally on your own servers. The system is composed of two main components, 1) an API Kit and 2) a ZIP archive containing all the files needed to detect things (devices, platforms, browsers, applications and their detection trees). The archive has over 27,000 files, one for each thing. The archive can be fetched via the dashboard and installed manually or fetched via an API kit, which fetches, unpacks and installs everything ready for use. Both options require you to configure your API Kit before the files can be used. See the 'Configuring API kits' section for more information. **Manual installation can be a little tricky**. Here's a few pro tips to get you through the dark night. The API kit will look for a directory called hd40store in the directory specified in your API kit config file. So, if you specify /tmp as the target directory then unzip the archive to /tmp/hd40store. Ensure the files and directory have appropriate permissions for read access by your web server or any other accounts using the API kit.
{"__v":4,"_id":"55fe0c1a948a830d0023a5b1","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -s -u \"api-username:api-secret\" --digest -H 'Host: api.handsetdetection.com' -H \"Content-Type: application/json\" http://api.handsetdetection.com/apiv4/device/vendors.json","name":""},{"language":"php","code":"$hd = new HandsetDetection\\HD4();\n$result = $hd->deviceVendors();\n$reply = $hd->getReply();\nprint_r(json_encode($reply));\n"}]},"params":[],"results":{"codes":[{"status":200,"language":"json","code":"{\n  \"vendor\":[\".mobi\",\"3GO\",\"3Q\",\"@Tab\",\"A-rival\",\"A1CS\",\"AARP\",\"ACCM\",\"ACT\",\"ADJ\",\"AEG\",\"AG\",\"AG-Tel\",\"AGPtek\",\"AOC\",\"AOSD\",\"AQ\",\"ARCELIK\",\"ATouch\",\"AVA\",\"AZEND\",\"AZhuo Digital\",\"Abix\",\"Accent\",\"Access\",\"Acer\",\"Acho\",\"Acme\",\"Acteck\",\"Adcom\",\"Admet\",\"Admiral\",\"Advan\",\"Advent\",\"Aedupac\",\"Afone\",\"Aftron\",\"Afunta\",\"Agasio\",\"AgfaPhoto\",\"Ahong\",\"Aigo\",\"Aiko\",\"Ainol\",\"AirPhone\",\"AirTab\",\"AirTyme\",\"Airis\",\"Airness\",\"Airpad\",\"Aishuo\",\"Akai\",\"Aktion\",\"Akura\",\"Alcatel\",\"Aligator\",\"Alligator\",\"Allview\",\"Allwinner\",\"AlphaCell Wireless\",\"Alps\",\"Aluratek\",\"Amar\",\"Amaway\",\"Amazon\",\"Ambrane\",\"Amgoo\",\"Amicom\",\"Amicroe\",\"Amino\",\"Amlogic\",\"Amoi\",\"Ampe\",\"Amvox\",\"Anaconda\",\"AndroPad\",\"Android\",\"Andromax\",\"AnexTek\",\"AngelnovoPC\",\"Ansonic\",\"Anysmart\",\"Aole\"],\n  \"message\":\"OK\",\n  \"status\":0\n}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":"/apiv:version/device/vendors.json"},"body":"Note - This example has its reply shortened.","category":"55fe0a94748eb30d008a1e3c","createdAt":"2015-09-20T01:30:02.133Z","excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"55fcad7951dbf70d00c61b3b","slug":"vendors","sync_unique":"","title":"vendors","type":"get","updates":[],"user":"55fcad15b652110d00758ada","version":"55fcb261a1dbbe0d001a139a","childrenPages":[]}

getvendors


Note - This example has its reply shortened.

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Note - This example has its reply shortened.
{"__v":4,"_id":"55fe0c20948a830d0023a5b3","api":{"auth":"required","examples":{"codes":[{"name":"","code":"curl -s -u \"api-username:api-password\" --digest -H 'Host: api.handsetdetection.com' -H \"Content-Type: application/json\" http://api.handsetdetection.com/apiv4/device/models/Nokia.json","language":"curl"},{"language":"php","code":"$hd = new HandsetDetection\\HD4();\n$result = $hd->deviceModels('Nokia');\n$reply = $hd->getReply();\nprint_r(json_encode($reply));"}]},"params":[{"_id":"5607b7b39ee9840d00091d16","required":true,"desc":"A vendor name (case sensitive)","default":"","type":"string","name":"vendor","in":"path"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n\t\"model\": [\"100\",\"101\",\"109\",\"110\",\"1100b\",\"111\",\"1110i\",\"112\",\"113\",\"114\",\"200\",\"201\",\"202\",\"203\",\"205\",\"206\",\"208\",\"1006\",\"1100\",\"1101\",\"1108\",\"1110\",\"1112\",\"1202\",\"1208\",\"1209\",\"1220\",\"1221\",\"1260\",\"1261\",\"1280\",\"1320\",\"1508\",\"1508i\",\"1600\",\"1606\",\"1616\",\"1650\",\"1661\",\"1680c\",\"1681c\",\"1682c\",\"1800\",\"2100\",\"2112\",\"2115i\",\"2116\",\"2125\",\"2125i\",\"2126\",\"2126i\",\"2128i\",\"2135\",\"2220\",\"2220 slide\",\"2228\",\"2260\",\"2270\",\"2275\",\"2280\",\"2285\",\"2300\",\"2310\",\"2320c\",\"2323c-2\",\"2330 Classic\",\"2330 Classic 2B\",\"2355\",\"2365i\",\"2366i\",\"2505\",\"2600\",\"2600c\",\"2600c-2b\",\"2605\",\"2605 Mirage\",\"2610\",\"2626\",\"2630\",\"2650\",\"2651\",\"2652\",\"2660\",\"2680\",\"2680 Slide\",\"2680s\",\"2705\",\"2705 Shade\",\"2710 Navigation Edition\",\"2710c\",\"2720 Fold\",\"2720a\",\"2730 Classic\",\"2855i\"],\n  \"message\":\"OK\",\n  \"status\":0\n}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":"/apiv:version/device/models/:vendor.json"},"body":"[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Note : Reply is truncated\",\n  \"body\": \"The model field has had its data truncated.\"\n}\n[/block]","category":"55fe0a94748eb30d008a1e3c","createdAt":"2015-09-20T01:30:08.635Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":1,"parentDoc":null,"project":"55fcad7951dbf70d00c61b3b","slug":"models","sync_unique":"","title":"models","type":"get","updates":[],"user":"55fcad15b652110d00758ada","version":"55fcb261a1dbbe0d001a139a","childrenPages":[]}

getmodels


vendor:
required
string
A vendor name (case sensitive)
[block:callout] { "type": "warning", "title": "Note : Reply is truncated", "body": "The model field has had its data truncated." } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



[block:callout] { "type": "warning", "title": "Note : Reply is truncated", "body": "The model field has had its data truncated." } [/block]
{"__v":2,"_id":"55fe0c40948a830d0023a5b7","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -s -u \"api-username:api-secret\" --digest -H 'Host: api.handsetdetection.com' -H \"Content-Type: application/json\" http://api.handsetdetection.com/apiv4/device/view/Nokia/N95.json","name":""},{"language":"php","code":"$hd = new HandsetDetection\\HD4();\n$result = $hd->deviceView('Nokia', 'N95');\n$reply = $hd->getReply();\nprint_r($json_encode($reply));\n"}]},"params":[{"_id":"55fe8da1473f380d000b26ae","default":"","desc":"Vendor name eg 'Nokia'","name":"vendor","required":true,"type":"string","in":"path"},{"_id":"55fe8da1473f380d000b26ad","default":"","desc":"Model name eg 'N95'","name":"model","required":true,"type":"string","in":"path"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n  \"device\":{\n    \"general_vendor\":\"Nokia\",\n    \"general_model\":\"N95\",\n    \"general_platform\":\"Symbian\",\n    \"general_platform_version\":\"9.2\",\n    \"general_browser\":\"\",\n    \"general_browser_version\":\"\",\n    \"general_image\":\"nokian95-1403496370-0.gif\",\n    \"general_aliases\":[],\n    \"general_eusar\":\"0.50\",\n    \"general_battery\":[\"Li-Ion 950 mAh\",\"BL-5F\"],\n    \"general_type\":\"Mobile\",\n    \"general_cpu\":[\"Dual ARM 11\",\"332MHz\"],\n    \"design_formfactor\":\"Dual Slide\",\n    \"design_dimensions\":\"99 x 53 x 21\",\n    \"design_weight\":\"120\",\n    \"design_antenna\":\"Internal\",\n    \"design_keyboard\":\"Numeric\",\n    \"design_softkeys\":\"2\",\n    \"design_sidekeys\":[\"Volume\",\"Camera\"],\n    \"display_type\":\"TFT\",\n    \"display_color\":\"Yes\",\n    \"display_colors\":\"16M\",\n    \"display_size\":\"2.6\\\"\",\n    \"display_x\":\"240\",\n    \"display_y\":\"320\",\n    \"display_other\":[],\n    \"memory_internal\":[\"160MB\",\"64MB RAM\",\"256MB ROM\"],\n    \"memory_slot\":[\"microSD\",\"8GB\",\"128MB\"],\n    \"network\":[\"GSM850\",\"GSM900\",\"GSM1800\",\"GSM1900\",\"UMTS2100\",\"HSDPA2100\",\"Infrared\",\"Bluetooth 2.0\",\"802.11b\",\"802.11g\",\"GPRS Class 10\",\"EDGE Class 32\"],\n    \"media_camera\":[\"5MP\",\"2592x1944\"],\n    \"media_secondcamera\":[\"QVGA\"],\n    \"media_videocapture\":[\"VGA@30fps\"],\n    \"media_videoplayback\":[\"MPEG4\",\"H.263\",\"H.264\",\"3GPP\",\"RealVideo 8\",\"RealVideo 9\",\"RealVideo 10\"],\n    \"media_audio\":[\"MP3\",\"AAC\",\"AAC+\",\"eAAC+\",\"WMA\"],\n    \"media_other\":[\"Auto focus\",\"Video stabilizer\",\"Video calling\",\"Carl Zeiss optics\",\"LED Flash\"],\n    \"features\":[\"Unlimited entries\",\"Multiple numbers per contact\",\"Picture ID\",\"Ring ID\",\"Calendar\",\"Alarm\",\"To-Do\",\"Document viewer\",\"Calculator\",\"Notes\",\"UPnP\",\"Computer sync\",\"VoIP\",\"Music ringtones (MP3)\",\"Vibration\",\"Phone profiles\",\"Speakerphone\",\"Accelerometer\",\"Voice dialing\",\"Voice commands\",\"Voice recording\",\"Push-to-Talk\",\"SMS\",\"MMS\",\"Email\",\"Instant Messaging\",\"Stereo FM radio\",\"Visual radio\",\"Dual slide design\",\"Organizer\",\"Word viewer\",\"Excel viewer\",\"PowerPoint viewer\",\"PDF viewer\",\"Predictive text input\",\"Push to talk\",\"Voice memo\",\"Games\"],\n    \"connectors\":[\"USB\",\"MiniUSB\",\"3.5mm Audio\",\"TV Out\"],\n    \"general_platform_version_max\":\"\",\n    \"general_app\":\"\",\n    \"general_app_version\":\"\",\n    \"general_language\":\"\",\n    \"display_ppi\":154,\n    \"display_pixel_ratio\":\"\",\n    \"benchmark_min\":0,\n    \"benchmark_max\":0,\n    \"general_app_category\":\"\"\n  },\n  \"message\":\"OK\",\n  \"status\":0\n}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":"/apiv:version/device/view/:vendor/:model.json"},"body":"","category":"55fe0a94748eb30d008a1e3c","createdAt":"2015-09-20T01:30:40.336Z","editedParams":true,"editedParams2":true,"excerpt":"View device information","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":2,"parentDoc":null,"project":"55fcad7951dbf70d00c61b3b","slug":"view","sync_unique":"","title":"view","type":"get","updates":[],"user":"55fcad15b652110d00758ada","version":"55fcb261a1dbbe0d001a139a","childrenPages":[]}

getview

View device information

vendor:
required
string
Vendor name eg 'Nokia'
model:
required
string
Model name eg 'N95'

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



{"__v":5,"_id":"55fe0af15130171900235a88","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -s -u \"api-username:api-secret\" --digest -H 'Host: api.handsetdetection.com' -H \"Content-Type: application/json\" http://api.handsetdetection.com/apiv4/device/fetcharchive.json","name":""},{"language":"php","code":"// Note : request storage dir to be created if it does not exist. (with TRUE as 2nd param)\n$hd = new HandsetDetection\\HD4($myConfigFile, true);\n$result = $hd->deviceFetchArchive();"}]},"params":[],"results":{"codes":[{"language":"text","code":"Replies with a ZIP archive, around 21Mb in size. The API Kit unzips the archive into the directory defined in the api kit config file. The archive contains specs for over 25,000 devices (in json format) and the matching trees (also json) ready to use in detections."}]},"settings":"","url":"/apiv:version/device/fetcharchive.json"},"body":"[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Archive Size\",\n  \"body\": \"The zip file downloaded is about 20Mb, and contains 25,000+ devices and the device matching rules.\"\n}\n[/block]","category":"55fe0a94748eb30d008a1e3c","createdAt":"2015-09-20T01:25:05.623Z","excerpt":"Fetch the device database and the matching trees in one handy zip archive.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":3,"parentDoc":null,"project":"55fcad7951dbf70d00c61b3b","slug":"fetcharchive","sync_unique":"","title":"fetcharchive","type":"get","updates":[],"user":"55fcad15b652110d00758ada","version":"55fcb261a1dbbe0d001a139a","childrenPages":[]}

getfetcharchive

Fetch the device database and the matching trees in one handy zip archive.

[block:callout] { "type": "warning", "title": "Archive Size", "body": "The zip file downloaded is about 20Mb, and contains 25,000+ devices and the device matching rules." } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



[block:callout] { "type": "warning", "title": "Archive Size", "body": "The zip file downloaded is about 20Mb, and contains 25,000+ devices and the device matching rules." } [/block]
{"__v":2,"_id":"570309ae6658250e004ac823","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -s -u \"api-username:api-secret\" --digest http://api.handsetdetection.com/apiv4/device/whathas/general_type/Tablet.json"}]},"params":[{"_id":"57030b8c6ac2720e0091d3ae","ref":"","required":true,"desc":"A schema field eg. general_type or network. See the field list in the Device Schema section.","default":"","type":"string","name":"field","in":"path"},{"_id":"57030b8c6ac2720e0091d3ad","ref":"","required":true,"desc":"A value eg. Tablet or CDMA","default":"","type":"string","name":"property","in":"path"}],"results":{"codes":[{"status":200,"language":"json","code":"{\"devices\":[\n  {\"id\":\"49528\",\"general_vendor\":\"Hi-Level\",\"general_model\":\"HLV-T702\"},\n  {\"id\":\"1485\",\"general_vendor\":\"Sony\",\"general_model\":\"PEG-TJ37\"},\n  {\"id\":\"1486\",\"general_vendor\":\"Sony\",\"general_model\":\"PEG-TH55\"},\n  {\"id\":\"1723\",\"general_vendor\":\"Archos\",\"general_model\":\"A70HB\"},\n  {\"id\":\"1739\",\"general_vendor\":\"Nokia\",\"general_model\":\"N800\"},\n  {\"id\":\"2300\",\"general_vendor\":\"Nokia\",\"general_model\":\"N810\"},\n  {\"id\":\"2350\",\"general_vendor\":\"HP\",\"general_model\":\"TouchPad\"},\n  {\"id\":\"2380\",\"general_vendor\":\"Nextbook\",\"general_model\":\"NXM703U\"},\n  {\"id\":\"2568\",\"general_vendor\":\"Archos\",\"general_model\":\"5\"},\n  {\"id\":\"2605\",\"general_vendor\":\"RIM\",\"general_model\":\"BlackBerry PlayBook\"},\n  {\"id\":\"2681\",\"general_vendor\":\"Dell\",\"general_model\":\"Streak\"},\n  {\"id\":\"35428\",\"general_vendor\":\"Samsung\",\"general_model\":\"SPH-P100\"},\n  {\"id\":\"35430\",\"general_vendor\":\"Toshiba\",\"general_model\":\"AT100\"},\n  {\"id\":\"35436\",\"general_vendor\":\"LG\",\"general_model\":\"V909\"},\n  ....]\n}\n  ","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":"/api:version/device/whathas/:field/:property.json"},"body":"","category":"55fe0a94748eb30d008a1e3c","createdAt":"2016-04-05T00:41:18.832Z","editedParams":true,"editedParams2":true,"excerpt":"Which devices have a property ?","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":4,"parentDoc":null,"project":"55fcad7951dbf70d00c61b3b","slug":"whathas","sync_unique":"","title":"whathas","type":"get","updates":[],"user":"55fcad15b652110d00758ada","version":"55fcb261a1dbbe0d001a139a","childrenPages":[]}

getwhathas

Which devices have a property ?

field:
required
string
A schema field eg. general_type or network. See the field list in the Device Schema section.
property:
required
string
A value eg. Tablet or CDMA

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



{"__v":4,"_id":"55fcb262a1dbbe0d001a139d","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -s -u \"api-username:api-secret\" --digest -H \"Content-Type: application/json\" -X POST -d '{\"user-agent\":\"Mozilla/5.0 (iPhone; CPU iPhone OS 6_0_1 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A523 Safari/8536.25\",\"x-local-hardwareinfo\":\"320:568:200:950\"}' http://api.handsetdetection.com/apiv4/device/detect.json"},{"language":"php","code":"$headers = array(\n\t'user-agent' => 'Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A403 Safari/8536.25',\n\t'x-local-hardwareinfo' => '320:568:200:950'\n);\n\n$hd = new HandsetDetection\\HD4();\n$result = $hd->deviceDetect($headers);\n$reply = $hd->getReply();\nprint_r($reply);"}]},"params":[{"_id":"55fdd1e6b733000d007f353c","default":"","desc":"An authorized account holders site id","name":"site_id","ref":"","required":false,"type":"int","in":"path"},{"_id":"55fdf712b652110d00758b89","default":"","desc":"A user-agent http header","name":"user-agent","ref":"","required":false,"type":"string","in":"body"},{"_id":"55fe12a75c67200d00fa2f1f","default":"","desc":"A hardware info string (see the API v4 / Enhancing Detection Results). Format is {width}:{height}:{display ratio * 100}:{micro benchmarkk}","name":"x-local-hardwareinfo","ref":"","required":false,"type":"string","in":"body"}],"results":{"codes":[{"name":"","code":"{\n  \"hd_specs\": {\n    \"general_vendor\":\"Apple\",\n    \"general_model\":\"iPhone 5\",\n    \"general_platform\":\"iOS\",\n    \"general_platform_version\":\"6.0\",\n    \"general_platform_version_max\":\"\",\n    \"general_browser\":\"Mobile Safari\",\n    \"general_browser_version\":\"6.0\",\n    \"general_image\":\"appleiphone5-1369119062-2.jpg\",\n    \"general_aliases\":[],\n    \"general_eusar\":\"\",\n    \"general_battery\":[\"Li-Ion 1440 mAh\"],\n    \"general_type\":\"Mobile\",\n    \"general_cpu\":[\"1.2GHz\"],\n    \"design_formfactor\":\"Bar\",\n    \"design_dimensions\":\"123.8 x 58.6 x 7.6\",\n    \"design_weight\":\"112\",\n    \"design_antenna\":\"Internal\",\n    \"design_keyboard\":\"Screen\",\n    \"design_softkeys\":\"\",\n    \"design_sidekeys\":[],\n    \"display_type\":\"TFT\",\n    \"display_color\":\"Yes\",\n    \"display_colors\":\"16M\",\n    \"display_size\":\"4\\\"\",\n    \"display_x\":\"640\",\n    \"display_y\":\"1136\",\n    \"display_ppi\":326,\n    \"display_pixel_ratio\":\"2.0\",\n    \"display_other\":[\"Capacitive\",\"Touch\",\"Gorilla Glass\"],\n    \"memory_internal\":[\"1GB RAM\"],\n    \"memory_slot\":[],\n    \"network\":[\"GSM850\",\"GSM900\",\"GSM1800\",\"GSM1900\",\"CDMA800\",\"CDMA1700\",\"CDMA1900\",\"CDMA2100\",\"HSDPA850\",\"HSDPA900\",\"HSDPA1900\",\"HSDPA2100\",\"LTE700\",\"LTE850\",\"LTE1800\",\"LTE2100\",\"802.11a\",\"802.11b\",\"802.11g\",\"802.11n\",\"Bluetooth 4.0\"],\n    \"media_camera\":[\"8MP\",\"3264x2448\"],\n    \"media_secondcamera\":[\"1.2MP\"],\n    \"media_videocapture\":[\"Yes\"],\n    \"media_videoplayback\":[],\n    \"media_audio\":[],\n    \"media_other\":[\"Geotagging\",\"Face Detection\"],\n    \"features\":[\"Accelerometer\",\"gyro\",\"proximity\",\"compass\",\"iMessage\",\"SMS\",\"MMS\",\"Email\",\"Push\",\"iCloud cloud service\",\"Twitter\",\"Facebook\",\"Maps\",\"iBooks PDF reader\",\"Image editor\",\"Voice memo\",\"Voice command\",\"Voice dial\",\"Vibration\",\"proprietary ringtones\",\"Qi Case\"],\n    \"connectors\":[\"TV Out\",\"3.5mm Audio\"],\n    \"benchmark_min\":450,\n    \"benchmark_max\":900,\n    \"general_app\":\"\",\n    \"general_app_version\":\"\",\n    \"general_language\":\"\",\n    \"general_app_category\":\"\"\n  },\n  \"message\":\"OK\",\n  \"status\":0\n}","language":"json","status":200},{"name":"","code":"{}","language":"json","status":400}]},"settings":"","url":"/apiv:version/device/detect/:site_id.json"},"body":"In the example (to the left) if x-local-harwdareinfo were not supplied then the device would detect as a standard Apple iPhone. See [Enhancing detection results](doc:enhancing-detection-results) ] for a discussion.","category":"55fe0a94748eb30d008a1e3c","createdAt":"2015-09-19T00:51:47.454Z","editedParams":true,"editedParams2":true,"excerpt":"Detection using HTTP headers.","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":5,"parentDoc":null,"project":"55fcad7951dbf70d00c61b3b","slug":"detect-web","sync_unique":"","title":"detect (Web)","type":"post","updates":[],"user":"55fcad15b652110d00758ada","version":"55fcb261a1dbbe0d001a139a","childrenPages":[]}

postdetect (Web)

Detection using HTTP headers.

site_id:
integer
An authorized account holders site id
user-agent:
string
A user-agent http header
x-local-hardwareinfo:
string
A hardware info string (see the API v4 / Enhancing Detection Results). Format is {width}:{height}:{display ratio * 100}:{micro benchmarkk}
In the example (to the left) if x-local-harwdareinfo were not supplied then the device would detect as a standard Apple iPhone. See [Enhancing detection results](doc:enhancing-detection-results) ] for a discussion.

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



In the example (to the left) if x-local-harwdareinfo were not supplied then the device would detect as a standard Apple iPhone. See [Enhancing detection results](doc:enhancing-detection-results) ] for a discussion.
{"__v":5,"_id":"55fe0e9a748eb30d008a1e40","api":{"auth":"required","examples":{"codes":[{"name":"","code":"curl -s -u \"api-username:api-secret\" --digest -H \"Content-Type: application/json\" -X POST -d '{\"utsname.machine\":\"iphone4,1\",\"utsname.brand\":\"Apple\"}' http://api.handsetdetection.com/apiv4/device/detect.json","language":"curl"},{"language":"php","code":"$buildInfo = array (\n\t'utsname.machine' => 'iphone4,1',\n\t'utsname.brand' => 'Apple'\n);\n\n$hd = new HandsetDetection\\HD4();\n$result = $hd->deviceDetect($buildInfo);\n$reply = $hd->getReply();\nprint_r(json_encode($reply));\n"}]},"params":[{"_id":"5607c4d98730190d00059c61","required":false,"desc":"Authorized account holder's site_id","default":"","type":"string","name":"site_id","in":"path"},{"_id":"55fe47ea948a830d0023a5d2","required":false,"desc":"The name of the OS eg iPhone OS","default":"","type":"string","name":"UIDevice.systemName","in":"body"},{"_id":"55fe47ea948a830d0023a5d1","required":false,"desc":"iOS version number","default":"","type":"string","name":"UIDevice.systemVersion","in":"body"},{"_id":"55fe47ea948a830d0023a5d0","required":false,"desc":"iPad, iPhone or iPod Touch","default":"","type":"string","name":"UIDevice.model","in":"body"},{"_id":"55fe47ea948a830d0023a5cf","required":true,"desc":"Device model name : eg iPhone5,1 .. See below","default":"","type":"string","name":"utsname.machine","in":"body"},{"_id":"55fe79fc748eb30d008a1e64","required":true,"desc":"'Apple', always Apple","default":"Apple","type":"string","name":"utsname.brand","in":"body"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n  \"hd_specs\":{\n    \"general_vendor\":\"Apple\",\n    \"general_model\":\"iPhone 4S\",\n    \"general_platform\":\"iOS\",\n    \"general_platform_version\":\"5.0\",\n    \"general_platform_version_max\":\"\",\n    \"general_browser\":\"\",\n    \"general_browser_version\":\"\",\n    \"general_image\":\"appleiphone4s-1416198927-2.png\",\n    \"general_aliases\":[],\n    \"general_eusar\":\"0.99\",\n    \"general_battery\":[\"Li-Po 1432 mAh\"],\n    \"general_type\":\"Mobile\",\n    \"general_cpu\":[\"1.0GHz\"],\n    \"design_formfactor\":\"Bar\",\n    \"design_dimensions\":\"115.2 x 58.6 x 9.3\",\n    \"design_weight\":\"140\",\n    \"design_antenna\":\"Internal\",\n    \"design_keyboard\":\"Screen\",\n    \"design_softkeys\":\"\",\n    \"design_sidekeys\":[\"Volume\"],\n    \"display_type\":\"IPS LCD\",\n    \"display_color\":\"Yes\",\n    \"display_colors\":\"16M\",\n    \"display_size\":\"3.5\\\"\",\n    \"display_x\":\"640\",\n    \"display_y\":\"960\",\n    \"display_ppi\":326,\n    \"display_pixel_ratio\":\"2.0\",\n    \"display_other\":[\"Capacitive\",\"Touch\",\"Multitouch\",\"Gorilla Glass\"],\n    \"memory_internal\":[\"16GB\",\"32GB\",\"64GB\",\"512MB RAM\"],\n    \"memory_slot\":[],\n    \"network\":[\"CDMA800\",\"CDMA1900\",\"GSM850\",\"GSM900\",\"GSM1800\",\"GSM1900\",\"UMTS850\",\"UMTS900\",\"UMTS1900\",\"UMTS2100\",\"HSDPA850\",\"HSDPA900\",\"HSDPA1900\",\"HSDPA2100\",\"Bluetooth 4.0\",\"802.11b\",\"802.11g\",\"802.11n\",\"GPRS\",\"EDGE\"],\n    \"media_camera\":[\"8MP\",\"3264x2448\"],\n    \"media_secondcamera\":[\"VGA\",\"480p@30fps\"],\n    \"media_videocapture\":[\"720p@30fps\"],\n    \"media_videoplayback\":[\"MPEG4\",\"H.264\",\"Motion JPG\",\"MOV\"],\n    \"media_audio\":[\"MP3\",\"AAC\",\"eAAC\",\"WAV\",\"M4A\"],\n    \"media_other\":[\"Back-illuminated sensor (BSI)\",\"Auto focus\",\"Touch to focus\",\"Image stabilizer\",\"Video stabilizer\",\"Face detection\",\"Geo-tagging\",\"Video calling\",\"HDR\",\"LED Flash\"],\n    \"features\":[\"Unlimited entries\",\"Caller groups\",\"Multiple numbers per contact\",\"Search by both first and last name\",\"Picture ID\",\"Ring ID\",\"Calendar\",\"Alarm\",\"Document viewer\",\"Office 2007 viewer\",\"Office 2003 viewer\",\"PDF viewer\",\"Calculator\",\"USB charging\",\"Computer sync\",\"OTA sync\",\"Music ringtones (MP3)\",\"Polyphonic ringtones\",\"Vibration\",\"Flight mode\",\"Silent mode\",\"Speakerphone\",\"Accelerometer\",\"Gyroscope\",\"Compass\",\"Voice dialing\",\"Voice commands\",\"Voice recording\",\"Light sensor\",\"Proximity sensor\",\"iMessage\",\"SMS\",\"Threaded viewer\",\"MMS\",\"Email\",\"Push Email\",\"MicroSIM card support only\",\"Scratch-resistant glass back panel\",\"Active noise cancellation with dedicated mic\",\"Siri natural language commands and dictation\",\"iCloud cloud service\",\"Twitter integration\",\"Google Maps\",\"Audio\\/video player and editor\",\"Image editor\",\"Games\",\"Qi Case\"],\n    \"connectors\":[\"USB 2.0\",\"3.5mm Audio\",\"TV Out\"],\n    \"benchmark_min\":161,\n    \"benchmark_max\":300,\n    \"general_app\":\"\",\n    \"general_app_version\":\"\",\n    \"general_app_category\":\"\",\n    \"general_language\":\"\"\n  },\n  \"message\":\"OK\",\n  \"status\":0\n}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":"/apiv:version/device/detect/:site_id.json"},"body":"Get more information about valid UIDevice keys and utsname.* at the [Apple Developer Docs](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDevice_Class/index.html#//apple_ref/occ/instp/UIDevice[Apple Developer Docs) and on [Stack Overflow](http://stackoverflow.com/questions/14716754/get-device-type-model)","category":"55fe0a94748eb30d008a1e3c","createdAt":"2015-09-20T01:40:42.318Z","editedParams":true,"editedParams2":true,"excerpt":"Detection using native build information from iOS","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":6,"parentDoc":null,"project":"55fcad7951dbf70d00c61b3b","slug":"detect-native-ios","sync_unique":"","title":"detect (Native - iOS)","type":"post","updates":[],"user":"55fcad15b652110d00758ada","version":"55fcb261a1dbbe0d001a139a","childrenPages":[]}

postdetect (Native - iOS)

Detection using native build information from iOS

site_id:
string
Authorized account holder's site_id
UIDevice.systemName:
string
The name of the OS eg iPhone OS
UIDevice.systemVersion:
string
iOS version number
UIDevice.model:
string
iPad, iPhone or iPod Touch
utsname.machine:
required
string
Device model name : eg iPhone5,1 .. See below
utsname.brand:
required
stringApple
'Apple', always Apple
Get more information about valid UIDevice keys and utsname.* at the [Apple Developer Docs](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDevice_Class/index.html#//apple_ref/occ/instp/UIDevice[Apple Developer Docs) and on [Stack Overflow](http://stackoverflow.com/questions/14716754/get-device-type-model)

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Get more information about valid UIDevice keys and utsname.* at the [Apple Developer Docs](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDevice_Class/index.html#//apple_ref/occ/instp/UIDevice[Apple Developer Docs) and on [Stack Overflow](http://stackoverflow.com/questions/14716754/get-device-type-model)
{"__v":2,"_id":"55fe0eac748eb30d008a1e42","api":{"auth":"required","examples":{"codes":[{"name":"","code":"curl -s -u \"api-username:api-secret\" --digest -H \"Content-Type: application/json\" -X POST -d '{\"devicemanufacturer\":\"nokia\",\"devicename\":\"RM-875\"}' http://api.handsetdetection.com/apiv4/device/detect.json","language":"curl"},{"language":"php","code":"$buildInfo = array (\n\t'devicemanufacturer' => 'nokia',\n\t'devicename' => 'RM-875'\n);\n$hd = new HandsetDetection\\HD4();\n$result = $hd->deviceDetect($buildInfo);\n$reply = $hd->getReply();\nprint_r(json_encode($reply));\n"}]},"params":[{"_id":"55fe0f9dcc468e0d008dcde2","default":"","desc":"Authroized account holder's site id","name":"site_id","required":false,"type":"int","in":"path"},{"_id":"55fe848f748eb30d008a1e69","default":"","desc":"From Microsoft.Phone.Info.DeviceStatus.DeviceManufacturer","name":"DeviceManufacturer","required":true,"type":"string","in":"body"},{"_id":"55fe848f748eb30d008a1e68","default":"","desc":"From Microsoft.Phone.Info.DeviceStatus.DeivceName","name":"DeviceName","required":true,"type":"string","in":"body"},{"_id":"55fe848f748eb30d008a1e67","required":false,"desc":"From Environment.OSVersion.Version - The Text ('Windows Phone')","default":"","type":"string","name":"OSName","in":"body"},{"_id":"55fe848f748eb30d008a1e66","default":"","desc":"From Environment.OSVersion.Version - The major and minor version numbers (eg 7.12, 8.1)","name":"OSVersion","required":false,"type":"string","in":"body"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n  \"hd_specs\":{\n    \"general_vendor\":\"Nokia\",\n    \"general_model\":\"Lumia 1020\",\n    \"general_platform\":\"Windows Phone\",\n    \"general_platform_version\":\"8.0\",\n    \"general_platform_version_max\":\"\",\n    \"general_browser\":\"\",\n    \"general_browser_version\":\"\",\n    \"general_image\":\"nokialumia1020-1379392190-0.jpg\",\n    \"general_aliases\":[\"Nokia 909\"],\n    \"general_eusar\":\"0.76 Head\",\n    \"general_battery\":[\"Li-Ion 2000 mAh\"],\n    \"general_type\":\"Mobile\",\n    \"general_cpu\":[\"Dual Core\",\"1.5GHz\",\"Qualcomm Snapdragon S4 MSM8960\",\"Adreno 225\"],\n    \"design_formfactor\":\"Bar\",\n    \"design_dimensions\":\"130.4 x 71.4 x 10.4\",\n    \"design_weight\":\"158\",\n    \"design_antenna\":\"Internal\",\n    \"design_keyboard\":\"Screen\",\n    \"design_softkeys\":\"3\",\n    \"design_sidekeys\":[\"Volume\",\"Power\",\"Camera\"],\n    \"display_type\":\"AMOLED\",\n    \"display_color\":\"Yes\",\n    \"display_colors\":\"16M\",\n    \"display_size\":\"4.5\\\"\",\n    \"display_x\":\"768\",\n    \"display_y\":\"1280\",\n    \"display_ppi\":332,\n    \"display_pixel_ratio\":\"\",\n    \"display_other\":[\"Capacitive Touchscreen\",\"Multitouch\",\"Corning Gorilla Glass 3\",\"Brightness control\",\"PureMotion HD+ ClearBlack display\"],\n    \"memory_internal\":[\"32GB ROM\",\"2GB RAM\"],\n    \"memory_slot\":[\"None\"],\n    \"network\":[\"GSM850\",\"GSM900\",\"GSM1800\",\"GSM1900\",\"UMTS850\",\"UMTS900\",\"UMTS1900\",\"UMTS2100\",\"LTE800\",\"LTE900\",\"LTE1800\",\"LTE2100\",\"LTE2600\",\"GPRS\",\"EDGE\",\"WIFI\",\"802.11a\",\"802.11b\",\"802.11g\",\"802.11n\",\"Bluetooth 4.0\",\"NFC\",\"DLNA\",\"WIFI Hotspot\"],\n    \"media_camera\":[\"41MP\"],\n    \"media_secondcamera\":[\"1.2MP\",\"1278x720\"],\n    \"media_videocapture\":[\"YES\",\"FHD @30fps\",\"HD @30fps\"],\n    \"media_videoplayback\":[\"MPEG4\",\"H.263\",\"H.264\",\"WMV\",\"3GP\",\"3G2\",\"MP4\",\"DIVX\",\"XVID\"],\n    \"media_audio\":[\"MP3\",\"AAC\",\"eAAC\",\"WMA\",\"MP4\",\"AMR\",\"3GP\",\"eAAC+\"],\n    \"media_other\":[\"AutoFocus\",\"Touch to Focus\",\"Optical Image Stabilization\",\"Exposure Compensation\",\"ISO Control\",\"White Balance Presets\",\"Digital Zoom\",\"Geo-Tagging\",\"Effects\",\"Self-Timer\",\"LED Flash\",\"Manual focus\",\"Back-illuminated Sensor (BSI)\",\"Carl Zeiss Optics\",\"Xenon Flash\",\"PureView technology\",\"Face Detection\",\"Panorama\",\"F2.2 Aperture\",\"Video light\",\"Video Calling\"],\n    \"features\":[\"Ambient Light Sensor\",\"Proximity Sensor\",\"GLONASS\",\"Vibration\",\"Flight Mode\",\"Speakerphone\",\"Accelerometer\",\"Gyroscope Sensor\",\"Compass\",\"Barometer Sensor\",\"Stereo FM Radio with RDS\",\"Qi Integrated\",\"Magnetometer\",\"Dolby Digital Plus\",\"Active noise cancellation with a dedicated mic\"],\n    \"connectors\":[\"TV Out\",\"3.5mm Audio\",\"MicroUSB 2.0\"],\n    \"benchmark_min\":\"0\",\n    \"benchmark_max\":\"0\",\n    \"general_app\":\"\",\n    \"general_app_version\":\"\",\n    \"general_app_category\":\"\",\n    \"general_language\":\"\"\n  },\n  \"message\":\"OK\",\n  \"status\":0\n}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":"/apiv:version/device/detect/:site_id.json"},"body":"More information about getting Windows Phone build information at this [Windows Phone Device Information](http://www.ginktage.com/2011/07/retreive-the-device-information-from-windows-phone/) page or at MSDN : https://msdn.microsoft.com/en-us/library/windows/apps/microsoft.phone.info.devicestatus(v=vs.105).aspx","category":"55fe0a94748eb30d008a1e3c","createdAt":"2015-09-20T01:41:00.912Z","editedParams":true,"editedParams2":true,"excerpt":"Detection using native build information from windows phone.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":7,"parentDoc":null,"project":"55fcad7951dbf70d00c61b3b","slug":"detect-native-windows-phone","sync_unique":"","title":"detect (Native - Windows Phone)","type":"post","updates":[],"user":"55fcad15b652110d00758ada","version":"55fcb261a1dbbe0d001a139a","childrenPages":[]}

postdetect (Native - Windows Phone)

Detection using native build information from windows phone.

site_id:
integer
Authroized account holder's site id
DeviceManufacturer:
required
string
From Microsoft.Phone.Info.DeviceStatus.DeviceManufacturer
DeviceName:
required
string
From Microsoft.Phone.Info.DeviceStatus.DeivceName
OSName:
string
From Environment.OSVersion.Version - The Text ('Windows Phone')
OSVersion:
string
From Environment.OSVersion.Version - The major and minor version numbers (eg 7.12, 8.1)
More information about getting Windows Phone build information at this [Windows Phone Device Information](http://www.ginktage.com/2011/07/retreive-the-device-information-from-windows-phone/) page or at MSDN : https://msdn.microsoft.com/en-us/library/windows/apps/microsoft.phone.info.devicestatus(v=vs.105).aspx

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



More information about getting Windows Phone build information at this [Windows Phone Device Information](http://www.ginktage.com/2011/07/retreive-the-device-information-from-windows-phone/) page or at MSDN : https://msdn.microsoft.com/en-us/library/windows/apps/microsoft.phone.info.devicestatus(v=vs.105).aspx
{"__v":3,"_id":"55fe0e5d948a830d0023a5ba","api":{"auth":"required","examples":{"codes":[{"language":"curl","code":"curl -s -u \"api-username:api-secret\" --digest -H \"Content-Type: application/json\" -X POST -d '{\"ro.build.PDA\":\"I9500XXUFNE7\",\"ro.build.changelist\":\"699287\",\"ro.build.characteristics\":\"phone\",\"ro.build.date.utc\":\"1401287026\",\"ro.build.date\":\"Wed May 28 23:23:46 KST 2014\",\"ro.build.description\":\"ja3gxx-user 4.4.2 KOT49H I9500XXUFNE7 release-keys\",\"ro.build.display.id\":\"KOT49H.I9500XXUFNE7\",\"ro.build.fingerprint\":\"samsung\\/ja3gxx\\/ja3g:4.4.2\\/KOT49H\\/I9500XXUFNE7:user\\/release-keys\",\"ro.build.hidden_ver\":\"I9500XXUFNE7\",\"ro.build.host\":\"SWDD5723\",\"ro.build.id\":\"KOT49H\",\"ro.build.product\":\"ja3g\",\"ro.build.tags\":\"release-keys\",\"ro.build.type\":\"user\",\"ro.build.user\":\"dpi\",\"ro.build.version.codename\":\"REL\",\"ro.build.version.incremental\":\"I9500XXUFNE7\",\"ro.build.version.release\":\"4.4.2\",\"ro.build.version.sdk\":\"19\",\"ro.product.board\":\"universal5410\",\"ro.product.brand\":\"samsung\",\"ro.product.cpu.abi2\":\"armeabi\",\"ro.product.cpu.abi\":\"armeabi-v7a\",\"ro.product.device\":\"ja3g\",\"ro.product.locale.language\":\"en\",\"ro.product.locale.region\":\"GB\",\"ro.product.manufacturer\":\"samsung\",\"ro.product.model\":\"GT-I9500\",\"ro.product.name\":\"ja3gxx\",\"ro.product_ship\":\"true\"}' http://api.handsetdetection.com/apiv4/device/detect.json","name":""},{"language":"php","code":"$buildInfo = array (\n\t'ro.build.PDA' => 'I9500XXUFNE7',\n\t'ro.build.changelist' => '699287',\n\t'ro.build.characteristics' => 'phone',\n\t'ro.build.date.utc' => '1401287026',\n\t'ro.build.date' => 'Wed May 28 23:23:46 KST 2014',\n\t'ro.build.description' => 'ja3gxx-user 4.4.2 KOT49H I9500XXUFNE7 release-keys',\n\t'ro.build.display.id' => 'KOT49H.I9500XXUFNE7',\n\t'ro.build.fingerprint' => 'samsung/ja3gxx/ja3g:4.4.2/KOT49H/I9500XXUFNE7:user/release-keys',\n\t'ro.build.hidden_ver' => 'I9500XXUFNE7',\n\t'ro.build.host' => 'SWDD5723',\n\t'ro.build.id' => 'KOT49H',\n\t'ro.build.product' => 'ja3g',\n\t'ro.build.tags' => 'release-keys',\n\t'ro.build.type' => 'user',\n\t'ro.build.user' => 'dpi',\n\t'ro.build.version.codename' => 'REL',\n\t'ro.build.version.incremental' => 'I9500XXUFNE7',\n\t'ro.build.version.release' => '4.4.2',\n\t'ro.build.version.sdk' => '19',\n\t'ro.product.board' => 'universal5410',\n\t'ro.product.brand' => 'samsung',\n\t'ro.product.cpu.abi2' => 'armeabi',\n\t'ro.product.cpu.abi' => 'armeabi-v7a',\n\t'ro.product.device' => 'ja3g',\n\t'ro.product.locale.language' => 'en',\n\t'ro.product.locale.region' => 'GB',\n\t'ro.product.manufacturer' => 'samsung',\n\t'ro.product.model' => 'GT-I9500',\n\t'ro.product.name' => 'ja3gxx',\n\t'ro.product_ship' => 'true'\n);\n\n$hd = new HandsetDetection\\HD4();\n$result = $hd->deviceDetect($buildInfo);\n$reply = $hd->getReply();\nprint_r(json_encode($reply));"}]},"params":[{"_id":"55fe0f065130171900235a8c","default":"","desc":"Authroized account holder's site id","name":"site_id","required":false,"type":"int","in":"path"},{"_id":"55fe3be4473f380d000b2690","default":"","desc":"build.prop file ro.product.brand value","name":"ro.product.brand","required":true,"type":"string","in":"body"},{"_id":"55fe3be4473f380d000b268f","default":"","desc":"build.prop file ro.product.manufacturer value","name":"ro.product.manufacturer","required":true,"type":"string","in":"body"},{"_id":"55fe3be4473f380d000b268e","default":"","desc":"build.prop file ro.product.model value","name":"ro.product.model","required":true,"type":"string","in":"body"},{"_id":"55fe3be4473f380d000b268d","required":false,"desc":"build.prop file ro.build.version.release value","default":"","type":"string","name":"ro.build.version.release","in":"body"},{"_id":"55fe3be4473f380d000b268c","required":false,"desc":"build.prop file ro.build.version.sdk value","default":"","type":"string","name":"ro.build.version.sdk","in":"body"}],"results":{"codes":[{"name":"","code":"{\n  \"hd_specs\":{\n    \"general_vendor\":\"Samsung\",\n    \"general_model\":\"GT-I9500\",\n    \"general_platform\":\"Android\",\n    \"general_platform_version\":\"4.4.2\",\n    \"general_platform_version_max\":\"\",\n    \"general_browser\":\"\",\n    \"general_browser_version\":\"\",\n    \"general_image\":\"samsunggalaxys4-1366946263-0.jpg\",\n    \"general_aliases\":[\"Samsung Galaxy S4\"],\n    \"general_eusar\":\"\",\n    \"general_battery\":[\"Li-Ion 2600 mAh\"],\n    \"general_type\":\"Mobile\",\n    \"general_cpu\":[\"Exynos 5 Octa 5410\",\"Quad Core\",\"1.6GHz\",\"ARM Cortex A15\",\"1.2GHz\",\"ARM Cortex A7\",\"PowerVR SGX544MP3\"],\n    \"design_formfactor\":\"Bar\",\n    \"design_dimensions\":\"136 x 69 x 7.9\",\n    \"design_weight\":\"130\",\n    \"design_antenna\":\"Internal\",\n    \"design_keyboard\":\"Screen\",\n    \"design_softkeys\":\"2\",\n    \"design_sidekeys\":[\"Volume\",\"Power\"],\n    \"display_type\":\"FHD Super AMOLED\",\n    \"display_color\":\"Yes\",\n    \"display_colors\":\"16M\",\n    \"display_size\":\"5\\\"\",\n    \"display_x\":\"1080\",\n    \"display_y\":\"1920\",\n    \"display_ppi\":441,\n    \"display_pixel_ratio\":\"\",\n    \"display_other\":[\"Multitouch\",\"Capacitive Touchscreen\",\"Corning Gorilla Glass 3\",\"TouchWiz UI\"],\n    \"memory_internal\":[\"16GB ROM\",\"32GB ROM\",\"64GB ROM\",\"2GB RAM\"],\n    \"memory_slot\":[\"MicroSD\",\"64GB\"],\n    \"network\":[\"GSM850\",\"GSM900\",\"GSM1800\",\"GSM1900\",\"GPRS850\",\"GPRS900\",\"GPRS1800\",\"GPRS1900\",\"EDGE850\",\"EDGE900\",\"EDGE1800\",\"EDGE1900\",\"HSPA+850\",\"HSPA+900\",\"HSPA+1900\",\"HSPA+2100\",\"HSDPA850\",\"HSDPA900\",\"HSDPA1900\",\"HSDPA2100\",\"WiFi\",\"802.11a\",\"802.11b\",\"802.11g\",\"802.11n\",\"WiFi Hotspot\",\"Bluetooth 4.0\",\"PBAP\",\"A2DP\",\"AVRCP\",\"HFP\",\"HSP\",\"OPP\",\"SAP\",\"HID\",\"PAN\",\"MAP\",\"Infrared\",\"NFC\",\"DLNA\",\"HSDPA 42.2Mbps\",\"HSUPA 5.76Mbps\",\"LTE\",\"LTE Cat 3\",\"50Mbps UL\",\"100Mbps DL\",\"GPS\",\"A-GPS\"],\n    \"media_camera\":[\"13MP\",\"3096x4128\"],\n    \"media_secondcamera\":[\"2MP\",\"1600x1200\"],\n    \"media_videocapture\":[\"Yes\",\"1080p@30fps\"],\n    \"media_videoplayback\":[\"MPEG4\",\"H.263\",\"H.264\",\"DivX\",\"DivX3.11\",\"VC-1\",\"VP8\",\"WMV7\",\"WMV8\",\"Sorenson Spark\",\"HEVC\",\"MP4\",\"XviD\",\"WMV\"],\n    \"media_audio\":[\"MP3\",\"AAC\",\"AAC+\",\"eAAC+\",\"AMR-NB\",\"AMR-WB\",\"OGG\",\"FLAC\",\"AC3\",\"apt-X\",\"WAV\"],\n    \"media_other\":[\"CMOS Sensor\",\"LED Flash\",\"AutoFocus\",\"Geotagging\",\"Face and Smile Detection\",\"Touch Focus\",\"Dual Shot\",\"Simultaneous HD Video and Image recording\",\"HDR\",\"Video Calling\"],\n    \"features\":[\"Accelerometer\",\"Geomagnetic\",\"Gyroscope Sensor\",\"RGB light\",\"Barometer\",\"Proximity Sensor\",\"Air Gesture\",\"Temperature & Humidity\",\"Hall Sensor\",\"Micro SIM\",\"Vibration\",\"Loudspeaker\",\"SMS (Threaded view)\",\"Java MIDP emulator\",\"ANT+ support\",\"S-Voice natural language commands and dictation\",\"Smart stay\",\"Smart pause\",\"Smart scroll\",\"Active noise cancellation with dedicated mic\",\"SNS integration\",\"Document Viewer\",\"Voice MEMO\",\"Predictive Text Input\",\"Ambient Light Sensor\",\"Magnetometer\",\"Qi Case\"],\n    \"connectors\":[\"MicroUSB 2.0\",\"3.5mm Audio\",\"MHL 2.0\",\"USB 2.0\",\"USB OTG\",\"TV Out\"],\n    \"benchmark_min\":0,\n    \"benchmark_max\":0,\n    \"general_app\":\"\",\n    \"general_app_version\":\"\",\n    \"general_language\":\"\",\n    \"general_app_category\":\"\"\n  },\n  \"message\":\"OK\",\n  \"status\":0\n}","language":"json","status":200},{"name":"","code":"{}","language":"json","status":400}]},"settings":"","url":"/apiv:version/device/detect/:site_id.json"},"body":"","category":"55fe0a94748eb30d008a1e3c","createdAt":"2015-09-20T01:39:41.296Z","editedParams":true,"editedParams2":true,"excerpt":"Detection using native build information from Android.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":8,"parentDoc":null,"project":"55fcad7951dbf70d00c61b3b","slug":"detect-native","sync_unique":"","title":"detect (Native - Android)","type":"post","updates":[],"user":"55fcad15b652110d00758ada","version":"55fcb261a1dbbe0d001a139a","childrenPages":[]}

postdetect (Native - Android)

Detection using native build information from Android.

site_id:
integer
Authroized account holder's site id
ro.product.brand:
required
string
build.prop file ro.product.brand value
ro.product.manufacturer:
required
string
build.prop file ro.product.manufacturer value
ro.product.model:
required
string
build.prop file ro.product.model value
ro.build.version.release:
string
build.prop file ro.build.version.release value
ro.build.version.sdk:
string
build.prop file ro.build.version.sdk value

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



{"__v":3,"_id":"5607ad268730190d00059c55","api":{"auth":"never","examples":{"codes":[{"language":"curl","code":"curl -s -u \"api-username:api-secret\" --digest -H 'Host: api.handsetdetection.com' -H \"Content-Type: application/json\" http://api.handsetdetection.com/apiv4/community/fetcharchive.json","name":""},{"language":"php","code":"$hd = new HandsetDetection\\HD4('hdconfig', true);\n$result = $hd->communityFetchArchive();"}]},"params":[],"results":{"codes":[{"language":"text","code":"Replies with a ZIP archive, around 21Mb in size. The API Kit unzips the archive into the directory defined in the api kit config file. The archive contains specs for over 25,000 devices (in json format) and the matching trees (also json) ready to use in detections."}]},"settings":"","url":"/apiv:version/community/fetcharchive.json"},"body":"[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Archive Size\",\n  \"body\": \"The zip file downloaded is about 12Mb, and contains 25,000+ devices and the device matching rules.\"\n}\n[/block]\nThis is archive fully compatible with our existing Ultimate plans and contains the following fields general_vendor, general_model, general_platform, general_platform_version, general_browser, general_browser_version, general_app, general_app_version, display_x, display_y, benchmark_min, benchmark_max.\n\nNo authentication is required.","category":"5607ad028730190d00059c54","createdAt":"2015-09-27T08:47:34.591Z","excerpt":"This is the community edition of our device database.","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"55fcad7951dbf70d00c61b3b","slug":"fetcharchive2","sync_unique":"","title":"fetcharchive","type":"get","updates":[],"user":"55fcad15b652110d00758ada","version":"55fcb261a1dbbe0d001a139a","childrenPages":[]}

getfetcharchive

This is the community edition of our device database.

[block:callout] { "type": "warning", "title": "Archive Size", "body": "The zip file downloaded is about 12Mb, and contains 25,000+ devices and the device matching rules." } [/block] This is archive fully compatible with our existing Ultimate plans and contains the following fields general_vendor, general_model, general_platform, general_platform_version, general_browser, general_browser_version, general_app, general_app_version, display_x, display_y, benchmark_min, benchmark_max. No authentication is required.

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



[block:callout] { "type": "warning", "title": "Archive Size", "body": "The zip file downloaded is about 12Mb, and contains 25,000+ devices and the device matching rules." } [/block] This is archive fully compatible with our existing Ultimate plans and contains the following fields general_vendor, general_model, general_platform, general_platform_version, general_browser, general_browser_version, general_app, general_app_version, display_x, display_y, benchmark_min, benchmark_max. No authentication is required.