Extract typed JSON

POSThttps://api.crawl4ai.com/extract

Pull structured, typed data out of a page with an instruction and/or a JSON schema. Give a URL (we fetch it) or your own content.

Request

curl https://api.crawl4ai.com/extract \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://news.ycombinator.com",
    "instruction": "the top stories on the front page",
    "schema": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "title":  { "type": "string"  },
          "points": { "type": "integer" },
          "url":    { "type": "string"  }
        },
        "required": ["title", "points"]
      }
    },
    "example": [
      { "title": "Show HN: My project", "points": 128, "url": "https://..." }
    ]
  }'

Body

url
string

Page to read. We fetch it for you.

content
string

Your own text/markdown/html to extract from, instead of a URL.

instruction
string

Plain-English description of what to pull out.

schema
object

JSON schema each returned record must match — gives you typed, predictable output.

example
object

A sample of the shape you want (structure, not values).

Note

Give a URL or content (plus an instruction and/or schema). Long pages are chunked and re-assembled automatically.

Try it with your key

Run this call in the playground and see the real answer, the time and the units.

Open the playground

Next

Something unclear or wrong on this page? Tell us.