Cheerio
by Cheerio (open source project)
Read and change web page code in JavaScript.
1. Price
No free tier on the pricing page. As reported on the official pricing page, checked Oct 10, 2026.
cheerio.js.org2. Commercial use
“Permission is hereby granted, free of charge, to any person obtaining a copy of this software”
MIT allows use in paid products free of charge.
github.com/cheeriojs/cheerio/blob/main/LICENSE3. Key & sign-up
“Only load is available in the browser.”
None. It is a library that runs in your own code; there is no account, key or Cheerio service.
cheerio.js.org/docs/basics/loadingChecked against the maker's official pages, pricing on Oct 10, 2026. Tap a verdict to see its source.How we checkedReport an error
What Cheerio does
Cheerio is a free, open-source code library, not an online service. Your app or script gives it the code of a web page and gets back exactly the parts it asks for, such as product names, prices or links. It can also change that page code, and it runs inside your own program, with no account and no key.
- Cheerio is one of 25 APIs in the Scraping and crawling category on AgentGid.
- It is one of 20 that can be started for free.
- 12 of them ship an official MCP server; Cheerio does not.
- Its official SDK is the 1st most downloaded in the category (37.2M a week).
What people build with it
Pull prices and names from a page
Read a shop or catalog page your script has downloaded and get each product's name, price and link as a neat list.
Turn repeated blocks into records
A page lists many similar blocks, like releases, jobs or reviews; describe one block once and get every block back as a record.
Change page code before saving it
Edit an HTML template or e-mail on the server, for example replace a heading or add a class, then save the result.
Read a sitemap or feed
Load an XML file such as a sitemap or news feed from a web address and list its entries.
Clean page text for an AI assistant Idea
Take only the readable text of an article, without scripts and styles, before sending it to a chat model to summarize.
Check your own pages before publishing Idea
In a build step, scan every generated page for images without alt text or pages without a title.
Cheerio popularity
SDK downloads from npm and PyPI, weekly. Numbers as of Nov 17, 2026.
Pricing
None
No monthly plan
—
Library, not a hosted API: free to use, does not fetch or render JavaScript itself.
As reported on the official pricing page, checked Oct 10, 2026. Prices change: confirm before you buy.
Key and access
None. It is a library that runs in your own code; there is no account, key or Cheerio service.
noneNo
Commercial use and your data
Free for any use, including paid products and client work, under the MIT license. Keep the copyright and license notice with copies of the code; no visible credit is needed.
MIT allows use in paid products free of charge.
“Permission is hereby granted, free of charge, to any person obtaining a copy of this software” source
Shipping the code inside your app is allowed if the MIT copyright and permission notice stays with it.
“The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.” source
MIT places no limit on who you build for.
“Permission is hereby granted, free of charge, to any person obtaining a copy of this software” source
Errors to handle
The selector uses a browser-only state (:focus, :target, :lang) that Cheerio does not support.
Remove that part of the selector; match on structure, classes or data- attributes instead.
The website answered with a non-2xx status, such as 404 or 500.
Read the status code on the error; retry later for 5xx, fix the address for 404.
The address returned something that is not HTML or XML, such as a PDF.
Check the address; handle other file types with another tool.
requestOptions was passed to fromURL without a method.
Add method: 'GET' to requestOptions.
Use it from an agent
2 of 6: llms.txt no, OpenAPI no, SDK yes, MCP no, status page no, AI assistants allowed yes
Checked Nov 13, 2026.
None found
npm install cheerioAlternatives
Cheerio This page
Pick Firecrawl when you want a hosted service that also opens script-heavy pages and returns clean text for AI; our catalog lists about $5 per 1,000 pages (list price on 2026-11-10).
Pick Crawl4AI for an open-source crawler that renders pages and writes AI-friendly text, run yourself or as a hosted service.
Pick Apify when you want ready-made scrapers for popular sites plus hosting and proxies, instead of writing selectors.
Get started
Tell your AI assistant
“Use cheerio 1.2.0 on the server: load the HTML, read the products with $.extract into a list of { name, price, link }, set baseURI so links are absolute, and never pass a user-typed URL or selector straight in.”
Load the page code with load, then select elements with CSS selectors, like in jQuery.
import * as cheerio from 'cheerio'; const $ = cheerio.load('<h2 class="title">Hello world</h2>'); $('h2.title').text(); // "Hello world"To have Cheerio download the page itself, use fromURL and await it (Node.js only).
import * as cheerio from 'cheerio'; const $ = await cheerio.fromURL('https://example.com');
First request
Cheerio is a library, not a hosted service; this is the smallest example from its home page and README, and our demo ran the same calls.
import * as cheerio from 'cheerio';
const $ = cheerio.load('<h2 class="title">Hello world</h2>');
$('h2.title').text('Hello there!');
$('h2').addClass('welcome');
$.html();//=> <html><head></head><body><h2 class="title welcome">Hello there!</h2></body></html>Mistakes to avoid
Cheerio does not run scripts, so content built in the browser is not in the HTML it got.
html() and other insert methods parse their input as markup, so user text can inject tags; text() escapes it.
A quote in the value breaks out of the selector; Cheerio has no CSS.escape.
requestOptions has no default method, and your headers replace Cheerio's defaults instead of adding to them.
text() on many elements joins them into one run-on string with no separator.
Questions
Do I need an account or a key?
No. Cheerio is a code library you install; nothing is sent to a Cheerio service.
Why is my selection empty on some sites?
The content is probably built by the page's scripts, which Cheerio does not run. Check the HTML you received; for such pages use Puppeteer or Playwright.
Can I use it in a commercial product?
Yes. It is MIT licensed; keep the license notice with copies of the code.
Does it work in the browser?
Yes, with the load function only; fetching and stream loaders need Node.js.