Web Scrape

Extract content from any URL in markdown, HTML, or structured formats.

Web Scrape extracts content from any URL and returns it in your preferred format. Get clean markdown, raw HTML, structured JSON, or even screenshots.

Pricing

$0.0038 per page for basic scraping. Some formats count as additional pages:

What you're doingCost
Basic scrape (markdown, html, etc.)1 page
JSON extraction+4 pages
Question answering+4 pages
PDF parsing+1 page per PDF page

Basic usage

const result = await client.post('/v1/tools/web_scrape', {
  body: {
    url: 'https://example.com/article',
    formats: ['markdown']
  }
});

console.log(result.data.markdown);

Output formats

Choose one or more formats to get back:

FormatWhat you get
markdownClean, readable markdown text
htmlCleaned HTML content
rawHtmlOriginal HTML as-is (returned as data.raw_html)
summaryShort summary of the page
linksAll links found on the page
imagesAll images found on the page
screenshotVisual capture of the page
jsonStructured data extracted with a schema
questionAnswer to a specific question about the page (returned as data.answer)

Example with multiple formats

const result = await client.post('/v1/tools/web_scrape', {
  body: {
    url: 'https://news.example.com/article',
    formats: ['markdown', 'links', 'images']
  }
});

console.log(result.data.markdown);    // Article text
console.log(result.data.links);       // ['https://...', ...]
console.log(result.data.images);      // ['https://...', ...]

Clean content extraction

Remove headers, footers, and ads to get just the main content:

const result = await client.post('/v1/tools/web_scrape', {
  body: {
    url: 'https://blog.example.com/post',
    formats: ['markdown'],
    only_main_content: true,
    only_clean_content: true
  }
});

Structured data extraction

Extract specific fields using a JSON schema:

const result = await client.post('/v1/tools/web_scrape', {
  body: {
    url: 'https://store.example.com/product',
    formats: [
      {
        type: 'json',
        schema: {
          type: 'object',
          properties: {
            name: { type: 'string' },
            price: { type: 'number' },
            inStock: { type: 'boolean' }
          }
        }
      }
    ]
  }
});

console.log(result.data.json);
// { name: 'Widget Pro', price: 29.99, inStock: true }

Ask questions about a page

Get answers without parsing the content yourself:

const result = await client.post('/v1/tools/web_scrape', {
  body: {
    url: 'https://company.example.com/about',
    formats: [
      {
        type: 'question',
        question: 'When was this company founded and who are the founders?'
      }
    ]
  }
});

console.log(result.data.answer);
// "The company was founded in 2019 by Jane Doe and John Smith."

Handling dynamic pages

For JavaScript-heavy pages, wait for content to load:

const result = await client.post('/v1/tools/web_scrape', {
  body: {
    url: 'https://spa.example.com/dashboard',
    formats: ['markdown'],
    wait_for: 3000  // Wait 3 seconds for JS to render
  }
});

API Reference

For complete parameter documentation, see the API Reference.