{"id":35155773,"url":"https://github.com/beam-community/ua_parser","last_synced_at":"2026-04-01T17:01:06.038Z","repository":{"id":34902765,"uuid":"73837149","full_name":"beam-community/ua_parser","owner":"beam-community","description":"UserAgentParser implementation for Elixir","archived":false,"fork":false,"pushed_at":"2026-03-09T02:44:38.000Z","size":415,"stargazers_count":50,"open_issues_count":2,"forks_count":16,"subscribers_count":14,"default_branch":"main","last_synced_at":"2026-03-27T23:42:19.569Z","etag":null,"topics":["elixir","elixir-lang","plug","user-agent","user-agent-parser"],"latest_commit_sha":null,"homepage":null,"language":"Elixir","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/beam-community.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2016-11-15T17:14:02.000Z","updated_at":"2026-03-12T21:06:07.000Z","dependencies_parsed_at":"2024-01-19T21:43:39.334Z","dependency_job_id":"95d9f7b7-1647-495c-8a66-f845d09613bb","html_url":"https://github.com/beam-community/ua_parser","commit_stats":{"total_commits":70,"total_committers":17,"mean_commits":4.117647058823529,"dds":0.5,"last_synced_commit":"49305de88eb2b6b47a6c8592f767bc957d4ffb23"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/beam-community/ua_parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beam-community%2Fua_parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beam-community%2Fua_parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beam-community%2Fua_parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beam-community%2Fua_parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beam-community","download_url":"https://codeload.github.com/beam-community/ua_parser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beam-community%2Fua_parser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31290538,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["elixir","elixir-lang","plug","user-agent","user-agent-parser"],"created_at":"2025-12-28T16:58:54.073Z","updated_at":"2026-04-01T17:01:05.963Z","avatar_url":"https://github.com/beam-community.png","language":"Elixir","readme":"# UAParser\n\n[![Continuous Integration](https://github.com/beam-community/ua_parser/actions/workflows/ci.yaml/badge.svg)](https://github.com/beam-community/ua_parser/actions/workflows/ci.yaml)\n[![Module Version](https://img.shields.io/hexpm/v/ua_parser.svg)](https://hex.pm/packages/ua_parser)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/ua_parser/)\n[![Total Download](https://img.shields.io/hexpm/dt/ua_parser.svg)](https://hex.pm/packages/ua_parser)\n[![License](https://img.shields.io/hexpm/l/ua_parser.svg)](https://github.com/beam-community/ua_parser/blob/master/LICENSE)\n[![Last Updated](https://img.shields.io/github/last-commit/beam-community/ua_parser.svg)](https://github.com/beam-community/ua_parser/commits/master)\n\nA simple, fast user-agent parsing library based on [BrowserScope's](https://ua-profiler.appspot.com/) UA database with a good default dictionary.\n\n## Installation\n\nAdd `:ua_parser` to your `mix.exs` dependencies:\n\n```elixir\ndef deps do\n  [\n    {:ua_parser, \"~\u003e 1.8\"}\n  ]\nend\n```\n\n## Usage\n\n```elixir\niex\u003e ua = UAParser.parse(\"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; en-us) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Safari/530.17 Skyfire/2.0\")\n%UAParser.UA{\n  device: %UAParser.Device{family: nil},\n  family: \"Skyfire\",\n  os: %UAParser.OperatingSystem{\n    family: \"Mac OS X\",\n    version: %UAParser.Version{major: \"10\", minor: \"5\", patch: \"7\", patch_minor: nil}\n  },\n  version: %UAParser.Version{major: \"2\", minor: \"0\", patch: nil, patch_minor: nil}\n}\niex\u003e to_string(ua)\n\"Skyfire 2.0\"\niex\u003e to_string(ua.os)\n\"Mac OS X 10.5.7\"\niex\u003e to_string(ua.device)\n\"Other\"\n```\n\nRetrieving and parsing a user-agent string from Plug:\n\n```elixir\nua =\n  conn\n  |\u003e Plug.Conn.get_req_header(\"user-agent\")\n  |\u003e List.first()\n  |\u003e UAParser.parse()\n```\n\n## Example\n\nThere is an example Phoenix application with a simple endpoint/route to retrieve the user agent header.\nTo run it, simply cd into the `example` directory, and run the following:\n\n### Phoenix\n\n```shell\n$ mix do deps.get, compile\n$ npm i \u0026\u0026 brunch build\n# change the configuration to match your own postgres username/password\n$ mix do ecto.create, ecto.migrate\n$ iex -S mix phoenix.server\n# visit localhost:4000/user_agent\n```\n\n### Plug\n\nIt can also be used as a simple plug:\n\n```shell\nmix new ua_plug\ncd ua_plug\n```\n\nAnd now set up `mix.exs`:\n\n```elixir\n# ...\ndefp deps do\n  [\n   {:cowboy, \"~\u003e 1.0.0\"},\n   {:plug, \"~\u003e 1.0\"},\n   {:ua_parser, git: \"https://github.com/beam-community/ua_parser.git\",\n                branch: \"master\"},\n  ]\nend\n# ...\n```\n\nAnd we get our deps and compile:\n\n```shell\nmix do deps.get, compile\n```\n\nAnd now we can make our plug:\n\n```elixir\ndefmodule UAPlug do\n  import Plug.Conn\n\n  def init(options), do: options\n\n  def call(conn, _opts) do\n    ua =\n      conn\n         |\u003e Plug.Conn.get_req_header(\"user-agent\")\n         |\u003e List.first()\n         |\u003e UAParser.parse()\n    send_resp(200, ua)\n  end\nend\n```\n\nFrom here we can pipe requests through it in other applications or use it on its own as we please.\n\n## Copyright and License\n\nCopyright (c) 2016 Sean Callan\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeam-community%2Fua_parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeam-community%2Fua_parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeam-community%2Fua_parser/lists"}