Thanks to visit codestin.com
Credit goes to github.com

Skip to content

piotrv1001/mercado-libre-scraper-nodejs-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to Scrape Mercado Libre in Node.js

A minimal Node.js example showing how to scrape Mercado Libre product listings using the Mercado Libre Listings Scraper Apify actor. This repo does not implement a scraper from scratch — it calls a ready-made Apify actor that handles search, pagination, proxies, and parsing for you.

Mercado Libre listings scraped to JSON

What this example does

  • Calls the piotrv1001/mercado-libre-listings-scraper Apify actor
  • Passes a list of search queries and proxy configuration as input
  • Waits for the run to finish
  • Fetches results from the run's default dataset
  • Prints each scraped listing to the console

Prerequisites

Installation

npm install

Environment setup

Copy the example env file and add your token:

cp .env.example .env

Then edit .env:

APIFY_TOKEN=your_apify_token_here

Usage

npm start

You'll see a link to your dataset in the Apify console plus each listing logged to stdout.

Code example

import { ApifyClient } from 'apify-client';
import 'dotenv/config';

// Initialize the ApifyClient with your Apify API token
// Set APIFY_TOKEN in your .env file (copy .env.example to get started)
const client = new ApifyClient({
    token: process.env.APIFY_TOKEN,
});

// Prepare Actor input
const input = {
    "searchQueries": [
        "iphone 15"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("piotrv1001/mercado-libre-listings-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

Example output

See sample-output.json for a full example response. Each listing item includes:

  • id, siteId, title, permalink
  • price, currency, originalPrice, discountPercent, installments
  • condition, availableQuantity, soldQuantity
  • thumbnailUrl, images
  • location (city, state, country)
  • seller (nickname, official store flag, reputation, power seller status)
  • freeShipping, fullShipping
  • ratingAverage, reviewCount
  • attributes (brand, model, capacity, etc.)
  • variations, scrapedAt

Use cases

  • Price monitoring — track competitor prices and discounts across Mercado Libre marketplaces (MLA, MLM, MLB, and more)
  • Market research — analyze product availability, seller reputation, and review counts in Latin American e-commerce
  • Dropshipping — discover trending products by soldQuantity and import catalog data into your store
  • Lead generation — extract official stores and top sellers for outreach
  • Data enrichment — pull product attributes, images, and ratings to enrich your own catalog

Try the actor on Apify

Open the Mercado Libre Listings Scraper on Apify

Related resources

License

MIT

About

How to scrape Mercado Libre product listings in Node.js using an Apify actor — search, prices, sellers, ratings, and more.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors