Appearance
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"] }| Format | Response field | What you get |
|---|---|---|
html (default) | content.html | The page HTML after preprocessing. |
text | content.text | Tag-free plain text: scripts/styles dropped, block tags become line breaks, entities decoded. |
markdown | content.markdown | Headings become #/##…, links become [text](url) with absolute URLs - the best input for LLM pipelines. |
json | content.json | Structured 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:
| Parameter | Type | Effect | Example |
|---|---|---|---|
includeOnlyTags | string[] | Keep only the listed tag blocks (allow-list). | ["main", "article", "table"] |
excludeTags | string[] | Strip the listed tag blocks (deny-list, applied after the allow-list). | ["script", "style", "nav", "footer"] |
removeBase64Images | boolean | Remove 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.
Related pages
- Data extraction - fill
content.jsonwith structured fields. - Request cost - output formats do not change the price; rendering and proxy class do.