1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "maxItems": 1000,
12 "oosDateFrom": "",
13 "oosReasonFilter": [
14 "New Entrant Revoked - Refusal of Audit/No Contact",
15 "New Entrant Revoked - Failure of Safety Audit",
16 "New Entrant Revoked - Expedited Actions",
17 "Unsatisfactory = Unfit"
18 ],
19 "states": [
20 "GA",
21 "TX",
22 "CA",
23 "FL",
24 "IL",
25 "OH"
26 ]
27};
28
29
30const run = await client.actor("groundplanes/fmcsa-out-of-service-orders-scraper").call(input);
31
32
33console.log('Results from dataset');
34console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
35const { items } = await client.dataset(run.defaultDatasetId).listItems();
36items.forEach((item) => {
37 console.dir(item);
38});
39
40