RAW HTTP — NO HEADLESS BROWSER OVERHEADMARKDOWN · JSON · HTML · LLM-READY FORMATSMCP SERVER FOR AI AGENTSTLS FINGERPRINT IMPERSONATIONEXTRACT · SUMMARIZE · DIFF · BRANDSITEMAP DISCOVERY & DEEP CRAWLINGSELF-HOST OR USE OUR CLOUD APIBUILT IN RUST — FAST BY DEFAULTDEEP RESEARCH — AI SYNTHESIZES REPORTS FROM 50+ SOURCESWEB SEARCH — QUERY AND SCRAPE SEARCH RESULTS IN ONE CALLAGENT SCRAPE — GIVE A GOAL, AI EXTRACTS WHAT YOU NEEDURL MONITORING — WATCH PAGES FOR CHANGES WITH WEBHOOKSBONUS CREDITS — EARN FREE CREDITS BY STARRING AND REFERRINGRAW HTTP — NO HEADLESS BROWSER OVERHEADMARKDOWN · JSON · HTML · LLM-READY FORMATSMCP SERVER FOR AI AGENTSTLS FINGERPRINT IMPERSONATIONEXTRACT · SUMMARIZE · DIFF · BRANDSITEMAP DISCOVERY & DEEP CRAWLINGSELF-HOST OR USE OUR CLOUD APIBUILT IN RUST — FAST BY DEFAULTDEEP RESEARCH — AI SYNTHESIZES REPORTS FROM 50+ SOURCESWEB SEARCH — QUERY AND SCRAPE SEARCH RESULTS IN ONE CALLAGENT SCRAPE — GIVE A GOAL, AI EXTRACTS WHAT YOU NEEDURL MONITORING — WATCH PAGES FOR CHANGES WITH WEBHOOKSBONUS CREDITS — EARN FREE CREDITS BY STARRING AND REFERRING

SDK INTEGRATION

Web scraping for Mastra

TypeScript-first AI framework with webclaw as a tool provider.

Mastra is a TypeScript framework for building AI applications with agents, workflows, and RAG. webclaw integrates as a tool that Mastra agents can call, providing web extraction with bot bypass and LLM-optimized output.

Setup

Mastra TypeScript — tool definition

import { createTool } from "@mastra/core";
import { Webclaw } from "@webclaw/sdk";
import { z } from "zod";

const wc = new Webclaw({ apiKey: process.env.WEBCLAW_API_KEY! });

export const scrapeWebTool = createTool({
  id: "scrape-web",
  description: "Scrape any URL and return clean markdown content",
  inputSchema: z.object({
    url: z.string().url(),
  }),
  execute: async ({ context }) => {
    const result = await wc.scrape({
      url: context.url,
      formats: ["markdown"],
    });
    return { markdown: result.markdown };
  },
});

Why webclaw for Mastra

  • TypeScript SDK with full type safety
  • Fits Mastra's createTool pattern
  • Fast enough for interactive workflow steps
  • Bot bypass for production scraping

Common use cases

  • Mastra agent workflows with web access
  • TypeScript RAG pipelines
  • Multi-step research workflows
  • Real-time data fetching for LLM apps

Frequently asked questions

How do I register webclaw as a Mastra tool?

Use createTool from @mastra/core and wrap a webclaw SDK call inside the execute function. Register the tool with your Mastra agent or workflow step.

Does webclaw work with Mastra workflows?

Yes. Include the webclaw tool in any workflow step that needs web data. The TypeScript SDK returns typed results that integrate cleanly with Mastra's Zod schemas.

Get started

500 pages/month free. No credit card. Open source.

Stay in the loop

Get notified when the webclaw API launches. Early subscribers get extended free tier access.

No spam. Unsubscribe anytime.