{"id":15640227,"url":"https://github.com/mssola/useragent","last_synced_at":"2025-04-09T15:06:59.794Z","repository":{"id":65950340,"uuid":"603088515","full_name":"mssola/useragent","owner":"mssola","description":"HTTP User Agent parser for the Go programming language.","archived":false,"fork":false,"pushed_at":"2023-02-20T11:55:36.000Z","size":254,"stargazers_count":112,"open_issues_count":2,"forks_count":14,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-09T15:06:51.879Z","etag":null,"topics":["go","golang","user-agent","user-agent-detection","user-agent-parser","useragent"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/mssola/useragent","language":"Go","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/mssola.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-17T15:40:14.000Z","updated_at":"2025-04-09T12:57:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"817ac923-5d4c-4546-9384-fcc118ac8398","html_url":"https://github.com/mssola/useragent","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mssola%2Fuseragent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mssola%2Fuseragent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mssola%2Fuseragent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mssola%2Fuseragent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mssola","download_url":"https://codeload.github.com/mssola/useragent/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248055284,"owners_count":21040157,"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":["go","golang","user-agent","user-agent-detection","user-agent-parser","useragent"],"created_at":"2024-10-03T11:32:18.659Z","updated_at":"2025-04-09T15:06:59.767Z","avatar_url":"https://github.com/mssola.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/mssola/useragent/actions/workflows/ci.yml\" title=\"Travis CI status for the default branch\"\u003e\u003cimg src=\"https://github.com/mssola/useragent/actions/workflows/ci.yml/badge.svg\" alt=\"Build Status for the default branch\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://pkg.go.dev/github.com/mssola/useragent\" title=\"go.dev page\"\u003e\u003cimg src=\"https://pkg.go.dev/badge/github.com/mssola/useragent\" alt=\"go.dev page\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://en.wikipedia.org/wiki/MIT_License\" rel=\"nofollow\"\u003e\u003cimg alt=\"MIT\" src=\"https://img.shields.io/badge/license-MIT-blue.svg\" style=\"max-width:100%;\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\nUserAgent is a Go library that parses HTTP User Agents. As an example:\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n\n    \"github.com/mssola/useragent\"\n)\n\nfunc main() {\n    // The \"New\" function will create a new UserAgent object and it will parse\n    // the given string. If you need to parse more strings, you can re-use\n    // this object and call: ua.Parse(\"another string\")\n    ua := useragent.New(\"Mozilla/5.0 (Linux; U; Android 2.3.7; en-us; Nexus One Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1\")\n\n    fmt.Printf(\"%v\\n\", ua.Mobile())   // =\u003e true\n    fmt.Printf(\"%v\\n\", ua.Bot())      // =\u003e false\n    fmt.Printf(\"%v\\n\", ua.Mozilla())  // =\u003e \"5.0\"\n    fmt.Printf(\"%v\\n\", ua.Model())    // =\u003e \"Nexus One\"\n\n    fmt.Printf(\"%v\\n\", ua.Platform()) // =\u003e \"Linux\"\n    fmt.Printf(\"%v\\n\", ua.OS())       // =\u003e \"Android 2.3.7\"\n\n    name, version := ua.Engine()\n    fmt.Printf(\"%v\\n\", name)          // =\u003e \"AppleWebKit\"\n    fmt.Printf(\"%v\\n\", version)       // =\u003e \"533.1\"\n\n    name, version = ua.Browser()\n    fmt.Printf(\"%v\\n\", name)          // =\u003e \"Android\"\n    fmt.Printf(\"%v\\n\", version)       // =\u003e \"4.0\"\n\n    // Let's see an example with a bot.\n\n    ua.Parse(\"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)\")\n\n    fmt.Printf(\"%v\\n\", ua.Bot())      // =\u003e true\n\n    name, version = ua.Browser()\n    fmt.Printf(\"%v\\n\", name)          // =\u003e Googlebot\n    fmt.Printf(\"%v\\n\", version)       // =\u003e 2.1\n}\n```\n\nIf you want to read the full API documentation simply check\n[godoc](https://pkg.go.dev/github.com/mssola/useragent).\n\n## Installation\n\n```\ngo get -u github.com/mssola/useragent\n```\n\n## Contributing\n\nDo you want to contribute with code, or to report an issue you are facing? Read\nthe [CONTRIBUTING.md](./CONTRIBUTING.md) file.\n\n## [Changelog](https://pbs.twimg.com/media/DJDYCcLXcAA_eIo?format=jpg\u0026name=small)\n\nRead the [CHANGELOG.md](./CHANGELOG.md) file.\n\n## License\n\n```\nCopyright (c) 2012-2023 Miquel Sabaté Solà\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmssola%2Fuseragent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmssola%2Fuseragent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmssola%2Fuseragent/lists"}