1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "adsFile": {
12 "format": "json",
13 "content": "[\n {\n \"advertiserName\": \"North Pier Demo\",\n \"adId\": \"DEMO-106\",\n \"adText\": \"Compare the sample dashboard.\",\n \"creativeType\": \"image\",\n \"creativeReferenceUrl\": \"https://example.org/demo/a.png\",\n \"landingPageUrl\": \"https://example.org/demo\",\n \"sourceUrl\": \"https://example.org/demo/export\",\n \"sourceReportedStartDate\": \"2026-01-12\"\n },\n {\n \"advertiserName\": \"North Pier Demo\",\n \"adId\": \"DEMO-106\",\n \"adText\": \"Compare the sample dashboard.\",\n \"creativeType\": \"image\",\n \"creativeReferenceUrl\": \"https://example.org/demo/a.png\",\n \"landingPageUrl\": \"https://example.org/demo\",\n \"sourceUrl\": \"https://example.org/demo/export\",\n \"sourceReportedStartDate\": \"2026-01-12\"\n },\n {\n \"advertiserName\": \"North Pier Demo\",\n \"adId\": \"DEMO-106\",\n \"adText\": \"Compare the sample dashboard.\",\n \"creativeType\": \"image\",\n \"creativeReferenceUrl\": \"https://example.org/demo/b.png\",\n \"landingPageUrl\": \"https://example.org/demo\",\n \"sourceUrl\": \"https://example.org/demo/export\",\n \"sourceReportedStartDate\": null\n }\n]"
14 }
15};
16
17
18const run = await client.actor("afkdigital/linkedin-b2b-ad-intelligence").call(input);
19
20
21console.log('Results from dataset');
22console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
23const { items } = await client.dataset(run.defaultDatasetId).listItems();
24items.forEach((item) => {
25 console.dir(item);
26});
27
28