{"id":24941410,"url":"https://github.com/melanieseltzer/getcoords","last_synced_at":"2025-03-28T17:42:54.686Z","repository":{"id":57250571,"uuid":"144817205","full_name":"melanieseltzer/getcoords","owner":"melanieseltzer","description":"🌐 Get lat and long coordinates from any street address ","archived":false,"fork":false,"pushed_at":"2018-08-18T15:41:26.000Z","size":581,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-06T22:33:52.208Z","etag":null,"topics":["coordinates","geocoding","googlemaps-api","latlng"],"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/melanieseltzer.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":"2018-08-15T06:56:34.000Z","updated_at":"2019-02-08T18:53:09.000Z","dependencies_parsed_at":"2022-08-24T16:51:51.643Z","dependency_job_id":null,"html_url":"https://github.com/melanieseltzer/getcoords","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melanieseltzer%2Fgetcoords","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melanieseltzer%2Fgetcoords/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melanieseltzer%2Fgetcoords/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melanieseltzer%2Fgetcoords/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/melanieseltzer","download_url":"https://codeload.github.com/melanieseltzer/getcoords/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246072227,"owners_count":20719277,"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":["coordinates","geocoding","googlemaps-api","latlng"],"created_at":"2025-02-02T18:22:49.611Z","updated_at":"2025-03-28T17:42:54.661Z","avatar_url":"https://github.com/melanieseltzer.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌐 getcoords [![npm](https://img.shields.io/badge/npm-v1.0.6-blue.svg)](https://www.npmjs.com/package/getcoords) [![Build Status](https://travis-ci.org/melanieseltzer/getcoords.svg?branch=master)](https://travis-ci.org/melanieseltzer/getcoords) [![Known Vulnerabilities](https://snyk.io/test/github/melanieseltzer/getcoords/badge.svg)](https://snyk.io/test/github/melanieseltzer/getcoords)\n\n\u003e Get lat and long coordinates from any address\n\n`getcoords` uses the Google Geocoding API to convert any address into geographic coordinates.\n\n## Install\n\n```\n$ npm install getcoords\n```\n\n## API Key\n\nIn order to use the package, you must first obtain a Google API key. Please visit [the dev docs](https://developers.google.com/maps/documentation/geocoding/start#get-a-key) for instruction on how to obtain the key.\n\n Then, you must set `process.env.GOOGLE_GEOCOORDS_API_KEY` in your project using [dotenv](https://www.npmjs.com/package/dotenv) or similar. You could also set it globally in your shell ([more info](https://unix.stackexchange.com/a/21600)). \n\nIf you want to use it on client builds (such as in a React app) you will need to use [dotenv-webpack](https://github.com/mrsteele/dotenv-webpack).\n\n## Usage\n\n```js\n// .env\nGOOGLE_GEOCOORDS_API_KEY=YOURKEYHERE\n```\n\n```js\n// app.js\n\n// Import the package\nimport getCoords from 'getcoords';\n\n// Load your .env file\nrequire('dotenv').config();\n\n// Promise syntax\ngetCoords('Los Angeles, CA 90034')\n  .then(res =\u003e console.log(res))\n  .catch(error =\u003e console.log('Something went wrong'));\n\n// Or use with Async/await!\n(async () =\u003e {\n  try {\n    const latlng = await getCoords('Los Angeles, CA 90034');\n    console.log(latlng);\n  } catch (error) {\n    console.error(error);\n  }\n})();\n\n//=\u003e { lat: 34.1022444, lng: -118.3401679 } \n```\n\n## Related\n\n- [getcoords-cli](https://github.com/melanieseltzer/getcoords-cli)\n\n## License\n\nMIT © [Melanie Seltzer](https://github.com/melanieseltzer)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelanieseltzer%2Fgetcoords","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmelanieseltzer%2Fgetcoords","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelanieseltzer%2Fgetcoords/lists"}