← Back to ScrapeGraphAI
POST/api/extract

Extract Structured JSON

LLM-driven extraction from a URL, HTML, or markdown input with a prompt and optional JSON schema.

ScrapeGraphAI·Dynamic pricing

Dynamic pricing

0.025 + (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/extract", body: { "prompt": "example" } }); console.log(output);

Body parameters

promptrequired
string

Extraction prompt (1-10000 chars)

url
string

URL to extract from

html
string

Raw HTML to extract from

markdown
string

Markdown to extract from

schema
object

JSON schema for structured output

mode
string

Content mode: normal, reader, or prune

contentType
string

Force content type

fetchConfig
object

Fetch options: mode, stealth, timeout, wait, headers, cookies, country, scrolls

Response

id
string
raw
null
json.job_title
null
json.company_name
string
json.job_location
string
json.company_domain
string
usage.promptTokens
number
usage.completionTokens
number
metadata.chunker.chunks.0.size
number
    Orthogonal - Giving AI agents the tools they need.