mcdonald-location-apiv2
Description
mcdonald-location-apiv2
is a Node.js package that provides an easy way to find McDonald's locations based on latitude and longitude. It supports finding the nearest location or retrieving a list of locations within a specified search radius. This API utilizes the unofficial McDonald's location API and offers additional functionality for filtering results.
Features
- Retrieve the nearest McDonald's location based on latitude and longitude.
- Get a list of McDonald's locations within a specified radius.
- Filter search results by a maximum number of results.
Installation
To install mcdonald-location-apiv2
, use npm:
npm i mcdonald-location-apiv2
This will download and install the package and all its dependencies in your project's node_modules directory.
Usage
After installation, you can use the package in your Node.js application to make API requests. Here is a basic example:
const mcdonaldsApi = require('mcdonald-location-apiv2');
mcdonaldsApi.getNearestLocation(40.712776, -74.005974)
.then(location => console.log(location))
.catch(error => console.error(error));
mcdonaldsApi.getLocations(40.712776, -74.005974, 10)
.then(locations => console.log(locations))
.catch(error => console.error(error));
API Reference
getNearestLocation(latitude, longitude)
getLocations(latitude, longitude, radius, maxResults)