# Web extract

> Read one web page and get typed JSON in the shape of your JSON Schema.

`web_extract` reads one web page and returns typed JSON, shaped by a JSON Schema you give: for example a product’s name, price and availability, or a list of a page’s events. Use it when you need specific fields from a page rather than its text; use [`web_scrape`](https://clonvo.com/docs/web-scrape.md) for the text. Add `prompt` to say what to extract in words.

Call it with `POST /v1/tools/web_extract`, or as `web_extract` over [MCP](https://clonvo.com/docs/mcp.md).

## Arguments

-   `url` string Required
    
    The http(s) URL of the page to extract from.
    
-   `schema` object Required
    
    JSON Schema of the data to return, with "type": "object" at the top, e.g. {"type": "object", "properties": {"price": {"type": "number"}}}. Use arrays of objects for lists.
    
-   `prompt` string
    
    What to extract, in words, when the schema alone doesn’t say it.
    

## Example

```bash
curl https://api.clonvo.com/v1/tools/web_extract \
  -H "Authorization: Bearer $CLONVO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "arguments": {
      "url": "https://www.postgresql.org/docs/18/release-18.html",
      "schema": {
        "type": "object",
        "properties": {
          "version": { "type": "string" },
          "release_date": { "type": "string" },
          "sections": { "type": "array", "items": { "type": "string" } }
        }
      },
      "prompt": "The release, its date, and the titles of the top-level sections."
    }
  }'
```

```json
{
  "id": "gen-01M6A1D4F6H8K0M2P4R6T8V0X2",
  "tool": "web_extract",
  "provider": "clonvo",
  "result": {
    "url": "https://www.postgresql.org/docs/18/release-18.html",
    "data": {
      "version": "18",
      "release_date": "2025-09-25",
      "sections": ["Overview", "Migration to Version 18", "Changes", "Acknowledgments"]
    }
  },
  "usage": { "cost": 0.01, "charged": 0.0102, "is_byok": false }
}
```

## Result

| Field | Description |
| --- | --- |
| `url` | The page that was read. |
| `data` | The extracted data, in the shape your schema describes. |
| `notes` | Present when the provider handled an argument differently. |

The fields around `result` (`id`, `tool`, `provider`, `usage`) are the same for every tool; see [Calling tools](https://clonvo.com/docs/calling-tools.md#response).

## Notes

-   `data` has the shape your schema describes. Providers fill what the page has, so a field the page doesn’t show can be missing or `null`. Check the fields you rely on before you use them.
-   The schema needs `"type": "object"` at the top. Use arrays of objects for lists.
-   The schema and `prompt` are free text you wrote, so they’re never stored as [web tool queries](https://clonvo.com/docs/privacy.md#web-tool-queries).