1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "items": [
12 {
13 "operationType": "http_get",
14 "failureCategory": "rate_limit",
15 "statusCode": 429,
16 "attemptNumber": 1,
17 "maxAttempts": 4,
18 "elapsedSeconds": 2,
19 "deadlineSeconds": 120,
20 "amountSpent": 0.01,
21 "maxSpend": 0.1,
22 "idempotent": true,
23 "allowedMutations": [],
24 "nextAttemptCost": 0.01,
25 "retryAfterSeconds": 5
26 }
27 ]
28};
29
30
31const run = await client.actor("skilled_glee/retry-oracle").call(input);
32
33
34console.log('Results from dataset');
35console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
36const { items } = await client.dataset(run.defaultDatasetId).listItems();
37items.forEach((item) => {
38 console.dir(item);
39});
40
41