Skip to content

Output formats ​

outputFormat controls what lands in the content object of the response. Request any combination - each format is produced from the same fetched page, so one request can return several views at once.

json
{ "url": "https://example.com", "outputFormat": ["html", "text", "markdown", "json"] }
FormatResponse fieldWhat you get
html (default)content.htmlThe page HTML after preprocessing.
textcontent.textTag-free plain text: scripts/styles dropped, block tags become line breaks, entities decoded.
markdowncontent.markdownHeadings become #/##…, links become [text](url) with absolute URLs - the best input for LLM pipelines.
jsoncontent.jsonStructured output of extraction: extractRules fields, emails, links.

Example: one request, three views ​

bash
curl -X POST "https://api.scrapeit.io/api/v1/scrape/web" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_SCRAPEIT_API_KEY" \
  -d '{
    "url": "https://example.com",
    "outputFormat": ["text", "markdown", "json"],
    "extractRules": { "title": "h1" }
  }'
js
const response = await fetch('https://api.scrapeit.io/api/v1/scrape/web', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': process.env.SCRAPEIT_API_KEY ?? 'YOUR_SCRAPEIT_API_KEY',
  },
  body: JSON.stringify({
    url: 'https://example.com',
    outputFormat: ['text', 'markdown', 'json'],
    extractRules: { title: 'h1' },
  }),
});
const { data } = await response.json();
console.log(data.content.markdown);
python
import os
import requests

response = requests.post(
    "https://api.scrapeit.io/api/v1/scrape/web",
    json={
        "url": "https://example.com",
        "outputFormat": ["text", "markdown", "json"],
        "extractRules": {"title": "h1"},
    },
    headers={"x-api-key": os.environ.get("SCRAPEIT_API_KEY", "YOUR_SCRAPEIT_API_KEY")},
)
print(response.json()["data"]["content"]["markdown"])

Response (content fragment):

json
{
  "content": {
    "text": "Example Domain This domain is for use in illustrative examples…",
    "markdown": "# Example Domain\n\nThis domain is for use in illustrative examples…\n[More information…](https://www.iana.org/domains/example)",
    "json": { "extractRules": { "title": "Example Domain" } }
  }
}

JSON is added automatically

When extractRules, extractEmails or extractLinks produce data, content.json is included even if you did not list json in outputFormat.

Shrinking the payload ​

Three preprocessing switches run before every format is produced, so they shrink html, text, markdown and extraction input alike:

ParameterTypeEffectExample
includeOnlyTagsstring[]Keep only the listed tag blocks (allow-list).["main", "article", "table"]
excludeTagsstring[]Strip the listed tag blocks (deny-list, applied after the allow-list).["script", "style", "nav", "footer"]
removeBase64ImagesbooleanRemove inline data:image/... src/srcset attributes - often megabytes of noise.true
json
{
  "url": "https://news.example.com/article/42",
  "outputFormat": ["markdown"],
  "includeOnlyTags": ["article"],
  "excludeTags": ["aside", "footer"],
  "removeBase64Images": true
}

This pattern - article only, junk stripped, markdown out - is the cheapest way to feed pages into an LLM: the payload usually drops by 80-95 %.

Raw HTML artifact ​

Independent of outputFormat, the fetched raw HTML is persisted as a raw_html artifact in the file registry for your plan's retention window, so you can re-process pages later without paying for a re-scrape.

  • Data extraction - fill content.json with structured fields.
  • Request cost - output formats do not change the price; rendering and proxy class do.

ScrapeIt Web Scraping API documentation. Managed web scraping services: www.scrapeit.io.