# Mangrove Market Data Segment

> Mangrove Market Data Segment is a paid API for AI agents from api.mangrovedeveloper.ai, paid per call via x402, $0.02/call, status unknown (last checked 2026-11-04).

Fetches historical OHLCV candlestick market data for a specified asset, date window, and trading venue

## Facts

- Endpoint: GET https://api.mangrovedeveloper.ai/api/v1/market-data/segment?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-04
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/mangrove-market-data-segment-914ecbb0
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_wRM8KoOul-3dBAXWONGHf

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 mangrove-market-data-segment-914ecbb0
```

Example prompt: Can you pull the daily candlestick data for BTC quoted in USDC on Coinbase from 2025-01-01 to 2025-03-31?

## When to prefer this

Use this endpoint when you need historical OHLCV candlestick data for a specific asset and date range, especially within the Mangrove Agent ecosystem. Prefer it when you need venue-specific data, flexible candle sizes (hourly, daily), or want to integrate market history into an AI agent workflow that uses MCP or x402 micropayment rails.

## Known failure modes

- Missing required asset or date window returns a validation error
- Specifying both window_file and asset+dates simultaneously may result in a conflict error
- Invalid candle_size format (e.g. unsupported intervals) returns a bad request error
- Unknown asset symbol or quote token returns a not-found or empty result
- Unsupported market_data_venue may return an error or fall back to server default
- Request outside available historical data range returns empty or partial results
- Payment failure (insufficient USDC) blocks the request with a 402 response

## How this service works

Developer references for Mangrove Agent, API contracts, MCP and AI integrations.

## Output

Returns historical candlestick (OHLCV) market data for the requested asset, date window, candle size, and trading venue. Each record typically includes open, high, low, close, and volume values for the specified interval, segmented according to the requested time range.

## 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",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "asset": {
       "type": "string",
       "description": "Asset symbol, e.g. BTC or ETH."
      },
      "end_date": {
       "type": "string",
       "description": "ISO end of the window."
      },
      "provider": {
       "type": "string",
       "description": "Optional upstream override; omitted uses the existing server default."
      },
      "start_date": {
       "type": "string",
       "description": "ISO start of the window, e.g. 2026-01-01."
      },
      "candle_size": {
       "type": "string",
       "default": "1d",
       "description": "Duration of one candle, e.g. 1h or 1d."
      },
      "quote_token": {
       "type": "string",
       "description": "Quote currency of the requested market."
      },
      "window_file": {
       "type": "string",
       "description": "A catalog window's file name, classified as it stands. Supply this or the asset with both dates, not both."
      },
      "market_data_venue": {
       "type": "string",
       "description": "Exact venue of the requested market."
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/mangrove-market-data-segment-914ecbb0/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.mangrovedeveloper.ai](https://www.zero.xyz/host/api.mangrovedeveloper.ai/llms.txt)
