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 "searchTerms": [
13 "true crime"
14 ],
15 "categories": [
16 "comedy"
17 ],
18 "region": "us",
19 "urls": [
20 "https://play.pocketcasts.com/podcasts/873e7420-042d-012e-f9a4-00163e1b201c",
21 "https://pocketcasts.com/podcast/the-joe-rogan-experience/873e7420-042d-012e-f9a4-00163e1b201c",
22 "https://pca.st/podcast/873e7420-042d-012e-f9a4-00163e1b201c",
23 "https://cache.pocketcasts.com/mobile/podcast/full/873e7420-042d-012e-f9a4-00163e1b201c",
24 "https://cache.pocketcasts.com/podcast/rating/873e7420-042d-012e-f9a4-00163e1b201c",
25 "https://lists.pocketcasts.com/category-comedy-us.json"
26 ],
27 "maxPodcasts": 10,
28 "maxResults": 1000,
29 "maxEpisodes": 100,
30 "maxEpisodesPerPodcast": 0,
31 "sortBy": "chartRank",
32 "includeEpisodes": true,
33 "includeRatings": true,
34 "proxyConfiguration": {
35 "useApifyProxy": true
36 },
37 "incrementalMode": false,
38 "emitUnchanged": false,
39 "emitExpired": false,
40 "maxNotifyListings": 50
41};
42
43
44const run = await client.actor("abotapi/pocketcasts-podcast-scraper").call(input);
45
46
47console.log('Results from dataset');
48console.log(`๐พ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
49const { items } = await client.dataset(run.defaultDatasetId).listItems();
50items.forEach((item) => {
51 console.dir(item);
52});
53
54