1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "names": [
12 "aspirin",
13 "caffeine",
14 "glucose",
15 "ibuprofen",
16 "acetaminophen",
17 "dopamine",
18 "serotonin",
19 "melatonin",
20 "testosterone",
21 "estradiol",
22 "cortisol",
23 "cholesterol",
24 "adrenaline",
25 "ascorbic acid",
26 "penicillin",
27 "morphine",
28 "nicotine",
29 "ethanol",
30 "benzene",
31 "acetone",
32 "formaldehyde",
33 "toluene",
34 "chloroform",
35 "methanol",
36 "water"
37 ],
38 "proxyConfiguration": {
39 "useApifyProxy": true
40 }
41};
42
43
44const run = await client.actor("logiover/pubchem-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