Docs

LLM Parse Website

LLM Parse Website

A Somnia Agents base agent that searches a domain or scrapes a URL in a real browser, then extracts structured data with an LLM and returns it, typed, to your contract.

LLM Parse Website is a base agent on Somnia Agents. A contract names a site, a prompt and the shape of the answer; the agent finds the pages (or scrapes the URL it was given), renders them in a real browser, converts the HTML to Markdown and has an LLM extract the fields, which come back ABI-encoded with a receipt of every step.

It runs on the Global L1, mainnet and testnet. It isn't registered on the Tokyo Subchain, where a request for it reverts with AgentNotFound.

Use it for data that is on a web page but not behind a JSON API: a price on a retail site, a headline, a result on a results page, a change on a page you watch. For a JSON API, JSON API Request is cheaper; for a prompt with no web page behind it, use LLM Inference.

How a request runs

  1. The contract sends a base URL, a prompt and the field to extract: a string, optionally chosen from a list, or a number.
  2. If resolveUrl is set, a search service finds the relevant pages on the domain; otherwise the agent fetches the URL as given.
  3. The pages are fetched in a browser, so JavaScript-rendered content is included, and converted to Markdown.
  4. An LLM extracts the fields the schema names from that context.
  5. The typed result and a receipt, one step per stage (request, search, fetch, convert, extract), are returned to the contract's callback.

See it in use

  • LLM Parse Website in Somnia Explorer. The registered agents of this type, with their methods and price. Each agent's page has Try it, which sends a request from your wallet and follows it until the validators agree.
  • Live requests. Every agent request as it is created, with each validator's signed receipt on its request page.

Use it from the CLI and MCP

The Somnia CLI and MCP server have no Somnia Agents commands yet. Send a request from a contract, as in Invoking from Solidity, or from a script with viem: each agent's page in the Explorer generates both. somnia explorer tx $HASH reads the transaction that sent a request (add --network testnet for a testnet one), as does the MCP server's explorer_transaction tool given the same network.

Reference

The methods (ExtractString, ExtractANumber and ExtractASignedNumber), their inputs, the receipt format and the price per subcommittee member are in the agent's reference page, LLM Parse Website. Calling any agent from Solidity is in Invoking from Solidity.

Every registered agent, with its methods and price, is in the Agents directory in the Somnia Explorer.

Send feedback

Agents: POST the same to /api/feedback.