1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "startUrls": [
12 {
13 "url": "https://www.instagram.com/p/example/"
14 }
15 ],
16 "manualSession": `{
17 "sessionid": "your_session_id_here",
18 "csrftoken": "your_csrf_token_here",
19 "ds_user_id": "your_user_id_here",
20 "mid": "your_mid_here",
21 "ig_did": "your_ig_did_here",
22 "datr": "your_datr_here"
23 }`,
24 "proxyConfiguration": {
25 "useApifyProxy": true,
26 "apifyProxyGroups": [
27 "RESIDENTIAL"
28 ],
29 "apifyProxyCountry": "US"
30 },
31 "brightDataConfig": `{
32 "host": "brd.superproxy.io",
33 "port": 22225,
34 "username": "your_username",
35 "password": "your_password",
36 "country": "US"
37 }`
38};
39
40
41const run = await client.actor("clip-forge/instagram-post-scraper-pay-per-request").call(input);
42
43
44console.log('Results from dataset');
45console.log(`๐พ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
46const { items } = await client.dataset(run.defaultDatasetId).listItems();
47items.forEach((item) => {
48 console.dir(item);
49});
50
51