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 "country": "ng",
13 "queries": [
14 "phone"
15 ],
16 "sort": "relevance",
17 "officialStoreOnly": false,
18 "minDiscount": 0,
19 "urls": [
20 "https://www.jumia.com.ng/catalog/?q=phone"
21 ],
22 "fetchDetails": false,
23 "fetchReviews": false,
24 "maxReviewsPerProduct": 10,
25 "maxItems": 20,
26 "maxPages": 0,
27 "incrementalMode": false,
28 "emitUnchanged": false,
29 "emitExpired": false,
30 "maxNotifyListings": 50,
31 "proxyConfiguration": {
32 "useApifyProxy": true,
33 "apifyProxyGroups": [
34 "RESIDENTIAL"
35 ]
36 }
37};
38
39
40const run = await client.actor("abotapi/jumia-marketplace-scraper").call(input);
41
42
43console.log('Results from dataset');
44console.log(`πΎ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
45const { items } = await client.dataset(run.defaultDatasetId).listItems();
46items.forEach((item) => {
47 console.dir(item);
48});
49
50