ApiSkills

Web Scraping · 7 min

When there is no API — scraping vs APIs

Sometimes the data only lives in a web page. What scraping is, when to use it, and the one trap that catches everyone.

Not every source gives you an API. When the data you need only appears on a web page — a price, a listing, a table — you extract it straight from the page HTML. That is web scraping: fetch the HTML, then pick out the elements you want using CSS selectors.

API vs scraping

AspectAPI (JSON)Scraping (HTML)
Data formatStructured JSON, made for machinesHTML meant for humans; you extract the fields
StabilityA versioned contract; changes are announcedBreaks silently when the site markup changes
AccessOften needs a key / authUsually just fetch the public page
Your workParse JSONWrite and maintain selectors

Rule of thumb: if an API exists, use it — it is more stable and more polite to the source. Scrape when there is no API, or the API does not expose what you can plainly see on the page.

The one trap that catches everyone

A plain HTTP fetch (n8n HTTP Request node, Power Query Web.Contents) only sees the raw HTML the server sent — before any JavaScript runs. Many modern sites render their content with JavaScript after load, so the data is visible in your browser but absent from the raw HTML. Confirm with the browser View Page Source (not Inspect): if the data is missing there too, you need a headless-browser tool, not a plain fetch.

Tip · Practice against a real, stable page we host: /samples/store — a product listing with clean class names. Learn the selectors first in the interactive Scraping Lab at /scraping, then extract from that page.