{"id":15058857,"url":"https://github.com/waseigo/ex_nominatim","last_synced_at":"2025-04-10T13:13:21.321Z","repository":{"id":250031861,"uuid":"833332850","full_name":"waseigo/ex_nominatim","owner":"waseigo","description":"A full-featured client for the OpenStreetMap Nominatim API V1, with extensive request validation, robust error-handling and reporting, and user guidance with helpful validation messages.","archived":false,"fork":false,"pushed_at":"2025-04-09T15:25:32.000Z","size":75,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T15:43:01.643Z","etag":null,"topics":["elixir","nominatim-api","openstreetmap"],"latest_commit_sha":null,"homepage":"https://overbring.com/software/ex_nominatim/","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/waseigo.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-24T20:33:26.000Z","updated_at":"2025-04-09T15:25:36.000Z","dependencies_parsed_at":"2024-08-20T00:12:59.816Z","dependency_job_id":"c5af8b94-5e88-4fe7-9c4f-89b660f8e275","html_url":"https://github.com/waseigo/ex_nominatim","commit_stats":null,"previous_names":["waseigo/ex_nominatim"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waseigo%2Fex_nominatim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waseigo%2Fex_nominatim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waseigo%2Fex_nominatim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waseigo%2Fex_nominatim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/waseigo","download_url":"https://codeload.github.com/waseigo/ex_nominatim/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248064615,"owners_count":21041860,"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":["elixir","nominatim-api","openstreetmap"],"created_at":"2024-09-24T22:31:49.202Z","updated_at":"2025-04-10T13:13:20.968Z","avatar_url":"https://github.com/waseigo.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- \u003cimg src=\"./etc/assets/ex_nominatim_logo.png\" height=\"100\"\u003e --\u003e\n\n# ExNominatim\n\n**ExNominatim** is a full-featured client for the [OpenStreetMap](https://www.openstreetmap.org) [Nominatim API V1](https://nominatim.org/release-docs/latest/api/Overview/), with extensive request validation, robust error-handling and reporting, and user guidance with helpful validation messages.\n\n## Goals\n\n- Prevent unnecessary calls to the Nominatim API server by validating intended requests and preventing them if the request parameters are invalid.\n- Solid error-handling for robustness in production.\n- Provide helpful validation messages to the user when a request is deemed invalid.\n\n## Features\n\n- Covers the `/search`, `/reverse`, `/lookup`, `/status` and `/details` endpoints.\n- Utilizes request parameter structs with the appropriate fields (except for `json_callback`) for each endpoint.\n- Configurable for your application with overridable defaults using Elixir's `Config` module to set any default values, including the `:base_url` option for use with self-hosted Nominatim API instances.\n- Validates parameter values prior to the request (possible to override this with the `force: true` option).\n- Provides helpful return tuples `{:ok, ...}`, `{:error, reason}` and `{:error, {specific_error, other_info}}` across the board.\n- Collects all detected field validation errors in an `:errors` field, and provides a `:valid?` field in each request params struct.\n- Automatically sets the `User-Agent` header to \"ExNominatim/{version}\" to comply with the [Nominatim Usage Policy](https://operations.osmfoundation.org/policies/nominatim/).\n\n## Installation\n\nThe package can be installed [from Hex](https://hex.pm/package/ex_nominatim) by adding `ex_nominatim` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:ex_nominatim, \"~\u003e 1.1.3\"}\n  ]\nend\n```\n\nThe code can be found on [Github/waseigo/ex_nominatim](https://github.com/waseigo/ex_nominatim).\n\nDocumentation has been published on [HexDocs](https://hexdocs.pm/ex_nominatim).\n\nThere is also a thread open on the Elixir Programming Language Forum: [ExNominatim - A full-featured client for the OpenStreetMap Nominatim API V1](https://elixirforum.com/t/exnominatim-a-full-featured-client-for-the-openstreetmap-nominatim-api-v1/65120/1).\n\n## Usage\n\nBy calling the endpoint functions of the `ExNominatim` module you will be hitting the public Nominatim API server with each endpoint's default options as described in the API documentation; i.e., all requests use \u003chttps://nominatim.openstreetmap.org\u003e as the value of `:base_url` in `opts` and the default parameters for each endpoint are handled by the API according to its documentation.\n\n**Please respect the [Nominatim Usage Policy](https://operations.osmfoundation.org/policies/nominatim/) when using the public server.**\n\n## Optional configuration and default parameters\n\nIn the more likely scenario where you use ExNominatim in your own application (e.g., in a Phoenix application) called `MyApp`, you can override all defaults across all endpoints and then even for each endpoint through your application's configuration, e.g. in the `config/config.exs` file of a Phoenix app. For example:\n\n```elixir\nconfig :my_app, MyApp.ExNominatim,\n  all: [\n    base_url: \"http://localhost:8080\",\n    force: true,\n    format: \"json\",\n    process: true,\n    atomize: true\n  ],\n  search: [format: \"geocodejson\", force: false],\n  reverse: [namedetails: 1],\n  lookup: [],\n  details: [],\n  status: [format: \"json\"]\n```\n\nThe configuration above has the following effects:\n\n- Requests to all endpoints will use the self-hosted Nominatim API instance at port 8080 of `localhost`, accessible over HTTP.\n- Request parameter validation errors (`valid?: false` in the request parameters struct) will be ignored for requests to all endpoints, except for requests to the `/search` endpoint.\n- Unless requested otherwise in `opts`, requests to the `/search` endpoint will return data in GeocodeJSON format (instead of the default `jsonv2`).\n- Requests to the `/reverse` endpoint will set `:namedetails` to 1 (unless otherwise set in `opts`).\n- Requests to the `/status` endpoint will return JSON instead of the [default text](https://nominatim.org/release-docs/develop/api/Status/#output) (HTTP status code 200 and text `OK` or HTTP status 500 and a detailed error mesage).\n- The responses from all endpoints will be processed automatically using `ExNominatim.Report.process/1`, and any maps and contents thereof (or map contents of structs's keys) will be converted from bitstring keys to atom keys using `ExNominatim.Report.atomize/1`.\n\nRefer to [the documentation of the main `ExNominatim` module](https://hexdocs.pm/ex_nominatim/ExNominatim.html) for more information.\n\n## Ideas and someday/maybe features\n\n- Build [Cachex](https://hexdocs.pm/cachex/Cachex.html) in (see [Reactive Warming](https://hexdocs.pm/cachex/reactive-warming.html)) and provide the option to automatically throttle requests to the public API to the \"absolute maximum of 1 request per second\" as requested by the [Nominatim Usage Policy](https://operations.osmfoundation.org/policies/nominatim/).\n- Implement a test suite.\n\n## Who made this?\n\nCopyright 2024, made by [Isaak Tsalicoglou](https://linkedin.com/in/tisaak), [OVERBRING](https://overbring.com) in [Athens](https://www.openstreetmap.org/#map=11/37.9909/23.7387), [Attica](https://www.openstreetmap.org/#map=8/37.061/23.456), [Greece](https://www.openstreetmap.org/#map=6/38.310/24.489).\n\nMany thanks to all the volunteers and contributors of [OpenStreetMap](https://www.openstreetmap.org/) and [Nominatim](https://nominatim.org/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaseigo%2Fex_nominatim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwaseigo%2Fex_nominatim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaseigo%2Fex_nominatim/lists"}