Platforms
Resy

Resy Integration

The Web Action SDK provides powerful actions to interact with Resy. This guide covers all available Resy actions, their inputs, outputs, and usage examples.

Actions

Get Restaurants

Searches for restaurants on Resy based on given parameters.

Function: sdk.resy.getRestaurants
 
Input:
{
  searchQuery: string,
  topN: number // 1-10, optional
}
 
Output:
Array<{
  restaurantName: string,
  restaurantPageUrl: string,
  rating: string,
  cuisine: string,
  neighborhood: string,
  reservations: Array<{
    date: string,
    time: string,
    seatingType: string
  }>
}>

Example:

const restaurants = await sdk.resy.getRestaurants({
  searchQuery: "Italian restaurants in New York",
  topN: 5,
});
 
restaurants.forEach((restaurant) => {
  console.log(`${restaurant.name} - ${restaurant.cuisine}`);
  console.log(`Price: ${restaurant.price}, Rating: ${restaurant.rating}`);
  console.log(`Address: ${restaurant.address}, ${restaurant.neighborhood}`);
  console.log("---");
});

Get Reservation Times for Restaurant

Retrieves available reservation times for a specific restaurant.

Function: sdk.resy.getReservationTimesForRestaurant
 
Input:
{
  searchQuery: string,
  date: string, // YYYY-MM-DD
  time: string, // HHMM
  seats: number // 2-8
}
 
Output:
Array<{
  restaurantName: string,
  restaurantPageUrl: string,
  rating: string,
  cuisine: string,
  neighborhood: string,
  reservations: Array<{
    date: string,
    time: string,
    seatingType: string
  }>
}>

Example:

const reservationTimes = await sdk.resy.getReservationTimesForRestaurant({
  searchQuery: "italian",
  date: "2024-09-15",
  time: "1900",
  seats: 2,
});
 
reservationTimes.forEach((slot) => {
  console.log(`Time: ${slot.time}, Available: ${slot.available}`);
});

Book Restaurant

Books a reservation at a specified restaurant.

Function: sdk.resy.bookRestaurant
 
Input:
{
    searchQuery: string,
  date: string, // YYYY-MM-DD
  time: string, // HHMM
  seats: number // 2-8
}
 
Output:
{
  message: string // success of action
}

Example:

const bookingResult = await sdk.resy.bookRestaurant({
  searchQuery: "spruce",
  date: "2024-09-15",
  time: "1900",
  seats: 2,
});
 
console.log(bookingResult.message);

Troubleshooting

If you encounter any issues while using the Resy integration, please refer to our Troubleshooting guide for common problems and their solutions.