1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "noteUrls": [
12 "https://xhslink.com/o/5oTNHv9d7Mw",
13 "https://www.xiaohongshu.com/explore/64103fc0000000001203fc58?xsec_token=ABiKahsJveydyvyBLdalMttmQTGgGUAErs4_WU0a6AMd4=&xsec_source=pc_feed",
14 "https://www.xiaohongshu.com/explore/64a0deac000000001300e8e3?xsec_token=AB7F7OTfM7z8Wy4FYWzkdUpmeBqtq7wAs7eKjLY2EHzyg=&xsec_source=pc_feed",
15 "https://www.xiaohongshu.com/explore/64a76143000000001e013522?xsec_token=ABiZBO7VhFKBtbIJuwS1YLbZ-rdIwyS6laUKxwY1CuEvA=&xsec_source=pc_feed",
16 "https://www.xiaohongshu.com/explore/64a8e1d3000000002b03c038?xsec_token=AB8_h7dEM0cSPGLiVTqaQ16NB-M1GGOA8M_rjDO5Buo8A=&xsec_source=pc_feed",
17 "https://www.xiaohongshu.com/explore/64a14e7c000000001300eafc?xsec_token=ABAPu45bW13_SwHPWPuws4uC3mEuxrH2OHd2yWx7ylbcQ=&xsec_source=pc_feed",
18 "https://www.xiaohongshu.com/explore/64a5526f0000000016027c31?xsec_token=ABAGtrrS0w5pLKIte2XwU4DAt4KwrEdYScQx6mqB3v59o=&xsec_source=pc_feed",
19 "https://www.xiaohongshu.com/explore/64a4ff18000000002b038e8c?xsec_token=AB-cltee2fqQDTX7_NEj1kolrsporjEzE0vcbmR83q9KM=&xsec_source=pc_feed",
20 "https://www.xiaohongshu.com/explore/64aa3d0f000000001c01991c?xsec_token=AB6IVlhKW3peH0kdrjKXPwlw5-bxtft9aUZlRFHeLk3Fk=&xsec_source=pc_feed",
21 "https://www.xiaohongshu.com/explore/64a7e6170000000023036717?xsec_token=ABiZBO7VhFKBtbIJuwS1YLbYJrxR7ErNmFxmHh1JyDbMI=&xsec_source=pc_feed",
22 "https://www.xiaohongshu.com/explore/64a77e06000000002301e833?xsec_token=ABiZBO7VhFKBtbIJuwS1YLbaDSgH0bBpLHj3WBIcA6q8c=&xsec_source=pc_feed"
23 ],
24 "keywords": [
25 "咖啡"
26 ]
27};
28
29
30const run = await client.actor("silentflow/rednote-detail-scraper").call(input);
31
32
33console.log('Results from dataset');
34console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
35const { items } = await client.dataset(run.defaultDatasetId).listItems();
36items.forEach((item) => {
37 console.dir(item);
38});
39
40