{"id":15293556,"url":"https://github.com/malcommac/uaparserswift","last_synced_at":"2025-06-12T21:07:59.496Z","repository":{"id":56181814,"uuid":"108997703","full_name":"malcommac/UAParserSwift","owner":"malcommac","description":"🗺 User-Agent Parser based upon ua-parser.js","archived":false,"fork":false,"pushed_at":"2022-11-10T15:45:21.000Z","size":523,"stargazers_count":41,"open_issues_count":3,"forks_count":9,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-13T23:02:04.996Z","etag":null,"topics":["browser-detection","device-detection","kitura","os-detection","swift","useragent","useragentparser","vapor-swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/malcommac.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-31T13:13:48.000Z","updated_at":"2025-01-21T06:09:02.000Z","dependencies_parsed_at":"2022-08-15T14:10:49.686Z","dependency_job_id":null,"html_url":"https://github.com/malcommac/UAParserSwift","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/malcommac/UAParserSwift","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malcommac%2FUAParserSwift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malcommac%2FUAParserSwift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malcommac%2FUAParserSwift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malcommac%2FUAParserSwift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/malcommac","download_url":"https://codeload.github.com/malcommac/UAParserSwift/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malcommac%2FUAParserSwift/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259530189,"owners_count":22872115,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["browser-detection","device-detection","kitura","os-detection","swift","useragent","useragentparser","vapor-swift"],"created_at":"2024-09-30T16:49:57.923Z","updated_at":"2025-06-12T21:07:59.440Z","avatar_url":"https://github.com/malcommac.png","language":"Swift","funding_links":["https://opencollective.com/vapor","https://www.paypal.com/paypalme/danielemargutti/20","https://github.com/sponsors/malcommac"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\" \u003e\n  \u003cimg src=\"banner.png\" width=300px alt=\"UAParserSwift\" title=\"UAParserSwift\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\u003cstrong\u003eUser-Agent Parser based upon ua-parser.js\u003c/strong\u003e\u003c/p\u003e\n\nUAParserSwift is a Swift-based library to parse User Agent string; it's a port of [ua-parser-js](https://github.com/faisalman/ua-parser-js) by Faisal Salman created to be mainly used in Swift Server Side applications ([Kitura](http://kitura.io), [Vapor](https://opencollective.com/vapor) etc.).\nYou can however use it on client side, all Apple's platforms are supported (iOS, macOS, tvOS and watchOS).\n\nThis library aims to identify detailed type of web browser, layout engine, operating system, cpu architecture, and device type/model, entirely from user-agent string with a relatively small footprint.\n\n## ❤️ Your Support\n\n*Hi fellow developer!*  \nYou know, maintaing and developing tools consumes resources and time. While I enjoy making them **your support is foundamental to allow me continue its development**.  \n\nIf you are using SwiftLocation or any other of my creations please consider the following options:\n\n- [**Make a donation with PayPal**](https://www.paypal.com/paypalme/danielemargutti/20)\n- [**Become a Sponsor**](https://github.com/sponsors/malcommac)\n\n- [Follow Me](https://github.com/malcommac)\n\n## How it works\n\n* [Introduction](#doc)\n* [Supported Browsers](#browsers)\n* [Supported Devices](#devices)\n* [Supported Engines](#engines)\n* [Supported OSs](#oss)\n* [Supported Architectures](#architectures)\n\n* [Unit Tests](#tests)\n* [Installation](#installation)\n* [License](#license)\n\n\u003ca name=\"doc\"/\u003e\n\n## Introduction\n\nUsage of UAParserSwift is pretty simple; just allocate an `UAParser` object along with the `User-Agent` string you want to parse.\n\n```swift\nlet parser = UAParser(agent: \"Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7\")\n\n// Then call properties you want to read.\n// Parsed data are cached and evaluated lazily in order to\n// get the best performances.\n\nlet identified_os = parser.os\nlet identified_device = parser.device\nlet identified_engine = parser.engine\nlet identified_os = parser.os\nlet identified_cpu = parser.cpu\n```\n\nNow you can call one of these properties to get parsed data (all properties are lazy created in order to keep parser lightweight):\n\n* `.browser`: return a `Browser` object with the browser's properties: `name`, `version`\n* `.device`: return a `Device` object with device's informations: `vendor`,`type`,`model`\n* `.engine`: return an `Engine` object with information about browser's engine: `name`,`version`\n* `.os`: return an `OS` object with the information about host operation system: `name`,`version`\n* `.cpu`: return a `CPU` object with the informations about host's device architecture: `identifier`\n\n\u003ca name=\"browsers\"/\u003e\n\n## Supported Browsers\n\n**Name**:\n```\nAmaya, Android Browser, Arora, Avant, Baidu, Blazer, Bolt, Bowser, Camino, Chimera,\nChrome [WebView], Chromium, Comodo Dragon, Conkeror, Dillo, Dolphin, Doris, Edge,\nEpiphany, Fennec, Firebird, Firefox, Flock, GoBrowser, iCab, ICE Browser, IceApe,\nIceCat, IceDragon, Iceweasel, IE[Mobile], Iron, Jasmine, K-Meleon, Konqueror, Kindle,\nLinks, Lunascape, Lynx, Maemo, Maxthon, Midori, Minimo, MIUI Browser, [Mobile] Safari,\nMosaic, Mozilla, Netfront, Netscape, NetSurf, Nokia, OmniWeb, Opera [Mini/Mobi/Tablet],\nPhantomJS, Phoenix, Polaris, QQBrowser, RockMelt, Silk, Skyfire, SeaMonkey, Sleipnir,\nSlimBrowser, Swiftfox, Tizen, UCBrowser, Vivaldi, w3m, WeChat, Yandex\n```\n\n**Version**:\nDetermined dynamically\n\n\u003ca name=\"devices\"/\u003e\n\n## Supported Devices\n\n**Type**:\n\n```\nconsole, mobile, tablet, smarttv, wearable, embedded\n```\n\n**Vendor**:\n\n```\nAcer, Alcatel, Amazon, Apple, Archos, Asus, BenQ, BlackBerry, Dell, GeeksPhone,\nGoogle, HP, HTC, Huawei, Jolla, Lenovo, LG, Meizu, Microsoft, Motorola, Nexian,\nNintendo, Nokia, Nvidia, OnePlus, Ouya, Palm, Panasonic, Pebble, Polytron, RIM,\nSamsung, Sharp, Siemens, Sony[Ericsson], Sprint, Xbox, Xiaomi, ZTE\n```\n\n**Model**:\nDetermined dinamically\n\n\u003ca name=\"engines\"/\u003e\n\n## Supported Engines\n\n**Engine**:\n\n```\nAmaya, EdgeHTML, Gecko, iCab, KHTML, Links, Lynx, NetFront, NetSurf, Presto,\nTasman, Trident, w3m, WebKit\n```\n\n**Engine Version**:\nDetermined dinamically\n\n\u003ca name=\"oss\"/\u003e\n\n## Supported OSs\n\n**Name**:\n```\nAIX, Amiga OS, Android, Arch, Bada, BeOS, BlackBerry, CentOS, Chromium OS, Contiki,\nFedora, Firefox OS, FreeBSD, Debian, DragonFly, Gentoo, GNU, Haiku, Hurd, iOS,\nJoli, Linpus, Linux, Mac OS, Mageia, Mandriva, MeeGo, Minix, Mint, Morph OS, NetBSD,\nNintendo, OpenBSD, OpenVMS, OS/2, Palm, PC-BSD, PCLinuxOS, Plan9, Playstation, QNX, RedHat,\nRIM Tablet OS, RISC OS, Sailfish, Series40, Slackware, Solaris, SUSE, Symbian, Tizen,\nUbuntu, UNIX, VectorLinux, WebOS, Windows [Phone/Mobile], Zenwalk\n```\n\n**Version**:\nDetermined dinamically\n\n\u003ca name=\"architectures\"/\u003e\n\n## Supported Architectures\n\n**Identifier**:\n```\n68k, amd64, arm[64], avr, ia[32/64], irix[64], mips[64], pa-risc, ppc, sparc[64]\n```\n\n\u003ca name=\"tests\"/\u003e\n\n## Unit Tests\n\nUnit Tests are available under the [`Tests`](https://github.com/malcommac/UAParserSwift/tree/master/Tests) directory; actually they are the same tests available for ua-parser-js and all are passed successfully.\n\n\u003ca name=\"installation\"/\u003e\n\n## Installation\n\nThis library is written for Swift 4.x.\n\n### Swift Package Manager (Vapor or any server side framework)\n\nMeow requires Swift 4.0 or greater to work.\nThis is the official way to install packages for Swift Server Side.\nIn your Package.swift, add the following to your dependencies array:\n\n```swift\n.package(url: \"https://github.com/malcommac/UAParserSwift.git\", from: \"1.0.1\")\n```\n\nTo your target, add the \"UAParserSwift\" dependency.\n\n```swift\n.target(name: \"Application\", dependencies: [\"UAParserSwift\", ...])\n```\n\n### CocoaPods\n\n1.\tAdd the pod `UAParserSwift` to your [Podfile](http://guides.cocoapods.org/using/the-podfile.html).\n\n```ruby\npod 'UAParserSwift'\n```\nRun `pod install` from Terminal, then open your app's `.xcworkspace` file to launch Xcode.\n\n\u003ca name=\"issues\"/\u003e\n\n## Contributing\n\n- If you **need help** or you'd like to **ask a general question**, open an issue.\n- If you **found a bug**, open an issue.\n- If you **have a feature request**, open an issue.\n- If you **want to contribute**, submit a pull request.\n\n\u003ca name=\"license\"/\u003e\n\n## License\n\nDual licensed under GPLv2 \u0026 MIT\n\nCopyright © 2017 Daniele Margutti \u003chello@danielemargutti.com\u003e\nOriginal [ua-parser-js](http://faisalman.github.io/ua-parser-js) Copyright: Copyright © 2012-2016 Faisal Salman \u003cfyzlman@gmail.com\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nThis software is licensed under [MIT License](LICENSE.md).\n\n**Consider ❤️ [support the development](#support) of this library!**\n\n***Follow me on:***  \n- 💼 [Linkedin](https://www.linkedin.com/in/danielemargutti/)  \n- 🐦 [Twitter](https://twitter.com/danielemargutti)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalcommac%2Fuaparserswift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmalcommac%2Fuaparserswift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalcommac%2Fuaparserswift/lists"}