Batch Historical Price Data
Endpoint
Section titled “Endpoint”POST /batch-prices-history
Base URL: https://api.openfish.fun
Authentication
Section titled “Authentication”None required.
Request Body
Section titled “Request Body”The body is a JSON array of price history request objects. Each object specifies a market and optional time/fidelity constraints.
[ { "market": "0x0000...0001", "fidelity": 50, "startTs": 1699900000, "endTs": 1700000000 }, { "market": "0x0000...0002", "fidelity": 100 }]| Field | Type | Required | Description |
|---|---|---|---|
market | string | Yes | Condition ID of the market |
interval | string | No | Time interval (reserved for future use) |
fidelity | integer | No | Number of data points. Default: 50 |
startTs | integer | No | Begin of the time range (UNIX timestamp) |
endTs | integer | No | End of the time range (UNIX timestamp) |
Response
Section titled “Response”A JSON object keyed by condition ID, where each value contains the price history for that market.
{ "0x0000...0001": { "history": [ { "t": 1699900000, "p": 0.45 }, { "t": 1700000000, "p": 0.50 } ] }, "0x0000...0002": { "history": [ { "t": 1700000000, "p": 0.72 } ] }}When no historical data exists for a given market, the current price is returned as a single data point.
curl -X POST https://api.openfish.fun/batch-prices-history \ -H "Content-Type: application/json" \ -d '[{"market":"0x0000...0001","fidelity":50},{"market":"0x0000...0002","fidelity":100}]'