1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "search",
12 "cities": [
13 "new-york-ny"
14 ],
15 "orderBy": "availability",
16 "resyCreditEligibleOnly": false,
17 "venueUrls": [
18 "https://resy.com/cities/new-york-ny/venues/example-restaurant"
19 ],
20 "date": "today",
21 "partySize": 2,
22 "maxItems": 20,
23 "fetchDetails": false,
24 "incrementalMode": false,
25 "emitUnchanged": false,
26 "emitExpired": false,
27 "maxNotifyListings": 50,
28 "proxyConfiguration": {
29 "useApifyProxy": true
30 }
31};
32
33
34const run = await client.actor("abotapi/resy-restaurant-availability-scraper").call(input);
35
36
37console.log('Results from dataset');
38console.log(`๐พ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
39const { items } = await client.dataset(run.defaultDatasetId).listItems();
40items.forEach((item) => {
41 console.dir(item);
42});
43
44