← Back to ScrapeGraphAI
POST/api/scrape

Scrape a URL

Fetches a URL and returns the requested format(s): markdown, html, links, images, summary, json, branding, screenshot.

ScrapeGraphAI·Dynamic pricing

Dynamic pricing

(includesField(body.formats, 'type', 'markdown') ? 0.005 : 0) + (includesField(body.formats, 'type', 'html') ? 0.005 : 0) + (includesField(body.formats, 'type', 'links') ? 0.005 : 0) + (includesField(body.formats, 'type', 'images') ? 0.005 : 0) + (includesField(body.formats, 'type', 'summary') ? 0.005 : 0) + (includesField(body.formats, 'type', 'screenshot') ? 0.01 : 0) + (includesField(body.formats, 'type', 'json') ? 0.025 : 0) + (includesField(body.formats, 'type', 'branding') ? 0.125 : 0) + (get(body, 'fetchConfig.stealth', 0) ? 0.025 : 0)

Example code

// Using @orth/sdk - The simplest way to call APIs // Install: npm install @orth/sdk import Orthogonal from "@orth/sdk"; const orthogonal = new Orthogonal({ apiKey: process.env.ORTHOGONAL_API_KEY, }); const output = await orthogonal.run({ api: "scrapegraphai", path: "/api/scrape", body: { "url": "example" } }); console.log(output);

Body parameters

urlrequired
string

URL to scrape

formats
array

Output formats array. Each item has a type (markdown, html, screenshot, json, links, images, summary, branding) and optional mode (normal, reader, prune). Defaults to [{"type":"markdown","mode":"normal"}]

contentType
string

Force content type (text/html, application/pdf, image/jpeg, etc.)

fetchConfig
object

Fetch options: mode (auto/fast/js), stealth (bool), timeout (ms), wait (ms), headers, cookies, country (2-letter), scrolls (0-100)

Response

id
string
results.links.data.0
string
results.links.metadata.count
number
results.images.data.0
string
results.images.metadata.count
number
metadata.contentType
string
    Orthogonal - Giving AI agents the tools they need.