If you build hardware, you have hit this: you have a BOM full of LCSC part codes
(C1591, C25804, the C##### numbers on every LCSC and JLCPCB line item), and you
want the live price ladder and stock as structured data — to cost a build, to
watch prices, or to enrich a component database. LCSC has no public pricing API, and
the search endpoints are protected. So how do you get the data cleanly?
This post shows the pragmatic approach, why the obvious ones break, and a zero-setup
way to get one clean JSON record per part.
Why the obvious approaches break
- Scraping the search API — it is rate-limited and CAPTCHA-protected; reverse- engineering it means fighting anti-bot systems that change often. High-maintenance.
- Headless-browser clicking — heavy, slow, and brittle against layout changes.
- Manual copy-paste — fine for three parts, not for a 200-line BOM you re-cost weekly.
The stable surface is the public product-detail page (/product-detail/...). It is
allowed by LCSC's robots.txt, it carries the full data (price tiers, stock, package,
MOQ, parametric specs, datasheet URL) in the page's own JSON, and it does not require a
login. Read that, one lightweight request per part, and you get reliable results
without an anti-bot arms race.
The data you actually want, per part
{
"productCode": "C1591",
"mpn": "CL10B104KB8NNNC",
"brand": "Samsung",
"description": "100nF ±10% 50V X7R 0603 MLCC",
"stock": 512340,
"package": "0603",
"minOrderQty": 50,
"priceTiers": [
{ "qty": 50, "usd": 0.0019 },
{ "qty": 500, "usd": 0.0011 },
{ "qty": 5000, "usd": 0.0007 }
],
"datasheetUrl": "https://...",
"url": "https://www.lcsc.com/product-detail/C1591.html"
}
Enter fullscreen mode Exit fullscreen mode
That is spreadsheet-ready and diff-able: store it, re-fetch weekly, and you can watch
price and stock move over time.
The zero-setup route
Rather than maintain scraper code yourself, you can run a hosted actor that does exactly
the above — reads only public product pages, returns one clean record per code:
LCSC Parts Scraper on Apify.
Input is just your list of codes:
{
"productCodes": ["C1591", "C25804", "C7593"],
"includePriceTiers": true,
"includeSpecs": true
}
Enter fullscreen mode Exit fullscreen mode
Call it from the API / CLI and pull the dataset as JSON or CSV:
# start a run and wait, then fetch the dataset
curl -s -X POST "https://api.apify.com/v2/acts/minty_modesty~lcsc-parts-scraper/runs?token=$APIFY_TOKEN" \
-H 'content-type: application/json' \
-d '{"productCodes":["C1591","C25804"],"includePriceTiers":true}'
Enter fullscreen mode Exit fullscreen mode
Because it reads public pages at low volume, it keeps working where search-API scrapers
get blocked. Feed it your BOM, get back cost data.
When to roll your own instead
If you only ever need a couple of parts, just open the product page. If you need
keyword → part codes, resolve codes first (from your BOM or on lcsc.com) — this
approach is deliberately code-first to stay on stable pages. And if you need account-
specific contract pricing, that lives behind your LCSC login and no public method will
reach it.
For the common case — turning a list of LCSC codes into clean, structured price/stock/
spec data for BOM costing or price monitoring — reading the public product pages is the
reliable path, and a hosted actor removes the maintenance entirely.
0 Comments
Log in to join the conversation.No comments yet. Be the first to share your thoughts.