1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "inline",
12 "currentSnapshot": {
13 "format": "records",
14 "records": [
15 {
16 "id": 101,
17 "full_name": "acme/payments",
18 "private": false,
19 "archived": false,
20 "fork": false,
21 "default_branch": "main",
22 "has_issues": true,
23 "license": {
24 "spdx_id": "MIT"
25 },
26 "latest_release_at": "2026-09-01T10:00:00Z",
27 "updated_at": "2026-09-20T12:00:00Z"
28 },
29 {
30 "id": 202,
31 "full_name": "acme/legacy-api",
32 "private": true,
33 "archived": true,
34 "fork": false,
35 "default_branch": "main",
36 "has_issues": false,
37 "license": null,
38 "latest_release_at": null,
39 "updated_at": "2025-01-10T09:00:00Z"
40 }
41 ]
42 },
43 "priorSnapshot": {
44 "format": "records",
45 "records": [
46 {
47 "id": 101,
48 "full_name": "acme/payments",
49 "private": false,
50 "archived": false,
51 "fork": false,
52 "default_branch": "master",
53 "has_issues": true,
54 "license": {
55 "spdx_id": "MIT"
56 },
57 "latest_release_at": "2026-08-01T10:00:00Z",
58 "updated_at": "2026-08-15T12:00:00Z"
59 }
60 ]
61 },
62 "asOf": "2026-09-24T12:00:00Z"
63};
64
65
66const run = await client.actor("first_watch/github-repository-metadata-export").call(input);
67
68
69console.log('Results from dataset');
70console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
71const { items } = await client.dataset(run.defaultDatasetId).listItems();
72items.forEach((item) => {
73 console.dir(item);
74});
75
76