1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "trending",
12 "chartGenre": "all",
13 "timePeriod": "day",
14 "searchQuery": "bohemian rhapsody",
15 "searchType": "song",
16 "artistName": "queen",
17 "artistSongsSort": "popularity",
18 "songUrls": [],
19 "songIds": [],
20 "includeLyrics": true,
21 "includeArtistDetails": true,
22 "includeAlbumDetails": true,
23 "includeAnnotations": false,
24 "maxItems": 20,
25 "proxy": {
26 "useApifyProxy": true,
27 "apifyProxyGroups": [
28 "RESIDENTIAL"
29 ]
30 }
31};
32
33
34const run = await client.actor("crawlerbros/genius-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