npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

restaurant-location-search-api

v1.0.1

Published

A Node.js package that serves as an unofficial API wrapper, providing a unified interface to fetch restaurant locations from various chains without the need for Google Maps API, making it a cost-free solution. This package leverages the specific, unoffici

Downloads

5

Readme

restaurant-location-search-api

A Node.js package that serves as an unofficial API wrapper, providing a unified interface to fetch restaurant locations from various chains without the need for Google Maps API, making it a cost-free solution. This package leverages the specific, unofficial APIs of supported restaurants such as McDonald's, Wendy's, Chipotle, Burger King, Popeyes, and Taco Bell, offering a simplified way to retrieve locations based on latitude and longitude. It's designed for developers who need to integrate restaurant location functionalities into their applications seamlessly, with plans to expand support to more restaurant chains in the future.

Features

  • Fetch the nearest or a list of restaurant locations based on coordinates.
  • Supports multiple restaurant chains.
  • Option to specify search radius and maximum number of results.
  • Handles responses in various formats, including JSON and XML, automatically decoding compressed responses.
  • Search sites for more info ( coming soon )

Installation

Use npm to install restaurant-location-search-api:

npm install restaurant-location-search-api

Usage

After installation, require the package in your Node.js project and use the functions provided to fetch restaurant locations.

const getLocations = require('restaurant-location-search-api');

// Fetch nearest McDonald's location
getLocations('tacoBell', { lat: 40.712776, long: -74.005974 }, '1000', '1', true)
  .then(fetchedLocations => { console.log( fetchedLocations ) } )
  .catch(console.error);

// Fetch locations for other supported restaurants
getLocations('burgerKing', { lat: 40.712776, long: -74.005974 }, '5000', '5')
  .then(fetchedLocations => { console.log( fetchedLocations ) } )
  .catch(console.error);

API

getLocations(spotName, geoObject, radius, maxResults, nearbyOnly=false)

Fetches restaurant locations based on the specified parameters.

  • spotName: Name of the restaurant chain (e.g., 'mcdonalds', 'wendys').
  • geoObject: Object with lat (latitude) and long (longitude) properties.
  • radius: Search radius in kilometers.
  • maxResults: Maximum number of results to return.
  • nearbyOnly (optional): Set to true to fetch only the nearest location. ( might not work for all restuarants )

Example JSON Response

Below is an example of the JSON response returned by the getLocations function for Taco Bell locations:

{
  "nearByStores": [
    {
      "storeStatus": "openNow",
      "pickupStoreStatusForLocation": "Activated",
      "phoneNumber": "+12122330848",
      "storeNumber": "035336",
      "timeZone": "GMT-05:00",
      "roundUpFlag": true,
      "todayBusinessHours": {
        "openTime": "07:00",
        "closeTime": "23:00"
      },
      "delivery": true,
      "address": {
        "streetAddress": "123 Example St",
        "city": "New York",
        "state": "NY",
        "zipCode": "10001"
      },
      "geoPoint": {
        "latitude": 40.712776,
        "longitude": -74.005974
      },
      "formattedDistance": "0.30 Miles"
    },
    {
      "storeStatus": "openNow",
      "pickupStoreStatusForLocation": "Activated",
      "phoneNumber": "+16468239315",
      "storeNumber": "035828",
      "timeZone": "GMT-05:00",
      "roundUpFlag": true,
      "todayBusinessHours": {
        "openTime": "07:00",
        "closeTime": "22:00"
      },
      "delivery": true,
      "address": {
        "streetAddress": "456 Another Rd",
        "city": "New York",
        "state": "NY",
        "zipCode": "10002"
      },
      "geoPoint": {
        "latitude": 40.715776,
        "longitude": -74.015974
      },
      "formattedDistance": "1.1 Miles"
    }
    // Additional stores omitted for brevity
  ]
}

Supported Restaurants

  • McDonald's
  • Wendy's
  • Chipotle
  • Burger King
  • Popeyes
  • Taco Bell

More coming soon!

Contributing

Contributions are welcome! If you'd like to add support for more restaurant chains or improve the package, please open a pull request.