Git Product home page Git Product logo

touristfriend's Introduction

TouristFriend

TouristFriend is an API for searching and combining results from Google Places and Yelp.

For the foursquare implementation check out the branch foursquare

Returns a combined list of places ranked by their ratings as a Bayesian estimate

Try it out

$ curl http://touristfriend.club/api/40000/29.743883,-95.361621/restaurants

Sample output

[
  {
    "Rating": "9.49",
    "Sources": 1,
    "Number_of_Ratings": 868,
    "Location": "37.761594,-122.42427",
    "Name": "Pizzeria Delfina"
  },
  {
    "Rating": "9.39",
    "Sources": 1,
    "Number_of_Ratings": 404,
    "Location": "37.7682006597,-122.421604657",
    "Name": "Shizen"
  },
  {
    "Rating": "9.32",
    "Sources": 1,
    "Number_of_Ratings": 45,
    "Location": "37.763093,-122.424281",
    "Name": "Turner's Kitchen"
  },
  // Up to 15 results...
]

URI Breakdown: http://touristfriend.club/api/{meters}/{latitude},{longitude}/{query}

Setup

You'll need to acquire API keys for each of the individual services and add them to api_keys.py.

Set environment variables

# Google Places
$ export G_API=YOUR_GOOGLE_API_KEY

# Yelp
$ export YELP_API_KEY=YOUR_YELP_API_KEY

# Flask app, standing on the root of the cloned repo
$ export FLASK_APP=$(pwd)/touristfriend/__init__.py

Install dependencies

pip install -U Flask flask-cors

Run it

# For localhost
$ flask run # 127.0.0.1
# For external server
$ flask run --host "0.0.0.0" &

Try it

$ curl http://localhost:5000/api/40000/48.888001,2.337442/restaurants

With Docker example

$ docker build -t tfriend --build-arg GMAPS_KEY=YOUR_GOOGLE_MAPS_KEY \
  --build-arg G_API=YOUR_GOOGLE_API_KEY \
  --build-arg YELP_API_KEY=YOUR_YELP_API_KEY . && \
  docker run -p 5000:5000 tfriend

Feel free to use the touristfriend.club API for testing or demoing, if you plan on using it on production, consider deploying it yourself.

LICENSE: MIT

touristfriend's People

Contributors

octohedron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.