Agents
Framework adapters
Vercel AI SDK

Vercel AI SDK

Tools for the Vercel AI SDK (opens in a new tab) that let a model call the SuperScraper API: scrape, search, extract and map.

⚠️

Not on npm yet. @superscraper/vercel-ai cannot be installed with npm install today. Until it ships, define the tool yourself with ai's tool() helper around POST /v1/scrape. The API call is all it needs.

Install

The package is not on npm yet. It is available on request: contact support@superscraper.dev. ai and zod are peer dependencies (your app already has them).

Scrape in 5 lines

import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { superscraperTools } from '@superscraper/vercel-ai';
 
// Reads SUPERSCRAPER_API_KEY from the environment.
const { text } = await generateText({
  model: openai('gpt-4o'),
  tools: superscraperTools(),
  maxSteps: 5,
  prompt: 'Scrape example.com and return the page as markdown.',
});
console.log(text);

Tools

ToolEndpointReturns
superscraper_scrape/v1/scrapeclean markdown + structured JSON + provenance
superscraper_search/v1/searchweb results scraped into clean content
superscraper_extract/v1/extractstructured JSON (free JSON-LD cascade, or schema-LLM)
superscraper_map/v1/mapURLs found on a site

superscraperTools() returns the full set; you can also spread individual tools (e.g. { ...scrapeTool() }).