Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
city-grabber
Advanced tools
City Grabber returns the city from a latitude and longitude using spatial mapping and data anlysis.
This is a wrapper for the City Grabber API which gets a city or closest city from a latitude and longitude.
City grabber uses an algorithim that utilises spatial mapping and sophisticated data analysis to give you a blazing fast and accurate response from over 150,000 cities from every country across the globe.
This package requires an API key which can be generated Here.
npm i city-grabber --save
const cityGrabber = require( 'city-grabber' )
//Using Promises
cityGrabber.get( latitude, longitude, size, apiKey )
.then( response => {
const { city, country, population, distance } = response
})
.catch( e => console.log( e ))
//Async await
const { city, country, population, distance } = await cityGrabber.get( latitude, longitude, size, apiKey )
Size | Description |
---|---|
NULL | This will search through every city of every size |
0 | Major Cities, 1m+ population |
1 | Big Cities, 250k - 1m population |
2 | Medium Cities, 10k - 250k population |
3 | Small cities, under 10k population |
cityGrabber.get( 35.4526317, 139.4546863, 0, apiKey )
//Response
{
city: 'Yokohama'.
country: 'JP',
population: 3574443,
distance: 17.823109463333083
}
cityGrabber.get( 42.34133262, -83.05576000, 1, apiKey )
//Response
{
city: 'Detroit'.
country: 'US',
population: 677116,
distance: 1.3745663787473823
}
Property | Description |
---|---|
city | The city name. |
country | The 2 letter country code which the city is located. |
population | The last updated population of that city. |
distance | The distance between the user and city center in km. |
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. |
422 | INVALID SIZE | Your size parameter is invalid. |
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. |
This is a brand new API launced in February 2021. Full Documentation will be here soon.
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 3 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.