1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "endpoints": [
12 {
13 "url": "https://api.bitbucket.org/2.0/repositories",
14 "method": "GET"
15 },
16 {
17 "url": "https://postman-echo.com/response-headers?Deprecation=%401735689600&Sunset=Wed%2C%2031%20Dec%202031%2023%3A59%3A59%20GMT&Link=%3Chttps%3A%2F%2Fpostman-echo.com%2Fget%3E%3B%20rel%3D%22successor-version%22",
18 "method": "GET"
19 },
20 {
21 "url": "https://api.github.com/",
22 "method": "GET",
23 "headers": {
24 "X-GitHub-Api-Version": "2022-11-28"
25 }
26 },
27 {
28 "url": "https://gitlab.com/api/v3/projects",
29 "method": "GET"
30 }
31 ],
32 "sunset_warning_days": 90,
33 "alert_webhook_url": "",
34 "baseline_name": "DEFAULT",
35 "request_timeout_seconds": 15,
36 "concurrency": 5,
37 "max_redirects": 3,
38 "max_run_seconds": 240
39};
40
41
42const run = await client.actor("kingii98/third-party-api-deprecation-and-sunset-header-watch").call(input);
43
44
45console.log('Results from dataset');
46console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
47const { items } = await client.dataset(run.defaultDatasetId).listItems();
48items.forEach((item) => {
49 console.dir(item);
50});
51
52