{"id":18656178,"url":"https://github.com/vikramtiwari/reverse-geocode","last_synced_at":"2025-04-11T17:32:10.413Z","repository":{"id":40827620,"uuid":"59530040","full_name":"VikramTiwari/reverse-geocode","owner":"VikramTiwari","description":"get reverse-geocoded :earth_americas: data from latitude and longitude values :globe_with_meridians:","archived":false,"fork":false,"pushed_at":"2023-01-06T01:38:54.000Z","size":2103,"stargazers_count":19,"open_issues_count":14,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-25T16:51:30.139Z","etag":null,"topics":["geo","geocode","latitude","longitude","reverse-geocoding"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/VikramTiwari.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"VikramTiwari"}},"created_at":"2016-05-24T01:22:26.000Z","updated_at":"2024-09-28T00:29:37.000Z","dependencies_parsed_at":"2023-02-05T01:45:57.424Z","dependency_job_id":null,"html_url":"https://github.com/VikramTiwari/reverse-geocode","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VikramTiwari%2Freverse-geocode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VikramTiwari%2Freverse-geocode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VikramTiwari%2Freverse-geocode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VikramTiwari%2Freverse-geocode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VikramTiwari","download_url":"https://codeload.github.com/VikramTiwari/reverse-geocode/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248449893,"owners_count":21105582,"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":["geo","geocode","latitude","longitude","reverse-geocoding"],"created_at":"2024-11-07T07:22:17.535Z","updated_at":"2025-04-11T17:32:09.017Z","avatar_url":"https://github.com/VikramTiwari.png","language":"JavaScript","funding_links":["https://github.com/sponsors/VikramTiwari"],"categories":[],"sub_categories":[],"readme":"# reverse-geocode\n\nget reverse-geocoded data for latitude and longitude values\n\n![Build Status](https://github.com/VikramTiwari/reverse-geocode/workflows/Build%20Status/badge.svg) [![NPM Version](https://img.shields.io/npm/v/reverse-geocode.svg)](https://www.npmjs.com/package/reverse-geocode) [![NPM Download](https://img.shields.io/npm/dm/reverse-geocode.svg)](https://www.npmjs.com/package/reverse-geocode)\n\n## Features\n\n- Zero dependencies\n- Quick city level lookups\n- Only US, Canada and Australia dataset as of now, more coming soon.\n\n## How to use\n\n- Include package in your project\n\n```bash\nnpm install --save reverse-geocode\nor\nyarn add reverse-geocode\n```\n\n- Use package to get geo data from lat-long values. Specify a country code, which should match `/locations/{countryCode}.json`. USA, Australia, and Canada are provided.\n\n```javascript\nconst reverse = require('reverse-geocode')\nconsole.log(reverse.lookup(37.8072792, -122.4780652, 'us'))\n\n/*\n{ zipcode: '94129',\n  state_abbr: 'CA',\n  latitude: '37.799840',\n  longitude: '-122.46167',\n  city: 'San Francisco',\n  state: 'California',\n  distance: 1.6610566475026183 }\n */\n```\n\n```javascript\nconst reverse = require('reverse-geocode')\nconsole.log(reverse.lookup(50.447444, -104.418513, 'ca'))\n/*\n{ country: 'CA',\n  zipcode: 'S4Z',\n  region: 'Regina Northeast',\n  state: 'Saskatchewan',\n  state_abbr: 'SK',\n  city: 'Regina',\n  latitude: 50.4497,\n  longitude: -104.5323,\n  distance: 8.06066680024397 }\n*/\n```\n\nMore sample outputs are in [test snapshots](__tests__/__snapshots__/reverse-geocode.test.js.snap).\n\n### Data Format\n\nThe contents of a location data file is a simple JSON array, of location data:\n\n```javascript\n;[\n  {\n    zipcode: '59221',\n    state_abbr: 'MT',\n    latitude: '47.900376',\n    longitude: '-104.13403',\n    city: 'Fairview',\n    state: 'Montana',\n  },\n]\n```\n\nFind country postalcode data from a provider of your choice, format as above, and save into `/locations/` as `{countryCode}.JSON`. Then, specify the same country code.\n\nFor a good time, save all data to `all.json` and specify `'all'` to the `reverse.lookup` method.\n\n### Credits\n\n- Haversine originally by Nick Justice (niix) at \u003chttps://github.com/niix/haversine\u003e\n- Inspired from cities by Steven Lu (sjlu) at \u003chttps://www.npmjs.com/package/cities\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvikramtiwari%2Freverse-geocode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvikramtiwari%2Freverse-geocode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvikramtiwari%2Freverse-geocode/lists"}