# Nightshift Labs Base Token Price API

> Nightshift Labs Base Token Price API is a paid API for AI agents from nightshift-x402.nightshift-labs.workers.dev, paid per call via x402, $0.003/call, status unknown (last checked 2026-11-18).

Returns the current USD price of any ERC-20 token on the Base blockchain, including best DEX routing and price impact data.

## Facts

- Endpoint: GET https://nightshift-x402.nightshift-labs.workers.dev/v1/base/token-price?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-18
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/nightshift-labs-base-token-price-api-31452201
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_hF0A22wOzP2rvnXBQHqIW

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 nightshift-labs-base-token-price-api-31452201
```

Example prompt: What's the current USD price of the token at contract address 0x940181a94A35A4569E4529A3CDfB74e38FD98631 on Base, and what's the best Uniswap route for it?

## When to prefer this

Use this endpoint when you need on-chain, DEX-sourced USD pricing for any ERC-20 token specifically on the Base blockchain, especially when you also want routing details and price impact estimates. Prefer this over CEX price feeds when the token is Base-native or not listed on major centralized exchanges. Ideal for DeFi agents, portfolio trackers, and trading bots that need real-time Uniswap-based prices with minimal setup.

## Known failure modes

- Invalid or non-ERC-20 contract address returns an error or empty quotes array
- Token with no liquidity on Base DEXes returns no price quotes
- Malformed address (not 42-char hex) rejected by input validation
- Network or RPC outage on Base may cause stale or unavailable pricing
- Payment failure via x402/USDC prevents the call from being processed

## How this service works

Live USD price of any ERC-20 token on Base from on-chain DEX quotes (Uniswap v3 0.05/0.3/1% pools and Aerodrome, against USDC and WETH; WETH converted with Chainlink ETH/USD). Returns the best executable route, every route's price, the price impact of selling $1,000, and flags for thin liquidity or disagreeing pools.

## Output

Returns a JSON object with the token's USD price, symbol, number of decimals, best DEX routing path (e.g. Uniswap v3 pool and fee tier), estimated price impact for a $1,000 sell, and any relevant flags about the token or liquidity.

## 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": [
      "address"
     ],
     "properties": {
      "address": {
       "type": "string",
       "pattern": "^0x[0-9a-fA-F]{40}$",
       "description": "ERC-20 token contract on Base"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "chain": "base",
  "flags": [],
  "quotes": [
   {
    "route": "uniswap-v3 0.05% → USDC",
    "priceUsd": 0.605941
   }
  ],
  "symbol": "AERO",
  "decimals": 18,
  "priceUsd": 0.605941,
  "bestRoute": "uniswap-v3 0.05% → USDC",
  "priceImpactSell1kUsd": "0.45%"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/nightshift-labs-base-token-price-api-31452201/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from nightshift-x402.nightshift-labs.workers.dev](https://www.zero.xyz/host/nightshift-x402.nightshift-labs.workers.dev/llms.txt)
