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 "zipCode": "50667",
13 "searchTerm": "milch",
14 "urls": [
15 "https://www.rewe.de/shop/api/products?search=milch&page=1",
16 "https://www.rewe.de/shop/api/products?search=milch&page=2&objectsPerPage=30",
17 "https://www.rewe.de/shop/api/products?categorySlug=milch&page=2&objectsPerPage=5",
18 "https://www.rewe.de/shop/api/products?categorySlug=milch&search=hafer&objectsPerPage=3",
19 "https://www.rewe.de/shop/api/products?search=*&page=1&objectsPerPage=3&sorting=PRICE_ASC",
20 "https://www.rewe.de/shop/api/products?search=milch&brand=Alnatura&attribute=organic&objectsPerPage=5",
21 "https://www.rewe.de/shop/p/weihenstephan-h-milch-3-5-1l/677067",
22 "https://www.rewe.de/shop/c/milch/",
23 "https://www.rewe.de/suche/produkte?search=milch"
24 ],
25 "proxy": {
26 "useApifyProxy": true
27 },
28 "ignoreFieldsForChanges": []
29};
30
31
32const run = await client.actor("abotapi/rewe-de-scraper").call(input);
33
34
35console.log('Results from dataset');
36console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
37const { items } = await client.dataset(run.defaultDatasetId).listItems();
38items.forEach((item) => {
39 console.dir(item);
40});
41
42