# Forex Pair Previous Close OHLCV (x402stock)

> Forex Pair Previous Close OHLCV (x402stock) is a paid API for AI agents from agents.x402stock.xyz, paid per call via MPP or x402, $0.01/call, status unknown (last checked 2026-09-11).

Returns open, high, low, close, volume, and VWAP for a foreign-exchange pair's most recently completed trading day as a single bar.

## Facts

- Endpoint: GET https://agents.x402stock.xyz/api/v1/forex/{pair}/prev-close
- Price: $0.01/call
- Payment: MPP, x402
- Status: unknown
- Last checked: 2026-09-11
- Activations on Zero: 0
- Provider: agents.x402stock.xyz
- Website: https://agents.x402stock.xyz
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agents-x402stock-xyz-forex-pair-previous-close-ohlcv-x402stock-ab854c45
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_J6VBXTeXxdkOFPu0xBufR

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 agents-x402stock-xyz-forex-pair-previous-close-ohlcv-x402stock-ab854c45
```

Example prompt: What were the open, high, low, and close prices for EUR-USD on the last completed trading day? I also want the VWAP and volume.

## When to prefer this

Use this endpoint when you need a quick single-bar daily OHLCV reference for a forex or crypto spot pair and do not require intraday or multi-day history. It is ideal for prior-close anchoring, overnight move detection, or seeding a daily signal without needing a full historical query. Prefer this over historical bar endpoints when only the most recent completed session is needed and you want minimal latency and cost ($0.01 per call).

## Known failure modes

- Unsupported or malformed pair symbol (e.g. missing hyphen) may return null data
- Pair not covered by the provider returns null data block
- Market not yet closed for current day — only the prior completed day is available
- Payment failure via x402 if USDC balance is insufficient
- Network timeout if the upstream data provider is slow

## How this service works

Open, high, low, close, volume, and VWAP for a foreign-exchange pair's most recent completed trading day. Pass the pair in the path as BASE-QUOTE, e.g. EUR-USD. One call returns one bar for a quick prior-close reference. From x402stock, a pay-per-call market & economic data API for AI agents. No API key or account; pay in USDC via x402.

## Output

A single JSON object containing the ticker symbol, data source ('x402stock'), the as_of timestamp, and a data object with open, high, low, close, volume, VWAP, trade_count, and a session timestamp for the most recently completed trading day of the specified forex pair. Data may be null if the pair is not found or data is unavailable.

## 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"
    },
    "pathParams": {
     "pair": {
      "type": "string"
     },
     "type": "object"
    },
    "queryParams": {
     "type": "object",
     "properties": {}
    }
   },
   "additionalProperties": false
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "ticker",
  "data",
  "source",
  "as_of"
 ],
 "properties": {
  "data": {
   "anyOf": [
    {
     "type": "object",
     "required": [
      "open",
      "high",
      "low",
      "close",
      "volume",
      "vwap",
      "trade_count",
      "timestamp"
     ],
     "properties": {
      "low": {
       "type": "number"
      },
      "high": {
       "type": "number"
      },
      "open": {
       "type": "number"
      },
      "vwap": {
       "anyOf": [
        {
         "type": "number"
        },
        {
         "type": "null"
        }
       ]
      },
      "close": {
       "type": "number"
      },
      "volume": {
       "type": "number"
      },
      "timestamp": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ]
      },
      "trade_count": {
       "anyOf": [
        {
         "type": "number"
        },
        {
         "type": "null"
        }
       ]
      }
     },
     "additionalProperties": false
    },
    {
     "type": "null"
    }
   ]
  },
  "as_of": {
   "type": "string"
  },
  "source": {
   "type": "string",
   "const": "x402stock"
  },
  "ticker": {
   "type": "string"
  },
  "feedback": {
   "type": "object",
   "required": [
    "endpoint",
    "method",
    "free",
    "note"
   ],
   "properties": {
    "free": {
     "type": "boolean"
    },
    "note": {
     "type": "string"
    },
    "method": {
     "type": "string",
     "const": "POST"
    },
    "endpoint": {
     "type": "string"
    }
   },
   "additionalProperties": false
  }
 },
 "additionalProperties": false
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agents-x402stock-xyz-forex-pair-previous-close-ohlcv-x402stock-ab854c45/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agents.x402stock.xyz](https://www.zero.xyz/host/agents.x402stock.xyz/llms.txt)
