npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@spider-cloud/ai-sdk

v0.1.0

Published

Spider scrape, crawl, search and links tools for the Vercel AI SDK

Readme

@spider-cloud/ai-sdk

Spider tools for the Vercel AI SDK. They give a model four tools that call the Spider API:

| Tool | Route | What the model gets | |---|---|---| | scrape | POST /scrape | One page as markdown, text or raw HTML | | crawl | POST /crawl | The content of each page found from a start URL | | search | POST /search | Ranked results with title, description and URL, or each result's page content | | links | POST /links | The URLs linked from a page or a short crawl |

The package has no runtime dependencies. It calls the API with fetch and declares ai and zod as peer dependencies.

Install

npm install @spider-cloud/ai-sdk ai zod

API key

Create a key at spider.cloud/api-keys and set it in the environment:

export SPIDER_API_KEY=your-key

scrape also works without a key, on a rate limited keyless tier. crawl, search and links need a key and throw before sending a request when none is set.

Use

import { generateText, isStepCount } from "ai";
import { spiderTools } from "@spider-cloud/ai-sdk";

const { text } = await generateText({
  model: "openai/gpt-5-mini",
  prompt: "Find the latest Rust release notes and summarize the main changes.",
  tools: spiderTools(),
  stopWhen: isStepCount(5),
});

console.log(text);

Pick single tools if the model only needs some of them:

import { spiderScrape, spiderSearch } from "@spider-cloud/ai-sdk";

const tools = {
  search: spiderSearch({ maxResults: 5 }),
  scrape: spiderScrape({ maxContentChars: 20_000 }),
};

Options

Every tool factory takes the same base options:

| Option | Default | Meaning | |---|---|---| | apiKey | process.env.SPIDER_API_KEY | Spider API key | | baseUrl | https://api.spider.cloud | API base URL | | fetch | global fetch | Custom fetch, for tests or proxies | | headers | none | Extra headers on every request | | maxContentChars | no limit | Cut each page's content to this length before it reaches the model | | params | none | Spider request fields sent on every call, such as { request: "browser", readability: true }. The model's arguments override them. |

spiderCrawl and spiderLinks also take maxPages (default 20), the largest limit the model may ask for. spiderSearch takes maxResults (default 10). The schema rejects larger values before any request goes out, so a model cannot start a large crawl by itself.

The full list of request fields is in the OpenAPI spec.

Errors

A non 2xx answer throws SpiderApiError with status, body and, on 429, retryAfter in seconds from the Retry-After header. The AI SDK passes the error message to the model as a tool error.

Compatibility

The source builds against ai 5, 6 and 7. The tests run against ai 7.

Develop

npm install
npm run typecheck
npm test
npm run build

The tests mock fetch and never call the network.

License

MIT