1<!DOCTYPE html> <html lang="en" class="h-full"><head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Docs | APIC Agent</title> <meta name="generator" content="Jekyll v4.3.1"/> <meta property="og:title" content="Docs"/> <meta property="og:locale" content="en_US"/> <meta name="description" content="Free REST API to detect browser, OS, device from user agent string. Use APIC Agentâs easy to use API and avoid hard to maintain user-agent parsing libraries."/> <meta property="og:description" content="Free REST API to detect browser, OS, device from user agent string. Use APIC Agentâs easy to use API and avoid hard to maintain user-agent parsing libraries."/> <link rel="canonical" href="https://www.apicagent.com/docs"/> <meta property="og:url" content="https://www.apicagent.com/docs"/> <meta property="og:site_name" content="APIC Agent"/> <meta property="og:image" content="https://soopr.xyz/images/card?url=https://www.apicagent.com/docs"/> <meta property="og:type" content="article"/> <meta property="article:published_time" content="2022-12-22T19:19:21+00:00"/> <meta name="twitter:card" content="summary_large_image"/> <meta property="og:image" content="https://soopr.xyz/images/card?url=https://www.apicagent.com/docs"/> <meta property="twitter:title" content="Docs"/> <meta name="twitter:site" content="@abhinav"/> <meta name="twitter:creator" content="@abhinav"/>
1<script type="application/ld+json"> {"@type":"BlogPosting","publisher":{"@type":"Organization","logo":{"@type":"ImageObject","url":"https://www.apicagent.com/assets/img/logo.png"}},"description":"Free REST API to detect browser, OS, device from user agent string. Use APIC Agentâs easy to use API and avoid hard to maintain user-agent parsing libraries.","url":"https://www.apicagent.com/docs","headline":"Docs","dateModified":"2022-12-22T19:19:21+00:00","datePublished":"2022-12-22T19:19:21+00:00","mainEntityOfPage":{"@type":"WebPage","@id":"https://www.apicagent.com/docs"},"@context":"https://schema.org"}</script>
1
1<script async defer data-soopr-token="pt_34c30664343b78fd1211283aa84cf7ac" src="https://sdk.soopr.co/soopr.js"></script>
1
1<script src="https://cdn.jsdelivr.net/gh/alpinejs/[email protected]/dist/alpine.min.js" defer></script>
1 <link rel="stylesheet" href="/assets/css/style.css"> <link rel="stylesheet" href="/assets/vendor/@fortawesome/fontawesome-free/css/all.min.css"/> <link rel="preconnect" href="https://fonts.gstatic.com"> <link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;700&family=DM+Mono:wght@400;700&display=swap" rel="stylesheet"><link type="application/atom+xml" rel="alternate" href="https://www.apicagent.com/feed.xml" title="APIC Agent"/><meta name="keywords" content="free user agent api, user agent api, parse user agent api, detect device, detect browser, detect os"/> <link rel="apple-touch-icon" sizes="76x76" href="/assets/img/favicons/apple-touch-icon.png"> <link rel="icon" type="image/png" sizes="32x32" href="/assets/img/favicons/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="16x16" href="/assets/img/favicons/favicon-16x16.png"> <link rel="manifest" href="/assets/img/favicons/site.webmanifest"> <link rel="mask-icon" href="/assets/img/favicons/safari-pinned-tab.svg" color="#5bbad5"> <link rel="shortcut icon" href="/assets/img/favicons/favicon.ico"> <meta name="msapplication-TileColor" content="#da532c"> <meta name="msapplication-config" content="/assets/img/favicons/browserconfig.xml"> <meta name="theme-color" content="#ffffff"> </head> <body class="h-full bg-gray-900 max-w-screen-lg mx-auto font-body"><header class="text-gray-400 bg-gray-900 font-body max-w-screen-lg mx-auto"> <div class="container mx-auto flex flex-wrap p-5 flex-col md:flex-row items-center"> <a href="/" class="flex title-font font-medium items-center text-white mb-4 md:mb-0"> <svg class="w-12 h-12 text-white-DIS p-2 bg-indigo-500-DIS rounded-full" viewBox="0 0 300 300" fill="none" xmlns="http://www.w3.org/2000/svg"> <circle cx="150" cy="150" r="150" fill="#1F242A"/> <path d="M151.32 47.9961C177.023 47.9961 196.301 53.7383 209.152 65.2227C222.004 76.707 228.43 93.7285 228.43 116.287V197.908C228.43 208.709 232.941 214.109 241.965 214.109H249.143C253.791 214.109 257.072 215.203 258.986 217.391C261.037 219.441 262.062 222.996 262.062 228.055C262.062 233.113 261.037 236.736 258.986 238.924C257.072 240.975 253.791 242 249.143 242H236.018C227.131 242 219.475 239.812 213.049 235.438C206.76 230.926 202.658 224.363 200.744 215.75C189.533 225.594 177.365 233.182 164.24 238.514C151.252 243.846 137.443 246.512 122.814 246.512C109.006 246.512 96.7695 244.188 86.1055 239.539C75.5781 234.754 67.3066 227.85 61.291 218.826C55.2754 209.803 52.2676 199.07 52.2676 186.629C52.2676 165.027 59.9922 149.1 75.4414 138.846C90.8906 128.455 110.852 123.26 135.324 123.26C157.062 123.26 177.844 126.746 197.668 133.719V116.287C197.668 103.025 193.908 93.3184 186.389 87.166C179.006 80.877 167.043 77.7324 150.5 77.7324C140.246 77.7324 129.582 79.168 118.508 82.0391C107.434 84.9102 96.9062 88.875 86.9258 93.9336C84.6016 95.1641 82.4824 95.7793 80.5684 95.7793C76.0566 95.7793 72.2969 92.498 69.2891 85.9355C67.7852 82.6543 67.0332 79.9199 67.0332 77.7324C67.0332 72.9473 69.5625 69.2559 74.6211 66.6582C86.1055 60.6426 98.4102 56.0625 111.535 52.918C124.797 49.6367 138.059 47.9961 151.32 47.9961ZM135.529 152.176C119.807 152.176 107.365 154.91 98.2051 160.379C89.1816 165.711 84.6699 174.256 84.6699 186.014C84.6699 195.994 88.0879 203.787 94.9238 209.393C101.896 214.861 111.604 217.596 124.045 217.596C151.252 217.596 175.793 206.316 197.668 183.758V161.404C188.371 158.396 178.391 156.141 167.727 154.637C157.062 152.996 146.33 152.176 135.529 152.176Z" fill="white"/> </svg> <span class="ml-1 text-xl">apicagent</span> </a> <nav class="md:ml-auto flex flex-wrap items-center text-base justify-center"> <a class="mr-5 hover:text-white" href="/docs">docs</a> <a class="mr-5 hover:text-white" href="/#features">features</a>
1 <a href="/#api-details" class="mr-5 inline-flex font-bold lowercase items-center bg-gray-800 border-0 py-1 px-3 focus:outline-none hover:bg-gray-700 rounded text-base mt-4 md:mt-0">Get Started, it's free <svg fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="w-4 h-4 ml-1" viewBox="0 0 24 24"> <path d="M5 12h14M12 5l7 7-7 7"></path> </svg> </a> <a class="mt-4 md:mt-auto" href="https://www.producthunt.com/posts/apic-agent?utm_source=badge-featured&utm_medium=badge&utm_souce=badge-apic-agent" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=345306&theme=dark" alt="APIC Agent - Free API to detect browser, OS, and device from user-agent | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54"/></a> </nav> </div> <div class="container border-t-2 border-gray-700 text-gray-500 container max-w-screen-lg mx-auto"></div> </header> <div> <div class="text-gray-800 antialiased"> <section id="api-details" class="text-gray-400 bg-gray-900 body-font"> <div class="text-center mt-12"> <h1 class="sm:text-3xl text-2xl font-bold text-center title-font text-white mb-4"> Documentation</h1> <p class="text-base leading-relaxed xl:w-2/4 lg:w-3/4 mx-auto"> Using apicagent's API is very easy. We provide <code>GET</code> or <code>POST</code> variants of the same API - choose as per your preference, send your user-agent string as input and you get the response that you can use in your application. </p> </div> <div class="container px-5 py-12 mx-auto flex flex-wrap"> <div class="flex flex-wrap -m-4"> <div class="p-4 lg:w-1/2 md:w-full"> <div class="flex border-2 rounded-lg border-gray-800 p-8 sm:flex-row flex-col"> <div class="w-16 h-16 sm:mr-8 sm:mb-0 mb-4 inline-flex items-center justify-center rounded-full bg-gray-800 text-indigo-400 flex-shrink-0"> <i class="fa-chess-rook fas text-indigo-300 text-4xl"></i> </div> <div class="flex-grow"> <h2 class="text-white text-lg title-font font-medium mb-3"><code>GET https://api.apicagent.com</code> </h2> <p class="leading-relaxed text-base">Simple and easy to get started with, works in browser too. If you prefer GET APIs, use this.</p> <a class="mt-3 text-indigo-400 inline-flex items-center" href="docs#get-api">Learn More <svg fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="w-4 h-4 ml-2" viewBox="0 0 24 24"> <path d="M5 12h14M12 5l7 7-7 7"></path> </svg> </a> </div> </div> </div> <div class="p-4 lg:w-1/2 md:w-full"> <div class="flex border-2 rounded-lg border-gray-800 p-8 sm:flex-row flex-col"> <div class="w-16 h-16 sm:mr-8 sm:mb-0 mb-4 inline-flex items-center justify-center rounded-full bg-gray-800 text-indigo-400 flex-shrink-0"> <i class="fa-chess-knight fas text-indigo-300 text-4xl"></i> </div> <div class="flex-grow"> <h2 class="text-white text-lg title-font font-medium mb-3"><code>POST https://api.apicagent.com</code> </h2> <p class="leading-relaxed text-base">This works exactly like the GET API, except user-agent string is sent inside a JSON object.</p> <a class="mt-3 text-indigo-400 inline-flex items-center" href="/docs#post-api">Learn More <svg fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="w-4 h-4 ml-2" viewBox="0 0 24 24"> <path d="M5 12h14M12 5l7 7-7 7"></path> </svg> </a> </div> </div> </div> </div> </div> </section> <section id="get-api" class="text-gray-400 bg-gray-900 body-font"> <div class="container px-5 py-12 mx-auto"> <div class="text-center mb-8"> <h1 class="sm:text-3xl text-2xl font-medium text-center title-font text-white mb-4">GET API</h1> <p class="text-base leading-relaxed xl:w-2/4 lg:w-3/4 mx-auto"><code>GET https://api.apicagent.com</code></p> </div> <div class="sm:mx-auto w-full sm:mb-2 -mx-2"> <p class="xl:w-2/4 lg:w-3/4 mx-auto text-center"> This API is the simplest way to get started with apicagent's user-agent parsing API. It accepts user agent string in <code>ua</code> parameter and returns the JSON object with parsed data. </p> <div class="lg:w-3/4 w-full mx-auto"> <div class="bg-gray-700 shadow-md rounded my-6"> <table class="text-left w-full table-auto border-collapse-DIS"> <thead> <tr> <th class="py-4 px-6 bg-grey-lightest font-bold uppercase text-grey-dark border border-gray-500">API </th> <th class="py-4 px-6 bg-grey-lightest text-sm text-grey-dark border border-gray-500 break-all"> <code>GET https://api.apicagent.com</code></th> </tr> </thead> <tbody> <tr class="hover:bg-grey-lighter"> <td class="font-bold uppercase py-4 px-6 border border-gray-500">Input Parameter</td> <td class="py-4 px-6 border border-gray-500 break-all"> <code>ua</code> - user agent string in url encoded format </td> </tr> <tr class="hover:bg-grey-lighter"> <td class="font-bold uppercase py-4 px-6 border border-gray-500">Example Request</td> <td class="py-4 px-6 border border-gray-500 break-all"> <code class="text-sm"> curl https://api.apicagent.com/?ua=Mozilla/5.0%20(Macintosh;
1%20Intel%20Mac%20OS%20X%2010_15_5)%20AppleWebKit/537.36%20(KHTML,%20like%20Gecko)%20Chrome/89.0.4389.114%20Safari/537.36</code> </td> </tr> <tr class="hover:bg-grey-lighter"> <td class="font-bold uppercase py-4 px-6 border border-gray-500">Example Output</td> <td class="py-4 px-6 border border-gray-500 break-all"><pre><code class="text-sm"> 2{ 3 "browser_family": "Chrome", 4 "client": { 5 "engine": "Blink", 6 "engine_version": "unknown", 7 "name": "Chrome", 8 "type": "browser", 9 "version": "89.0.4389.114" 10 }, 11 "device": { 12 "brand": "Apple", 13 "model": "unknown", 14 "type": "desktop" 15 }, 16 "os": { 17 "name": "Mac", 18 "platform": "unknown", 19 "version": "10.15.5" 20 }, 21 "os_family": "Mac" 22} 23 </code></pre></td> </tr> </tbody> </table> </div> </div> </div> </div> </section> <section id="post-api" class="text-gray-400 bg-gray-900 body-font"> <div class="container px-5 py-12 mx-auto"> <div class="text-center mb-8"> <h1 class="sm:text-3xl text-2xl font-medium text-center title-font text-white mb-4">POST API</h1> <p class="text-base leading-relaxed xl:w-2/4 lg:w-3/4 mx-auto"><code>POST https://api.apicagent.com</code></p> </div> <div class="sm:mx-auto w-full sm:mb-2 -mx-2"> <p class="xl:w-2/4 lg:w-3/4 mx-auto text-center"> If you prefer working with POST APIs, you can use this API - it works very similar to GET API, and accepts user agent string in <code>ua</code> key in the input JSON and returns the JSON object with parsed data. </p> <div class="lg:w-3/4 w-full mx-auto"> <div class="bg-gray-700 shadow-md rounded my-6"> <table class="text-left w-full table-auto border-collapse-DIS"> <thead> <tr> <th class="py-4 px-6 bg-grey-lightest font-bold uppercase text-grey-dark border border-gray-500">API </th> <th class="py-4 px-6 bg-grey-lightest text-sm text-grey-dark border border-gray-500 break-all"> <code>POST https://api.apicagent.com</code></th> </tr> </thead> <tbody> <tr class="hover:bg-grey-lighter"> <td class="font-bold uppercase py-4 px-6 border border-gray-500">Input Parameter</td> <td class="py-4 px-6 border border-gray-500 break-all"> A JSON object with user agent string in <code>ua</code> key </td> </tr> <tr class="hover:bg-grey-lighter"> <td class="font-bold uppercase py-4 px-6 border border-gray-500">Input Header</td> <td class="py-4 px-6 border border-gray-500 break-all"> This API requires you set <code>content-type</code> header's value as <code>application/json</code> </td> </tr> <tr class="hover:bg-grey-lighter"> <td class="font-bold uppercase py-4 px-6 border border-gray-500">Example Request</td> <td class="py-4 px-6 border border-gray-500 break-all"> <code class="text-sm"> curl -X POST https://api.apicagent.com -H "Content-Type: application/json" -d '{"ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36"}'</code> </td> </tr> <tr class="hover:bg-grey-lighter"> <td class="font-bold uppercase py-4 px-6 border border-gray-500">Example Output</td> <td class="py-4 px-6 border border-gray-500 break-all"><pre><code class="text-sm"> 24{ 25 "browser_family": "Chrome", 26 "client": { 27 "engine": "Blink", 28 "engine_version": "unknown", 29 "name": "Chrome", 30 "type": "browser", 31 "version": "89.0.4389.114" 32 }, 33 "device": { 34 "brand": "Apple", 35 "model": "unknown", 36 "type": "desktop" 37 }, 38 "os": { 39 "name": "Mac", 40 "platform": "unknown", 41 "version": "10.15.5" 42 }, 43 "os_family": "Mac" 44} 45 </code></pre></td> </tr> </tbody> </table> </div> </div> </div> </div> </section> </div> </div> <div class="container border-t-2 border-gray-700 text-gray-500 container max-w-screen-lg mx-auto"></div> <footer class="text-gray-400 bg-gray-900 body-font"> <div class="container px-5 py-6 mx-auto"> <div class="flex flex-wrap md:text-left text-center order-first"> <div class="lg:w-1/4 sm:w-1/2 px-4"> <h2 class="title-font font-medium text-white tracking-widest text-sm mb-3">APICAGENT</h2> <ul class="list-none mb-10"> <li> <a class="text-gray-400 font-semibold-DIS hover:text-white" href="/about">About Us</a> </li> <li> <a class="text-gray-400 font-semibold-DIS hover:text-white" href="/blog">Blog</a> </li> <li> <a class="text-gray-400 font-semibold-DIS hover:text-white" href="/docs">Docs</a> </li> <li> <a class="text-gray-400 font-semibold-DIS hover:text-white" href="/terms">Terms</a> </li> <li> <a class="text-gray-400 font-semibold-DIS hover:text-white" href="/privacy-policy">Privacy Policy</a> </li> <li> <a class="text-gray-400 font-semibold-DIS hover:text-white" href="/waitlist">Mailing List</a> </li> <li> <a class="text-gray-400 font-semibold-DIS hover:text-white" href="/b">Misc Posts</a> </li> </ul> </ul> </div> <div class="lg:w-1/4 sm:w-1/2 px-4"> <h2 class="title-font font-medium text-white tracking-widest text-sm mb-3">CREDITS</h2> <ul class="list-none mb-10"> <li> <a class="hover:text-white font-semibold-DIS" href="https://github.com/matomo-org/device-detector" target="_blank" rel="noreferrer">Device Detector</a> </li> <li> <a class="hover:text-white font-semibold-DIS" href="https://fontawesome.com/" target="_blank" rel="noreferrer">Font Awesome</a> </li> <li> <a class="hover:text-white font-semibold-DIS" href="https://tailblocks.cc/" target="_blank" rel="noreferrer">Tailblocks</a> </li> <li> <a class="hover:text-white font-semibold-DIS" href="https://github.com/abhinavs/cookie" target="_blank" rel="noreferrer">Cookie</a> </li> <li> <a class="hover:text-white font-semibold-DIS" href="https://www.soopr.co" target="_blank">Soopr</a> </li> <li> <a class="hover:text-white font-semibold-DIS" href="https://fonts.google.com/specimen/DM+Sans" target="_blank" rel="noreferrer">DM Sans Font</a> </li> </ul> </div> <div class="lg:w-2/4 md:w-1/2 w-full px-4"> <h2 class="title-font font-medium text-white tracking-widest text-sm mb-3">SUBSCRIBE</h2> <div class="flex xl:flex-nowrap md:flex-nowrap lg:flex-wrap flex-wrap justify-center items-end md:justify-start"> <form action="https://tinyletter.com/soopr" method="post" id="mc-embedded-subscribe-form" target="popupwindow" onsubmit="window.open('https://tinyletter.com/soopr', 'popupwindow', 'scrollbars=yes,width=800,height=600');return true" novalidate=""> <div class="relative w-40 sm:w-auto xl:mr-4 lg:mr-0 sm:mr-4 mr-2"> <label for="tlemail" class="leading-7 text-sm text-gray-400">We will keep you posted about new API launches and enhancements</label> <input type="email" id="tlemail" name="email" placeholder="[email protected]" class="w-full bg-gray-800 rounded border bg-opacity-40 border-gray-700 focus:bg-transparent focus:ring-2 focus:ring-indigo-900 focus:border-indigo-500 text-base outline-none text-gray-100 py-1 px-3 leading-8 transition-colors duration-200 ease-in-out"> </div> <div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="hidden" tabindex="-1" value="1" name="embed"></div> <input type="submit" value="subscribe â" name="subscribe" class="mt-4 flex-shrink-0 inline-flex text-white bg-indigo-500 border-0 py-2 px-6 focus:outline-none hover:bg-indigo-600 rounded"/> </form> </div> <p class="text-gray-500 text-sm mt-2 md:text-left text-center">Sponsored by <a class="hover:text-white font-semibold text-gray-300" href="https://www.soopr.co" target="_blank" rel="noreferrer">Soopr</a>. <br class="lg:block hidden">
45We promise to not spam you. </p> </div> </div> </div> <div class="flex flex-wrap items-center my-4 md:justify-between justify-center"> <div class="w-full px-4 mx-auto text-center"> <div class="text-sm text-gray-600"> Powered by <a class="hover:text-indigo-600 font-bold" href="https://www.soopr.co" target="_blank" rel="noreferrer">Soopr</a> ⢠Site bootstrapped using <a class="hover:text-indigo-600 font-bold" href="https://github.com/abhinavs/cookie" target="_blank" rel="noreferrer">Cookie</a> </div> </div> </div> <div class="bg-gray-800 my-4 bg-opacity-75"> <div class="container px-5 py-4 mx-auto flex items-center sm:flex-row flex-col"> <a href="/" class="flex title-font font-medium items-center md:justify-start justify-center text-white"> <svg class="w-12 h-12 text-white-DIS p-2 bg-indigo-500-DIS rounded-full" viewBox="0 0 300 300" fill="none" xmlns="http://www.w3.org/2000/svg"> <circle cx="150" cy="150" r="150" fill="#1F242A"/> <path d="M151.32 47.9961C177.023 47.9961 196.301 53.7383 209.152 65.2227C222.004 76.707 228.43 93.7285 228.43 116.287V197.908C228.43 208.709 232.941 214.109 241.965 214.109H249.143C253.791 214.109 257.072 215.203 258.986 217.391C261.037 219.441 262.062 222.996 262.062 228.055C262.062 233.113 261.037 236.736 258.986 238.924C257.072 240.975 253.791 242 249.143 242H236.018C227.131 242 219.475 239.812 213.049 235.438C206.76 230.926 202.658 224.363 200.744 215.75C189.533 225.594 177.365 233.182 164.24 238.514C151.252 243.846 137.443 246.512 122.814 246.512C109.006 246.512 96.7695 244.188 86.1055 239.539C75.5781 234.754 67.3066 227.85 61.291 218.826C55.2754 209.803 52.2676 199.07 52.2676 186.629C52.2676 165.027 59.9922 149.1 75.4414 138.846C90.8906 128.455 110.852 123.26 135.324 123.26C157.062 123.26 177.844 126.746 197.668 133.719V116.287C197.668 103.025 193.908 93.3184 186.389 87.166C179.006 80.877 167.043 77.7324 150.5 77.7324C140.246 77.7324 129.582 79.168 118.508 82.0391C107.434 84.9102 96.9062 88.875 86.9258 93.9336C84.6016 95.1641 82.4824 95.7793 80.5684 95.7793C76.0566 95.7793 72.2969 92.498 69.2891 85.9355C67.7852 82.6543 67.0332 79.9199 67.0332 77.7324C67.0332 72.9473 69.5625 69.2559 74.6211 66.6582C86.1055 60.6426 98.4102 56.0625 111.535 52.918C124.797 49.6367 138.059 47.9961 151.32 47.9961ZM135.529 152.176C119.807 152.176 107.365 154.91 98.2051 160.379C89.1816 165.711 84.6699 174.256 84.6699 186.014C84.6699 195.994 88.0879 203.787 94.9238 209.393C101.896 214.861 111.604 217.596 124.045 217.596C151.252 217.596 175.793 206.316 197.668 183.758V161.404C188.371 158.396 178.391 156.141 167.727 154.637C157.062 152.996 146.33 152.176 135.529 152.176Z" fill="white"/> </svg> <span class="ml-3 text-xl">apicagent</span> </a> <p class="text-sm text-gray-400 sm:ml-6 sm:mt-0 mt-4">© 2022 APIC Labs </p> <div class="soopr-btn inline-flex sm:ml-auto sm:mt-0 mt-4 justify-center sm:justify-start"> </div> </div> </div> </footer> </body> </html>
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.