{"uid":"cap_5G_txC0aSAJQ8kY9pFUs0","slug":"agents-x402stock-xyz-x402stock-forex-historical-ohlcv-aggregates-96d367de","name":"x402stock Forex Historical 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","method":"GET","headers":{},"bodySchema":{"type":"object","required":["pair"],"properties":{"to":{"type":"string","default":"2026-07-31","minLength":1},"from":{"type":"string","default":"2025-07-31","minLength":1},"pair":{"type":"string","description":"Currency or crypto spot pair as BASE-QUOTE, e.g. EUR-USD or BTC-USD."},"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}}},"responseSchema":{"type":"object","required":["ticker","data","source","as_of"],"properties":{"data":{"type":"object","required":["bars","count"],"properties":{"bars":{"type":"array","items":{"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}},"count":{"type":"number"},"adjusted":{"type":"boolean"}},"additionalProperties":false},"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},"example":null,"exampleRequest":null,"tags":[],"displayCostAmount":"0.02","displayCostAsset":"USD","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":"mpp","network":"tempo","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"mpp","network":"tempo","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_KpafDbddII6EKPdz9xWVJ","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x20C000000000000000000000b9537d11c60E8b50","unit":"request","depositMicros":null,"planRef":null}],"brandName":"agents.x402stock.xyz","brandSlug":"agents-x402stock-xyz-mpp","brandBaseUrl":"https://agents.x402stock.xyz","brandDocsUrl":null,"whatItDoes":"Returns historical OHLCV candlestick bars for a foreign-exchange currency pair at a configurable timespan and multiplier, paid per call in USDC via x402.","exampleAgentPrompt":"Pull daily OHLCV bars for EUR-USD from January 1, 2024 to December 31, 2024, sorted ascending, so I can backtest a moving-average strategy on the euro-dollar pair.","exampleUseCases":[{"title":"Forex strategy backtesting","prompt":"Get me daily OHLCV bars for GBP-USD from 2023-01-01 to 2023-12-31 sorted ascending — I want to backtest a breakout strategy on the pound-dollar pair over last year."},{"title":"FX intraday charting","prompt":"Fetch hourly candlestick data for USD-JPY for the past 30 days so I can chart the yen's intraday price movements against the dollar."},{"title":"Macro rate trend analysis","prompt":"Pull monthly OHLCV aggregates for EUR-CHF going back five years — I'm analyzing long-term franc appreciation trends relative to the euro for a macro research report."}],"resultDescription":"An array of OHLCV bar objects each containing open, high, low, close, volume, VWAP, trade count, and timestamp, plus total bar count, the ticker symbol, adjusted flag, data source ('x402stock'), and an as-of timestamp. Up to 50,000 bars per call.","failureModes":["Invalid or unsupported currency pair format returns an error (pair must be BASE-QUOTE, e.g. EUR-USD)","Date range with no available data returns an empty bars array with count 0","Exceeding the limit maximum of 50,000 returns a validation error","Payment failure or insufficient USDC balance blocks the request via x402 protocol","Unsupported timespan value outside the enum causes a 400-level error"],"whenToPreferThis":"Choose this endpoint when you need historical candlestick (OHLCV) data for forex currency pairs for charting, backtesting, or macro/rate analysis. It supports flexible timespans from minute to year and does not require an API key — agents pay $0.02 per call in USDC via x402, making it suitable for autonomous agentic workflows. Prefer over stock or crypto OHLCV endpoints when the subject is a fiat currency pair.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T18:46:38.390Z","isFirstParty":false}