What problem does it solve?
It turns any public REST JSON response into a deterministic on-chain-ready value, removing the need to manually parse JSON off-chain and then reformat it for smart contracts.
Core Features & Use Cases
- Fetch-and-ABI-encode JSON values: Performs an HTTP GET, selects a value via dot-notation, then ABI-encodes it to a requested Solidity type (string, uint, int, bool, and array variants).
- Decimal scaling for fixed-point numbers: Converts JSON numeric values into
uint256/int256 using a caller-provided decimals precision rule suitable for prices and token amounts.
- Deterministic consensus-ready agent behavior: Supports Majority/Threshold style consensus patterns so multiple validator fetches can agree on the final value for oracle workflows.
Use cases include price feeds, weather oracles, sports-score markets, governance snapshots, and any contract needing REST API data delivered as strongly typed ABI results.
Quick Start
Use somnia-agents-json-fetch to read the value at selector bitcoin.usd from a CoinGecko Bitcoin price endpoint and return it as a uint256 scaled with decimals=8.