Code Monkey home page Code Monkey logo

opentable's Introduction

OpenTable API

This project provides an unofficial json API interface to search OpenTable restaurant data. It eliminates the need to download, parse and import data from XLS file. Its an open-source project, hosted on Github.

Status: Project and API data are no longer maintained.

Overview

Project Status

  • Build Status
  • Code Climate
  • Coverage Status

API Reference

Get data stats

GET /api/stats

Returns response:

{
  "countries": 20,
  "cities": 2700,
  "restaurants": 25000
}

List all cities

GET /api/cities

Returns response:

{
  "count": 1234,
  "cities": [
    "Chicago",
    "San Francisco",
    "New York"
  ]
}

Find restaurants

GET /api/restaurants

Parameters: (at least one required)

  • price - Price range for the restaurant. Values: 1-4.
  • name - Name of the restaurant
  • address - Address line. Should not contain state or city or zip.
  • state - State code (ex.: IL)
  • city - City name (ex.: Chicago)
  • zip - Zipcode (ex: 60601)
  • country - Country code (ex: US)
  • page - Page (default: 1)
  • per_page - Entries per Page, can be one of [5, 10, 15, 25, 50, 100] (default: 25)

Returns response:

{
  "count": 521,
  "per_page": 25,
  "current_page": 1,
  "restaurants": [ ... ]
}

Find a single restaurant

GET /api/restaurants/:id

Returns a single restaurant record, see reference for details. Example:

{
  "id": 107257,
  "name": "Las Tablas Colombian Steak House",
  "address": "2942 N Lincoln Ave",
  "city": "Chicago",
  "state": "IL",
  "area": "Chicago / Illinois",
  "postal_code": "60657",
  "country": "US",
  "phone": "7738712414",
  "lat": 41.935137,
  "lng": -87.662815,
  "price": 2,
  "reserve_url": "http://www.opentable.com/single.aspx?rid=107257",
  "mobile_reserve_url": "http://mobile.opentable.com/opentable/?restId=107257",
  "image_url": "https://www.opentable.com/img/restimages/107257.jpg"
}

Data Reference

Restaurant attributes:

{
  "id": 107257,
  "name": "Las Tablas Colombian Steak House",
  "address": "2942 N Lincoln Ave",
  "city": "Chicago",
  "state": "IL",
  "area": "Chicago / Illinois",
  "postal_code": "60657",
  "country": "US",
  "phone": "7738712414",
  "lat": 41.935137,
  "lng": -87.662815,
  "price": 2,
  "reserve_url": "http://www.opentable.com/single.aspx?rid=107257",
  "mobile_reserve_url": "http://mobile.opentable.com/opentable/?restId=107257",
  "image_url": "https://www.opentable.com/img/restimages/107257.jpg"
}

To generate a proper reservation link just ref parameter with your affiliate ID to reserve_url or mobile_reserve_url

Consuming API

You can use simple client library i wrote โ€” https://gist.github.com/2504683

Example:

api = OpenTable::Client.new

# Find restaurants
resp = api.restaurants(:city => "Chicago")

# Process response
resp['count']       # => records found
resp['restaurants'] # => restaurant records

# Fetch a single record
api.restaurant(81169)

Disclaimer

  • This service IS NOT affiliated with OpenTable Inc., any of its products or employees.
  • All content is represented as is and does not have any modifications to the original data

Contact

Please DO NOT contact author about services and products not related to this project.

License

This software is distributed under MIT license

opentable's People

Contributors

sosedoff avatar st0le 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

opentable's Issues

Not supported in UK

This API is not supported in UK. Please give me suggeations on any other alternative API

The zipcode is stripping leading zeros

Hello,

In a recent update it seems that you have broken the zipcode field. Postal codes that start with 0 are missing the leading 0's. If we query agains postal code we get 0 results.

For example this restaurant in Boston has this for data:

{
"total_entries": 1,
"per_page": 25,
"current_page": 1,
"restaurants": [
{
"id": 106855,
"name": "Nebo",
"address": "520 Atlantic Ave",
"city": "Boston",
"state": "MA",
"area": "Boston / New England",
"postal_code": "2210",
"country": "US",
"phone": "6177236326",
"lat": 42.353772,
"lng": -71.053364,
"price": 2,
"reserve_url": "http://www.opentable.com/single.aspx?rid=106855",
"mobile_reserve_url": "http://mobile.opentable.com/opentable/?restId=106855",
"image_url": "https://www.opentable.com/img/restimages/106855.jpg"
}
]
}

You can see that the postal_code is "2210" when it should be "02210"

Therefore the following query returns 0 results:

https://opentable.herokuapp.com/api/restaurants?name=Nebo&address=520%20Atlantic%20Ave&city=Boston&state=MA&zip=02210

If we take off the zip param it works, but we have code that contains the zip right now.

Thanks!

CORS not implemented

Is it possible to implements CORS headers? It should only need one new header and it should be available put on all OPTIONS requests.

Access-Control-Allow-Origin: *

Searching restaurant by name

Hey,

Is there a way to search and get the restaurant ratings given the name of the restaurant:

I tried:

http://opentable.herokuapp.com/api/restaurants?name=%22antica%20pesa%22

but didn't get the answer I was hoping...

Finding reservation availability?

Thanks for putting together this API. I wrote something really quickly to fetch the IDs of all the restaurants in my city, but wanted to take things a little further. Using the network tab in chrome, I see that checking for availability on a given day at a given restaurant is done by making a POST request to something like:

http://www.opentable.com/restaurant/profile/50962/search

with a payload like:

{"covers":2,"dateTime":"2015-02-13 17:00"}

Have you explored this at all? My preliminary attempts at using this programmatically are failing. I've tried spoofing my user agent, but that didn't matter. Perhaps it's checking the request origin or looking for some cookie?

How to get URL for OpenTable page?

For instance here, how can I get the URL for here? I could take name and lowercase it and replace spaces with dashes for instance, but that isn't perfect.

Is there a URL format that OpenTable uses that uses the ID to return the page? Such as http://www.opentable.com/restaurant/107257?

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.