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-music",
12 "keywords": [
13 "classical music"
14 ],
15 "trackUrls": [
16 "https://open.spotify.com/track/2xizRhme7pYeITbH1NLLGt"
17 ],
18 "albumUrls": [
19 "https://open.spotify.com/album/7dVA06E7AP7P7VzPyNxQVO"
20 ],
21 "artistUrls": [
22 "https://open.spotify.com/artist/5yxyJsFanEAuwSM5kOuZKc"
23 ],
24 "playlistUrls": [
25 "https://open.spotify.com/playlist/37i9dQZF1DX4UtSsGT1Sbe"
26 ],
27 "podcastUrls": [
28 "https://open.spotify.com/show/5NT0kUEUIdS5FxotBPJvMX"
29 ],
30 "maxItems": 10
31};
32
33
34const run = await client.actor("icoe-man/spotify-music-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