Resy API examples & templates
Use these vals as a playground to view and fork Resy API examples and templates on Val Town. Run any example below or find templates that can be used as a pre-built solution.
rlesser
Resy_getFavorites
Script
Get Favorites on Resy This function fetches your favorite restaurants and venues, as specified in your Hit List . Inputs An object containing: authToken - Your authentication token, normally generated from @rlesser.Resy_authenticate . Returns A Favorites object, containing the ids of your favorite venues, defined in the type below. See other Resy vals I've made.
3
rlesser
Resy_getVenueCalendar
Script
Get a Venue's Calendar on Resy This function fetches the calendar for a given venue on Resy, which gives information on which days the venue is available, sold-out, or closed. Inputs An object containing: venue_id - The Resy venue id, either fetched from the website's network data or from @rlesser_getFavorites (Todo: add venue id from url function) . num_seats - The number of seats you are checking for availability for. Use 2 as a default if you just want to know when the restaurant is closed. Returns A VenueCalendar object, containing: last_calendar_day - A string representing the last day the restaurant has made their calendar available for (normally a few weeks out from today). scheduled - An object containing a list of dates and restaurant statuses. See type below. See other Resy vals I've made.
1
vtdocs
resyGetMatchingSlot
Script
(Part of: https://www.val.town/v/vtdocs.resyBot) This val attempts to return a single valid slot (per the time range requirements). If there are no valid slots, it throws an error. When there are multiple valid slots, it picks the middle slot (by ordering, not necessarily by time).
1