1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "url": "https://ollama.com/library",
12 "itemSelector": "#repo li",
13 "fields": {
14 "name": "div[title]::attr(title)",
15 "url": "a::attr(href)",
16 "description": "p.max-w-lg::text",
17 "pulls": "p.my-4 > span:nth-of-type(1) > span:nth-of-type(1)::text",
18 "tag_count": "p.my-4 > span:nth-of-type(2) > span:nth-of-type(1)::text",
19 "updated": "p.my-4 > span:nth-of-type(3) > span:nth-of-type(2)::text",
20 "capabilities": "span.bg-indigo-50::text",
21 "sizes": "span.text-blue-600::text"
22 },
23 "proxy": {
24 "useApifyProxy": true
25 }
26};
27
28
29const run = await client.actor("zenolvepro/ollama-library").call(input);
30
31
32console.log('Results from dataset');
33console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
34const { items } = await client.dataset(run.defaultDatasetId).listItems();
35items.forEach((item) => {
36 console.dir(item);
37});
38
39