1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "search",
12 "urls": [
13 "https://www.olx.pl/motoryzacja/samochody/bmw/",
14 "https://www.olx.pl/motoryzacja/samochody/",
15 "https://www.olx.pl/nieruchomosci/mieszkania/warszawa/",
16 "https://www.olx.pl/oferty/q-iphone/",
17 "https://www.olx.pl/motoryzacja/samochody/bmw/?page=2",
18 "https://www.olx.pl/motoryzacja/samochody/bmw/?search%5Bfilter_float_price%3Afrom%5D=10000&search%5Border%5D=filter_float_price%3Aasc",
19 "https://www.olx.pl/d/oferta/ksiazka-encyklopedia-popularna-olesiejuk-CID751-IDRFFqw.html",
20 "https://www.olx.pl/oferty/uzytkownik/1VRzN/",
21 "https://m.olx.pl/motoryzacja/samochody/bmw/",
22 "https://www.olx.ro/auto-masini-moto-ambarcatiuni/autoturisme/",
23 "https://www.olx.pt/carros-motos-e-barcos/carros/",
24 "https://www.olx.ua/uk/transport/legkovye-avtomobili/",
25 "https://www.olx.kz/transport/legkovye-avtomobili/",
26 "https://www.olx.bg/ads/"
27 ],
28 "country": "pl",
29 "proxyConfiguration": {
30 "useApifyProxy": true
31 },
32 "incrementalMode": false,
33 "emitUnchanged": false,
34 "emitExpired": false,
35 "ignoreFieldsForChanges": []
36};
37
38
39const run = await client.actor("abotapi/olx-scraper").call(input);
40
41
42console.log('Results from dataset');
43console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
44const { items } = await client.dataset(run.defaultDatasetId).listItems();
45items.forEach((item) => {
46 console.dir(item);
47});
48
49