# ScrapeMole Onchain DEX Price

> ScrapeMole Onchain DEX Price is a paid API for AI agents from onchain.scrapemole.workers.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-12).

Returns the current USD price of an ERC-20 token by querying Uniswap v3 liquidity pools on Base or Ethereum

## Facts

- Endpoint: GET https://onchain.scrapemole.workers.dev/v1/dex-price?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/scrapemole-onchain-dex-price-401e073a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_3_ry0sioU9ajgThm9O5Y-

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability scrapemole-onchain-dex-price-401e073a
```

Example prompt: What's the current USD price of the token at contract address 0x940181a94A35A4569E4529A3CDfB74e38FD98631 on Base — pull it from the Uniswap v3 DEX pools and tell me which pool has the best price and how deep the liquidity is.

## When to prefer this

Use this endpoint when you need the real-time on-chain DEX price for any ERC-20 token on Base or Ethereum, especially long-tail or newer tokens not listed on centralized exchanges or Chainlink price feeds. It is ideal for verifying the USD value of a token payment, checking liquidity depth before a swap, or pricing any ERC-20 by contract address. Prefer this over Chainlink-based price feeds (available on the same platform) when the token lacks a Chainlink oracle. The pay-per-call model with no charge on failure makes it low-risk for spot checks.

## Known failure modes

- Token contract address not found on the specified chain — returns error or empty pools array
- Token has no Uniswap v3 pool and cannot be priced — lowLiquidity flag may be true or no best pool returned
- Invalid contract address format — request rejected before charge
- Chain parameter mismatch (token exists on Base but Ethereum was specified) — no pool found
- Payment failure via x402 — call not executed and not charged
- Network/RPC timeout reading chain state — transient error, not charged on failure

## How this service works

Pay-per-call on-chain data for agents on Base and Ethereum, read directly from chain state: Chainlink USD prices (crypto, stablecoins, FX, metals; 10 per call), ERC-20 token info, wallet balances with USD values, transaction lookup with decoded ERC-20 transfers, ENS and Basename resolution (forward and reverse), gas and fee estimates in USD, and Uniswap v3 DEX prices for long-tail tokens (verify a payment arrived). USDC via x402; failed calls are never charged.

Payments: x402 v2, scheme "exact", USDC on Base (eip155:8453). The payment is verified before the work and settled only when the response is 200. Terms: https://onchain.scrapemole.workers.dev/terms

## Output

Returns a JSON object with the token's current USD price, best Uniswap v3 pool details (DEX name, fee tier, pool address, quote token, liquidity depth in USD, price in quote), the chain queried, the token contract address, the token symbol, and a lowLiquidity flag indicating whether the pool has sufficient depth for reliable pricing.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "token"
     ],
     "properties": {
      "chain": {
       "enum": [
        "base",
        "ethereum"
       ],
       "type": "string",
       "default": "base",
       "description": "Chain."
      },
      "token": {
       "type": "string",
       "examples": [
        "0x940181a94A35A4569E4529A3CDfB74e38FD98631"
       ],
       "description": "ERC-20 contract address."
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "best": {
   "dex": "uniswap-v3",
   "fee": 500,
   "pool": "0xE5B5f522E98B5a2baAe212d4dA66b865B781DB97",
   "quote": "USDC",
   "depthUsd": 257631,
   "priceInQuote": 0.943
  },
  "chain": "base",
  "pools": [],
  "token": "0x940181a94A35A4569E4529A3CDfB74e38FD98631",
  "symbol": "AERO",
  "priceUsd": 0.9437,
  "lowLiquidity": false
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/scrapemole-onchain-dex-price-401e073a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from onchain.scrapemole.workers.dev](https://www.zero.xyz/host/onchain.scrapemole.workers.dev/llms.txt)
