1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "as_of": "2026-09-24T12:00:00Z",
12 "max_age_seconds": 86400,
13 "max_source_age_seconds": 2592000,
14 "records": [
15 {
16 "id": "healthy",
17 "observed_at": "2026-09-24T11:00:00Z",
18 "source_updated_at": "2026-09-23T12:00:00Z",
19 "source_id": "feed-a",
20 "evidence_id": "capture-1"
21 },
22 {
23 "id": "old-observation",
24 "observed_at": "2026-09-22T12:00:00Z",
25 "source_updated_at": "2026-09-21T12:00:00Z",
26 "source_id": "feed-a",
27 "evidence_id": "capture-2"
28 },
29 {
30 "id": "fresh-fetch-old-content",
31 "observed_at": "2026-09-24T11:00:00Z",
32 "source_updated_at": "2026-08-01T12:00:00Z",
33 "source_id": "feed-a",
34 "evidence_id": "capture-3"
35 },
36 {
37 "id": "unknown-source-age",
38 "observed_at": "2026-09-24T11:00:00Z",
39 "source_updated_at": null,
40 "source_id": "feed-a",
41 "evidence_id": "capture-4"
42 }
43 ]
44};
45
46
47const run = await client.actor("saimislam/dataset-recency-evidence-gate").call(input);
48
49
50console.log('Results from dataset');
51console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
52const { items } = await client.dataset(run.defaultDatasetId).listItems();
53items.forEach((item) => {
54 console.dir(item);
55});
56
57