Mercado Libre scraper: get Mercado Libre product data as JSON, with a Python example
Scrape Mercado Libre search and product pages as JSON in 18 countries: price, discount, rating, reviews, stock and sold count, with a tested Python script.
A Mercado Libre scraper is any program that reads Mercado Libre's public pages and turns them into data: the title, price, original price, rating, review count, stock and sold count of each product. You can write one yourself with an HTTP client and an HTML parser, or you can call a Mercado Libre scraper API that returns the same fields as JSON and keeps up with page changes for you.
This guide covers the second route. It shows what a Mercado Libre search and a Mercado Libre product page return as data, using real requests made on 4 November 2026 against mercadolibre.com.mx, then gives a tested Python script of about 80 lines that searches Mercado Libre, reads each product page and saves the results to a CSV file. It ends with the things to check in Mercado Libre data before you rely on it, and a checklist for choosing a MercadoLibre scraper.
What does "Mercado Libre scraper" mean?
The phrase covers three things that are often mixed up:
| Route | What you build | What you maintain |
|---|---|---|
| Your own scraper | An HTTP client, an HTML parser and selectors for each field, for each country site | Selectors, request handling, retries, number formats and every layout change |
| A Mercado Libre scraper API | Calls to one endpoint that take a keyword or a product URL | Only your own code; the provider keeps the extraction working |
| An agent tool (MCP) | Nothing; your AI agent calls the tool when you ask in plain language | Nothing; you check the answers the agent gives |
Building your own is a reasonable choice for a one-off pull from one country. It gets expensive when you need several countries, because Mercado Libre runs a separate site per country (mercadolibre.com.mx, mercadolivre.com.br, mercadolibre.com.ar and so on), each with its own language, currency and number format. Mexico writes MX$1,199.00 with a decimal point; Brazil and Argentina use a decimal comma.
The rest of this guide uses datawebot, which reads Mercado Libre search and product pages in 18 Latin American countries and returns them as JSON, over REST for your code or MCP for your agent.
What can you get from a Mercado Libre search?
A search takes a keyword and a country site and returns the products on the results page, in page order. On 4 November 2026 at 08:43 UTC, a search for "audifonos inalambricos" (wireless earbuds) on mercadolibre.com.mx returned 50 products on the first page. Twelve of the 50 were sponsored listings, and each one came back with sponsored: true, so you can keep ads out of a price comparison.
Each result carries these fields:
| Field | Example from the run |
|---|---|
title |
Auriculares Bluetooth Jbl Tune 520BT Azul |
price |
{"amount": 453, "currency": "MXN", "text": "MX$453.00"} |
original_price |
The struck-through price when the page shows one, otherwise null |
rating |
4.9 |
url |
The product page, ending in its Mercado Libre ID (MLM44202830) |
image_url |
The listing's main image |
sponsored |
true for ads, false for organic results |
product_id |
An ID you pass to the product read for the full record |
The price keeps the page's own currency. It is never converted, so a search in Mexico returns MXN and a search in Brazil returns BRL. Review counts and stock are not on the search page; for those you read the product page.
A search reads one results page by default, and the endpoint can follow the page's next link for up to 10 pages. It does not apply Mercado Libre's filters or sorting, so build your keyword to be specific.
What can you get from a Mercado Libre product page?
A product read takes one product URL (an articulo. item page, or a www. page with /p/ in the path) and returns the full record. Here is the read of the pink Xiaomi Redmi Buds 6 Play on mercadolibre.com.mx, made on 4 November 2026 at 08:46 UTC:
| Field | Value |
|---|---|
title |
Xiaomi Auriculares inalámbricos Redmi Buds 6 Play Rosa, cancelación de Ruido… |
price |
MXN 267 |
original_price |
MXN 537 |
rating |
4.8 |
review_count |
233,221 |
availability |
in_stock |
details.stock |
51 (see "Stock looks capped" below) |
details.sold_count |
10,000 |
details.images |
8 image URLs |
Two things are worth knowing before you plan around these fields. The product read does not return the seller: details.seller is null on Mercado Libre, so you cannot tell which store a listing belongs to from this record. And in the read above, brand, category path and the specification table came back empty, so if you need the brand, take it from the title.
For how Mercado Libre's listings, catalogue products and variations relate to each other, see our guide to Mercado Libre product data.
How do you scrape Mercado Libre with Python?
The script below does the full job in one run: it searches a Mercado Libre country site for a keyword, reads each organic result's product page and writes one CSV row per product. It uses the standard library only and needs Python 3.9 or later.
Get access
Every account starts with 200 free credits, and sign-in is by email. The quickest way is to give your coding agent (Claude Code, Cursor or similar) this line:
set up https://mcp.datawebot.com/setup.md
The agent asks for your email and you approve the sign-in from the email datawebot sends. The key is saved to ~/.datawebot/credentials, readable only by you, and the script reads it from there. On a server or in CI, put the key in an environment variable named DATAWEBOT_API_KEY from your secret store instead, and never commit it.
The script
"""Search Mercado Libre for a keyword, read each organic result's product page
and save the fields to a CSV file. Standard library only."""
import csv, json, os, re, sys, time, urllib.request
API = "https://api.datawebot.com/v1/requests"
def api_key():
key = os.environ.get("DATAWEBOT_API_KEY")
if key:
return key
# Written by the agent setup (https://mcp.datawebot.com/setup.md).
with open(os.path.expanduser("~/.datawebot/credentials")) as f:
return json.load(f)["profiles"]["https://mcp.datawebot.com"]["api_key"]
def call(method, url, body=None):
req = urllib.request.Request(url, method=method,
data=json.dumps(body).encode() if body else None,
headers={"Authorization": "Bearer " + api_key(),
"Content-Type": "application/json",
"User-Agent": "mercadolibre-products-example/1.0"})
with urllib.request.urlopen(req, timeout=120) as r:
return json.loads(r.read())
def ask(body):
"""Send a request; when the answer is "working", poll until it is done."""
res = call("POST", API, body)
for _ in range(40):
if res.get("status") != "working":
return res
time.sleep(res.get("check_after_seconds") or 4)
res = call("GET", f"{API}/{res['request_id']}")
raise RuntimeError("still working after three minutes; try again later")
def item_id(url):
"""The Mercado Libre ID in the URL: MLM47259580, MLA..., MLB..."""
m = re.search(r"\b(M[A-Z]{2})-?U?(\d+)", url)
return m.group(1) + m.group(2) if m else ""
def amount(price):
return (price or {}).get("amount")
def main(query, site="mercadolibre.com.mx", country="MX", limit=5):
found = ask({"capability": "search", "query": query,
"site": site, "country": country, "limit": limit})
rows = []
for hit in found["products"]:
if hit.get("sponsored"): # keep ads out of the comparison
continue
p = ask({"capability": "product", "product_id": hit["product_id"]})["product"]
d = p.get("details") or {}
rows.append({
"item_id": item_id(p["url"]),
"title": p["title"],
"price": amount(p.get("price")),
"original_price": amount(p.get("original_price")),
"currency": (p.get("price") or {}).get("currency"),
"rating": p.get("rating"),
"review_count": p.get("review_count"),
"availability": p.get("availability"),
"stock": d.get("stock"),
"sold_count": d.get("sold_count"),
"url": p["url"],
"as_of": found["meta"]["as_of"],
})
with open("mercadolibre_products.csv", "w", newline="", encoding="utf-8") as f:
w = csv.DictWriter(f, fieldnames=list(rows[0]))
w.writeheader()
w.writerows(rows)
print(f"{len(rows)} products saved to mercadolibre_products.csv")
for r in rows:
print(f"{r['item_id']} {r['currency']} {r['price']} {r['rating']} ({r['review_count']}) {r['title'][:44]}")
if __name__ == "__main__":
main(" ".join(sys.argv[1:]) or "jbl tune 520bt")
Run it with a keyword:
python3 mercadolibre_products.py jbl tune 520bt
What it printed
This is the real output of the run on 4 November 2026 at 08:51 UTC. One search and five product reads cost 10 credits and took a little over four minutes in all, against 53 seconds for the same run on Amazon in our Amazon scraper guide. That is why the script polls for up to three minutes per request.
5 products saved to mercadolibre_products.csv
MLM64088265 MXN 636.6 4.9 (23984) Auriculares Jbl Pure Bass Bluetooth Tune 520
MLM25302803 MXN 462 4.8 (971) Audífonos Inalámbricos Jbl Tune 520bt Negro
MLM45457264 MXN 442 4.9 (16618) Auriculares Bluetooth Jbl Tune 520bt
MLM41009175 MXN 551.26 4.9 (802) Audifonos Jbl Tune 520 Bt Bluetooth On Ear C
MLM25557590 MXN 710.64 4.8 (11375) Audifonos Jbl Tune 520 Bt Bluetooth On Ear C
The CSV has the Mercado Libre ID, title, price, original price, currency, rating, review count, availability, stock, sold count, product URL and the time of the search for every row. The same headphones appear five times, from MXN 442 to MXN 710.64, because each colour and each listing has its own page. All five showed an original price above the current one.
Other Mercado Libre countries
Change site and country to read another country site, for example site="mercadolivre.com.br", country="BR" for Brazil, site="mercadolibre.com.ar", country="AR" for Argentina or site="mercadolibre.com.co", country="CO" for Colombia. Search in the site's own language (Portuguese in Brazil, Spanish elsewhere): local-language keywords return local listings. Prices come back in that site's currency. The endpoint covers 18 countries: Argentina, Bolivia, Brazil, Chile, Colombia, Costa Rica, the Dominican Republic, Ecuador, Guatemala, Honduras, Mexico, Nicaragua, Panama, Paraguay, Peru, El Salvador, Uruguay and Venezuela. The Mercado Libre endpoint page has an example request for each endpoint.
How do you get Mercado Libre data from an AI agent?
If you work in Claude, ChatGPT, Cursor or another agent that supports MCP, you do not need the script. After the setup line above, ask in plain language:
Use datawebot to search mercadolibre.com.mx for "jbl tune 520bt" and list the
organic results with price, original price, rating and link.
The agent calls search_products with site set to mercadolibre.com.mx, then get_product for any listing you want in full. When you want several pages of one search, it can run the Mercado Libre search endpoint as a Job with find_endpoints and submit_job. The answers are the same JSON as the REST API, so you can move from trying things in an agent to a scheduled script without changing what you get. The MCP server page lists every tool and how to connect each client.
What should you check in Mercado Libre data?
The runs above, plus a first run of the same script a few minutes earlier (08:47 UTC, before it skipped sponsored results), show seven things to watch for, whichever Mercado Libre scraper you use:
- Variants can share one review count. In the first run, the purple and blue JBL Tune 520BT were separate pages with separate IDs (MLM64088265 and MLM44202830), yet both reads returned 23,984 reviews; two other listings both returned 16,618. Mercado Libre appears to pool reviews across a catalogue product's colours and listings, so do not read a review count as one listing's sales signal.
- Sold counts are rounded. The sold counts came back as 100, 1,000, 5,000 and 10,000, because the page shows ranges such as "+5 mil vendidos" rather than exact numbers. Treat them as a band, not a count.
- A field can be missing on one read. In the first run, MLM45457264 came back with its price but no currency, availability or stock. Four minutes later the same page came back complete, at MXN 442. Check every row for empty fields before you aggregate, and read the page again if a field you need is missing.
- Stock looks capped. Every read that returned stock, across six different listings, returned exactly 51. That pattern points to a cap rather than a count, so read 51 as "more than 50" until you have confirmed a lower number on the page itself.
- Review counts need a product read. Search results carry the rating but not the review count. The script reads each product for that reason.
- The seller is not in the record. Five listings of the same headphones came back at five prices, and the record does not say who sells each one. If you need the seller, this endpoint is not enough on its own.
- Every price is a snapshot. The same listing, MLM45457264, read MXN 438 in the first run and MXN 442 four minutes later. Each answer is what the page showed at
meta.as_of. If you track prices, store that time with every row and read again on a schedule.
How do you choose a Mercado Libre scraper?
Use this checklist when you compare providers:
| Question | Why it matters |
|---|---|
| Which country sites does it cover, with the local currency? | Mercado Libre is one site per country, with different languages, currencies and number formats |
| Are sponsored results separated from organic ones? | About a quarter of the first page in our search was ads |
| Does a product read return the original price, stock and sold count? | Those are the fields that make Mercado Libre data useful for pricing and demand work |
| Is every answer labelled with the time it was read? | Without it you cannot tell a stale price from a current one |
| Are failed requests free? | You should not pay for a page that did not load |
| Can an AI agent call it, not only your code? | MCP support lets you test questions in an agent before writing code |
| Does it say what it does not return? | Seller details, exact sales and stored price history are often implied but not provided |
On the last point: datawebot reads what a public Mercado Libre page shows. It does not return the seller of a listing, exact sales or private seller data, and it does not keep price history for you. Your script and its CSV or database are the history.
What does it cost?
A Mercado Libre search costs 5 credits a page and a product read 1 credit. Failed requests are free; a page that loads but has no results is still charged. Every account starts with 200 free credits, enough for the script above about 20 times with five products each. More credits are one-time packs with no subscription, listed on the pricing page.
Frequently asked questions
What is a Mercado Libre scraper?
A program or API that reads Mercado Libre's public search and product pages and returns the fields as data: title, price, original price, rating, review count, stock, sold count and link. With a scraper API you send a keyword or a product URL and get JSON back, without maintaining selectors for each country site.
How do I scrape Mercado Libre with Python?
Send a search request with site set to the country site, such as mercadolibre.com.mx, then read each result's product page and write the fields to a CSV. The script in this guide does that in about 80 lines of standard-library Python, for 10 credits per run of five products.
Which Mercado Libre countries are supported?
Eighteen: Argentina, Bolivia, Brazil, Chile, Colombia, Costa Rica, the Dominican Republic, Ecuador, Guatemala, Honduras, Mexico, Nicaragua, Panama, Paraguay, Peru, El Salvador, Uruguay and Venezuela. Prices come back in each site's own currency.
Does it return sponsored products?
Yes, flagged. Each search result has sponsored: true or false, so you can keep ads out of your analysis. In our search on mercadolibre.com.mx, 12 of the 50 first-page results were sponsored.
Does it return the seller of a listing?
No. The Mercado Libre product record has no seller fields, so you cannot tell which store sells a listing from it. It does return stock and the sold count the page shows.
Is there a free Mercado Libre scraper API?
You can start free: every datawebot account gets 200 free credits with no card, enough for 40 searches or 200 product reads. After that, credits are one-time packs with no subscription.
Sources
- https://www.datawebot.com/llms.txt
- https://mcp.datawebot.com/setup.md
- https://www.datawebot.com/scraper/mercadolibre
- https://www.datawebot.com/blog/mercado-libre
- https://docs.python.org/3/library/csv.html
- https://docs.python.org/3/library/urllib.request.html
- https://docs.python.org/3/library/re.html
- https://modelcontextprotocol.io/specification/2025-06-18/server/tools
Give your agent ecommerce product data over MCP.
Every account starts with 200 free credits, with no subscription: a search costs 5 credits and a product read 1. Failed requests are free.