HomeIntegrationsVercel AI SDK
Webcrawl + Vercel AI SDK
Use @webcrawl/client inside AI SDK tools and routes.
What exists
There is no official @webcrawl/ai-sdk package. In a Next.js or Vercel app using the Vercel AI SDK, call @webcrawl/client (or REST) from your own tool or route handler.
@webcrawl/client tool wrapper
import { createClient } from "@webcrawl/client";
const client = createClient({ apiKey: process.env.WEBCRAWL_API_KEY });
const page = await client.scrape({ url: "https://example.com" });
console.log(page.markdown);Wire that call into an AI SDK tool execute function, keep WEBCRAWL_API_KEY in server env, and never expose the key to the browser.
REST equivalent
curl -s -X POST https://webcrawl.app/v1/scrape \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com"}'Troubleshooting
- Run scrape only on the server (Route Handler, Server Action, or workflow).
- Set
baseUrlif you self-host the MIT engine.
FAQ
Is there an official Webcrawl package for the Vercel AI SDK?
No. Use @webcrawl/client (or REST) inside your own AI SDK tool definitions and route handlers. Webcrawl does not publish a separate @webcrawl/ai-sdk package.
How do credits work from a Vercel app?
Store WEBCRAWL_API_KEY in Vercel env vars and call the hosted API. Free accounts get 1,000 credits a month.
Can I self-host instead?
Yes. Point @webcrawl/client baseUrl at your self-hosted engine from the MIT webcrawl-anything repo.