HomeIntegrationsMastra
Webcrawl + Mastra
Use @webcrawl/client inside Mastra tools for scrape and map.
No official Mastra package
There is no @webcrawl/mastra package. Inside a Mastra tool execute handler, call @webcrawl/client with a server-side WEBCRAWL_API_KEY.
Client scrape helper
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);Map docs before scraping
import { createClient } from "@webcrawl/client";
const client = createClient({ apiKey: process.env.WEBCRAWL_API_KEY });
const mapped = await client.map({ url: "https://example.com/docs" });
console.log(mapped);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"}'Related: Vercel AI SDK, OpenAI Agents SDK.
FAQ
Do you ship an official Mastra integration?
No. Use @webcrawl/client or REST inside Mastra tools you maintain. There is no @webcrawl/mastra package.
How do I keep the API key safe?
Store WEBCRAWL_API_KEY in server env and only call Webcrawl from tool execute handlers that run on the server.
What is a good first tool?
A scrape tool that posts to /v1/scrape and returns markdown, plus an optional map tool for docs discovery.