
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
city-grabber
Advanced tools
This is a wrapper for the City Grabber API used to find the nearest city and country from latitude and longitude.
City grabber uses an algorithim that utalises spatial mapping and data analysis to give you a blazing fast and accurate response from over 10,000 cities across the glove.
This API requires an API key which can get obtained Here. It will come with 10 free requests.
npm i city-grabber --save
const cityGrabber = require( 'city-grabber' )
//Using Promises
cityGrabber.get( latitude, longitude, apiKey )
.then( response => console.log( response.city, response.country ))
.catch( e => console.log( e ))
//Async await
const response = await cityGrabber.get( latitude, longitude, apiKey )
console.log( response.city, response.country )
cityGrabber.get( 40.6721694, -73.9593683, apiKey )
//Response
{
city: 'Brookyln'.
country: 'US'
}
cityGrabber.get( 35.4526317, 139.4546863, apiKey )
//Response
{
city: 'Yokohama'.
country: 'JP'
}
Status | Error | Description |
---|---|---|
422 | API KEY NOT FOUND | You need to pass your API key as a parameter. You can get one Here. |
422 | INVALID API KEY | Your key is invalid or badly formatted. |
402 | NO CREDITS REMAINING | You need to purchase more credits for your key. You can do that Here. |
422 | INVALID COORDINATES | Missing or invalid latitude/ longitude. |
Click Here to see the full documentation
FAQs
City Grabber returns the city from a latitude and longitude using spatial mapping and data anlysis.
The npm package city-grabber receives a total of 5 weekly downloads. As such, city-grabber popularity was classified as not popular.
We found that city-grabber demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.