Esm Scraper
Spider read esm.sh in 192 ms without a browser and returned 395 lines of clean markdown, including sections like "Fast", "Bundling Strategy" and "Tree Shaking".
## **Fast**You can also alias dependencies by adding `?alias=PACKAGE:ALIAS` to the import URL. This is useful when you want to use a different package for a dependency.`import useSWR from "https://esm.sh/swr?alias=react:preact/compat";`import useSWR from "https://esm.sh/swr?alias=react:preact/compat&deps=preact@10.5.14";### Bundling StrategyBy default, esm.sh bundles sub-modules of a package that are not shared by entry modules defined in the `exports` field of `package.json`.Bundling sub-modules can reduce the number of network requests, improving performance. However, it may result in repeated bundling of shared modules. In extreme cases, this can break package side effects or alter the `import.meta.url` semantics. To prevent this, you can disable the default bundling behavior by adding `?bundle=false`:`import "https://esm.sh/svelte?bundle=false";For package authors, it is recommended to define the `exports` field in `package.json`. This specifies the entry modules of the package, allowing esm.sh to accurately analyze the dependency tree and bundle the modules without duplication.Or you can override the bundling strategy by adding the `esm.sh` field to your `package.json`:"bundle": false // disables the default bundling behaviorYou can also add the `?standalone` flag to bundle the module along with all its external dependencies (excluding those in `peerDependencies`) into a single JavaScript file.`import { Button } from "https://esm.sh/antd?standalone";You can disable the default transforming/bundling behavior by adding `?raw` query to the import URL.`import { render } from "https://esm.sh/preact?raw";`> query is useful when you want to import the raw JavaScript source code of a package, as-is, without transformation into ES modules.### Tree ShakingBy default, esm.sh exports a module with all its exported members. However, if you want to import only a specific set of The same call, in code.
The capture above came back as markdown. These examples add a key, so you get browser rendering, proxies, and concurrency on esm.sh.
import { SpiderBrowser } from "spider-browser";
const spider = new SpiderBrowser({
apiKey: process.env.SPIDER_API_KEY!,
});
await spider.connect();
const page = spider.page!;
await page.goto("https://esm.sh");
// No selectors, no schema. Spider reads the page and names the fields.
const data = await page.scrape();
console.log(data);
await spider.close(); import { Spider } from "@spider-cloud/spider-client";
const spider = new Spider({ apiKey: process.env.SPIDER_API_KEY! });
const result = await spider.scrapeUrl("https://www.esm.sh", {
return_format: "markdown",
});
console.log(result); Ready for volume? Get an API key →
Fields you can pull.
Spider names these from the page. The capture above came back as markdown; the same
call with return_format: "json" returns them as keys.
What esm.sh costs to scrape.
The capture above cost $0.000113 to fetch. Pricing is $1 per GB of pre-transformation bandwidth plus $0.001 per CPU minute, so a page like this one lands at a fraction of a cent. Failed requests are billed at $0.
- Free balance on signup
- No card required to test
- Balance never expires
Run it keyless, no account
More International scrapers.
Mercado Libre Scraper
Extract product listings, seller ratings, pricing in local currencies, and shipping data from Mercado Libre.
Rakuten Scraper
Extract product listings, store ratings, cashback offers, and pricing data from Rakuten Japan marketplace.
Flipkart Scraper
Extract product listings, seller data, pricing in INR, and delivery estimates from Flipkart India store.
Start scraping esm.sh.
You already have the call. A key raises the rate limit and turns on browser rendering, proxies, and concurrency. Balance never expires, and top-ups go through secure checkout.