{"uid":"cap_PFNlJezordNNDsWDcmADO","slug":"x402stock-forex-ohlcv-aggregates-3a9e7b4c","name":"x402stock Forex OHLCV Aggregates","description":"Historical OHLCV bars for a foreign-exchange pair at the requested multiplier and timespan (minute, hour, day, week, month) between `from` and `to`. Pass the pair in the path as BASE-QUOTE, e.g. EUR-USD or USD-JPY. Use for FX charting, backtesting, and macro/rate analysis. From x402stock, a pay-per-call market & economic data API for AI agents. No API key or account; pay in USDC via x402.","url":"https://agents.x402stock.xyz/api/v1/forex/:pair/aggregates?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"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":{"to":{"type":"string","default":"2026-07-31","minLength":1},"from":{"type":"string","default":"2025-07-31","minLength":1},"sort":{"enum":["asc","desc"],"type":"string","default":"asc"},"limit":{"type":"integer","default":5000,"maximum":50000,"exclusiveMinimum":0},"adjusted":{"type":"boolean","default":true},"timespan":{"enum":["minute","hour","day","week","month","quarter","year"],"type":"string","default":"day"},"multiplier":{"type":"integer","default":1,"maximum":50000,"exclusiveMinimum":0}}}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_D5tGuUI09CGgiOR9v566h","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns historical OHLCV (open, high, low, close, volume) candlestick bars for a foreign-exchange currency pair over a specified date range and timespan granularity.","exampleAgentPrompt":"Pull daily OHLCV bars for EUR-USD from January 1 2025 to June 30 2025, sorted ascending, so I can backtest my momentum strategy.","exampleUseCases":[{"title":"FX strategy backtesting","prompt":"Get me hourly OHLCV candles for GBP-USD from March 1 2025 to June 30 2025 in ascending order — I want to backtest a mean-reversion strategy on the data."},{"title":"Macro rate trend charting","prompt":"Fetch daily USD-JPY price bars from January 1 2024 to December 31 2024 so I can chart how the yen moved against the dollar during the Bank of Japan rate shifts last year."},{"title":"Weekly FX aggregates for reporting","prompt":"I need weekly open, high, low, close data for EUR-USD covering all of 2024 — from January 1 2024 to December 31 2024, sorted ascending, for a quarterly macro report."}],"resultDescription":"An array of OHLCV candlestick bars for the requested currency pair and time window. Each bar contains timestamp, open, high, low, close, and volume values at the requested granularity (minute, hour, day, week, or month), sorted as requested (ascending or descending).","failureModes":["Invalid currency pair format (e.g. missing hyphen or unsupported pair) returns 400 or empty result","Date range too large for the selected timespan/limit combination may truncate results — use limit and pagination","Invalid timespan enum value returns validation error","from date after to date returns empty or error","Payment failure via x402 (insufficient USDC balance) blocks the call entirely","Unsupported or illiquid currency pair may return empty bars array"],"whenToPreferThis":"Choose this endpoint when you need historical OHLCV candlestick data for a foreign-exchange pair across flexible granularities (minute through month) without managing API keys — ideal for FX backtesting, charting, or macro analysis where pay-per-call USDC pricing is preferred over a subscription. Prefer over generic data providers when running AI agent workflows that require lightweight, on-demand access without account setup.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-02T12:42:20.217Z","isFirstParty":false,"canonicalSlug":"x402stock-forex-ohlcv-aggregates-3a9e7b4c"}