Getting current wait time
The wait time is returned as a range. Start is the lower bound and end is the upper bound.
public class WaitTime
{
/// <summary>
/// The lower bound for the range.
/// </summary>
public TimeSpan Start { get; }
/// <summary>
/// The upper bound for the range.
/// </summary>
public TimeSpan End { get; }
}
Null wait time
A null wait time means there isn't a wait time. It does not mean there is no wait. You can get back null wait times for a variety of reasons.
A few of the reasons are:
- The restaurant isn't open yet
- The section is closed
- There isn't a server assigned to a table that could accommodate your party size.
Getting the wait time when party size is unknown
Sometimes you want to display the wait time of the restaurant before you know the size of the customer. The following request will give you back the wait times broken out into groups.
curl --request GET \
--url https://sandbox.seatninja.com/v2/reservations/restaurantId/waittime \
--header 'accept: application/json' \
--header 'x-api-key: YOUR_API_KEY'
{
"data": {
"estimatedWaitTimes": [{
"diningTableSectionId": 0,
"default": {
"start": "00:40:00",
"end": "00:50:00"
},
"one": {
"start": "00:00:00",
"end": "00:05:00"
},
"two": {
"start": "00:00:00",
"end": "00:05:00"
},
"four": {
"start": "00:50:00",
"end": "00:60:00"
},
"six": {
"start": "01:20:00",
"end": "01:30:00"
},
"sevenPlus": null
},
{
"diningTableSectionId": 15,
"default": null,
"one": null,
"two": null,
"four": null,
"six": null,
"sevenPlus": null
},
{
"diningTableSectionId": 260,
"default": {
"start": "00:30:00",
"end": "00:40:00"
},
"one": {
"start": "00:30:00",
"end": "00:40:00"
},
"two": {
"start": "00:30:00",
"end": "00:40:00"
},
"four": null,
"six": null,
"sevenPlus": null
}
],
"created": "2019-02-11T23:41:10.6563009Z"
},
"error": null
}
see wait time API
The wait times returned are broken out by section ID and bucketed into ranges.
Default = average of all groups
One = parties of 1
Two = parties of 2
Four = parties of 3-4
Six = parties of 5-6
SevenPlus = parties of 7+
Getting the wait time when party size is known
If you know the party size it is better to ask for the wait time for that specific party size. The wait times returned are broken out by section ID.
curl --request GET \
--url https://sandbox.seatninja.com/v2/reservations/restaurantId/waittime/partySize \
--header 'accept: application/json' \
--header 'x-api-key: YOUR_API_KEY'
{
"data": {
"partySize": 2,
"estimatedWaitTimes": [{
"diningTableSectionId": 0,
"estimatedWaitTime": {
"start": "00:00:00",
"end": "00:05:00"
}
},
{
"diningTableSectionId": 15,
"estimatedWaitTime": null
},
{
"diningTableSectionId": 260,
"estimatedWaitTime": {
"start": "00:30:00",
"end": "00:40:00"
}
}
]
},
"error": null
}
see wait time API
Batch getting the wait time
If you want to get the wait time for party sizes of 1-10 in one request. This can be useful if you needed to populate some UI that when the customer changes the party size it would instantly reflect the wait time for that party size.
curl --request GET \
--url https://sandbox.seatninja.com/v2/reservations/restaurantId/waittime/batch \
--header 'accept: application/json' \
--header 'x-api-key: YOUR_API_KEY'
{
"data": [{
"partySize": 1,
"estimatedWaitTimes": [{
"diningTableSectionId": 0,
"estimatedWaitTime": {
"start": "00:00:00",
"end": "00:05:00"
}
},
{
"diningTableSectionId": 15,
"estimatedWaitTime": null
},
{
"diningTableSectionId": 260,
"estimatedWaitTime": {
"start": "00:30:00",
"end": "00:40:00"
}
}
]
},
{
"partySize": 2,
"estimatedWaitTimes": [{
"diningTableSectionId": 0,
"estimatedWaitTime": {
"start": "00:00:00",
"end": "00:05:00"
}
},
{
"diningTableSectionId": 15,
"estimatedWaitTime": null
},
{
"diningTableSectionId": 260,
"estimatedWaitTime": {
"start": "00:30:00",
"end": "00:40:00"
}
}
]
},
{
"partySize": 3,
"estimatedWaitTimes": [{
"diningTableSectionId": 0,
"estimatedWaitTime": {
"start": "00:40:00",
"end": "00:50:00"
}
},
{
"diningTableSectionId": 15,
"estimatedWaitTime": null
},
{
"diningTableSectionId": 260,
"estimatedWaitTime": null
}
]
},
{
"partySize": 4,
"estimatedWaitTimes": [{
"diningTableSectionId": 0,
"estimatedWaitTime": {
"start": "00:40:00",
"end": "00:50:00"
}
},
{
"diningTableSectionId": 15,
"estimatedWaitTime": null
},
{
"diningTableSectionId": 260,
"estimatedWaitTime": null
}
]
},
{
"partySize": 5,
"estimatedWaitTimes": [{
"diningTableSectionId": 0,
"estimatedWaitTime": {
"start": "01:10:00",
"end": "01:20:00"
}
},
{
"diningTableSectionId": 15,
"estimatedWaitTime": null
},
{
"diningTableSectionId": 260,
"estimatedWaitTime": null
}
]
},
{
"partySize": 6,
"estimatedWaitTimes": [{
"diningTableSectionId": 0,
"estimatedWaitTime": {
"start": "01:10:00",
"end": "01:20:00"
}
},
{
"diningTableSectionId": 15,
"estimatedWaitTime": null
},
{
"diningTableSectionId": 260,
"estimatedWaitTime": null
}
]
},
{
"partySize": 7,
"estimatedWaitTimes": [{
"diningTableSectionId": 0,
"estimatedWaitTime": null
},
{
"diningTableSectionId": 15,
"estimatedWaitTime": null
},
{
"diningTableSectionId": 260,
"estimatedWaitTime": null
}
]
},
{
"partySize": 8,
"estimatedWaitTimes": [{
"diningTableSectionId": 0,
"estimatedWaitTime": null
},
{
"diningTableSectionId": 15,
"estimatedWaitTime": null
},
{
"diningTableSectionId": 260,
"estimatedWaitTime": null
}
]
},
{
"partySize": 9,
"estimatedWaitTimes": [{
"diningTableSectionId": 0,
"estimatedWaitTime": null
},
{
"diningTableSectionId": 15,
"estimatedWaitTime": null
},
{
"diningTableSectionId": 260,
"estimatedWaitTime": null
}
]
},
{
"partySize": 10,
"estimatedWaitTimes": [{
"diningTableSectionId": 0,
"estimatedWaitTime": {
"start": "01:10:00",
"end": "01:20:00"
}
},
{
"diningTableSectionId": 15,
"estimatedWaitTime": null
},
{
"diningTableSectionId": 260,
"estimatedWaitTime": null
}
]
}
],
"error": null
}
see wait time API
Updated almost 6 years ago