Integrations / AI frameworks / Vercel AI SDK
+
AI SDK agents,
on the live web.
The @zenrows/ai-sdk-tools package gives the Vercel AI SDK three ready-made tools: read a page, pull named fields out of it, or screenshot how it renders. One factory call, and no tool definition or fetch wrapper to write.
$npm install @zenrows/ai-sdk-tools
What the package
gives your agent.
- No tools to write
createZenrowsToolsreturnsscrapeUrl,extractDataandtakeScreenshot, with descriptions and schemas the model already understands. - The real page, not a block pagePages behind anti-bot systems, JavaScript rendering or geographic restrictions come back as ordinary text.
- Markdown, or just the fieldsPages arrive as Markdown, so context goes on content, not markup. When you know what you want,
extractDatareturns only the named fields. - The cost of every callEach tool result carries
creditsSpentandcostUsd, so a model can report what a piece of research cost.
Read a live page,
in one call.
import { generateText, isStepCount } from "ai"; import { anthropic } from "@ai-sdk/anthropic"; import { createZenrowsTools } from "@zenrows/ai-sdk-tools"; const zenrows = createZenrowsTools({ apiKey: process.env.ZENROWS_API_KEY!, }); const { text } = await generateText({ model: anthropic("claude-sonnet-5-5"), prompt: "Read https://www.scrapingcourse.com/ecommerce/ and name three products with their prices.", tools: zenrows, stopWhen: isStepCount(3), // room to call a tool, read it, answer });
The model calls scrapeUrl on its own and answers from the page. The same tools work unchanged in streamText and the SDK’s Agent class. Options and troubleshooting are in the AI SDK docs.
What people build with it.
- FetchResearch agents. A model reads several live sources and answers from them, rather than from its training data.
- ExtractCompetitive monitoring. Pull prices, titles or availability as named fields from pages that block ordinary requests.
- FetchRetrieval over the live web. Ground answers in pages too fresh to be indexed, fetched at the moment the model asks.
- FetchLayout and rendering questions.
takeScreenshothands a vision model a real image, so it can say what a page looks like, not only what it says.
Connect the AI SDK
today.
Install it from npm, read the docs, or see the package source. Also on Mastra and OpenAI Agents SDK.