sosedoff / opentable

Unofficial OpenTable API
http://opentable.herokuapp.com/
Other
145 stars 39 forks source link

Finding reservation availability? #6

Closed trtg closed 9 years ago

trtg commented 9 years ago

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?

sosedoff commented 9 years ago

@trtg no, i havent. i dont think making reservations will be possible.

trtg commented 9 years ago

Thanks for getting back to me. I wasn't referring to actually making a reservation but rather simply checking availability for a given time + party size, which is what the POST request mentioned above does. I imagine the problems remain the same however. I imagine they are checking for the origin of the request and/or cookies to be set before responding to a request at /search

sosedoff commented 9 years ago

Any code that interacts directly with OT website(/api) will be unstable and unmaintainable unless you found a reliable way to get the data. I dont have any time at the moment to go over the issue or inspect any possible vectors to get the data in question. Closing this for now.