1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "jobs": [
12 {
13 "title": "Senior Data Analyst",
14 "company": "Example Co",
15 "location": "Chicago, IL",
16 "description": "Hybrid role: 3 days a week in our Chicago office. 5+ years of SQL and BI experience required. Full-time. Salary $110,000–$130,000 per year. We are unable to sponsor work visas."
17 },
18 {
19 "title": "Warehouse Associate",
20 "company": "Example Logistics",
21 "location": "Dallas, TX",
22 "description": "Entry level — no experience needed, we train you. Part-time evening shifts, in person at our Dallas warehouse. $18/hour."
23 }
24 ],
25 "skills": [
26 "Python",
27 "SQL",
28 "AWS",
29 "Excel",
30 "Salesforce"
31 ]
32};
33
34
35const run = await client.actor("leoworks/job-posting-classifier").call(input);
36
37
38console.log('Results from dataset');
39console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
40const { items } = await client.dataset(run.defaultDatasetId).listItems();
41items.forEach((item) => {
42 console.dir(item);
43});
44
45