Actor picture

Walmart Scraper

tugkan/walmart-scraper

Scrape millions of product data from Walmart. Crawl and extract descriptions, images, brand details, prices, variations and all other product details. You can specify search terms, filters, categories, list pages and much more.

Free trial for 7 days

Then $5/month

No credit card required now

Author's avatarTuğkan Cengiz
  • Modified
  • Users23
  • Runs181
Actor picture

Walmart Scraper

Free trial for 7 days

Then $5/month

To run the code examples, you need to have an Apify account. Replace <YOUR_API_TOKEN> in the code with your API token. For a more detailed explanation, please read about running actors via the API in Apify Docs.

const { ApifyClient } = require('apify-client');

// Initialize the ApifyClient with API token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare actor input
const input = {
    "startUrls": [
        {
            "url": "https://www.walmart.com/browse/auto-tires/brake-pads/91083_1074765_9038935_4582920"
        },
        {
            "url": "https://www.walmart.com/browse/home/"
        },
        {
            "url": "https://www.walmart.com/search?grid=true&query=Mixed+Bouquets"
        },
        {
            "url": "https://www.walmart.com/ip/Mainstays-Blue-Sunflower-Mix-Bouquet/155345382"
        }
    ],
    "maxItems": 50,
    "endPage": 1,
    "extendOutputFunction": ($) => {
        const result = {};
        // Uncomment to add a title to the output
        // result.title = $('title').text().trim();
    
        return result;
    },
    "outputFilterFunction": (object) => ({...object}),
    "proxy": {
        "useApifyProxy": true
    }
};

(async () => {
    // Run the actor and wait for it to finish
    const run = await client.actor("tugkan/walmart-scraper").call(input);

    // Fetch and print actor results from the run's dataset (if any)
    console.log('Results from dataset');
    const { items } = await client.dataset(run.defaultDatasetId).listItems();
    items.forEach((item) => {
        console.dir(item);
    });
})();