Skip to content

Batch Historical Price Data

POST /batch-prices-history

Base URL: https://api.openfish.fun

None required.

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
}
]
FieldTypeRequiredDescription
marketstringYesCondition ID of the market
intervalstringNoTime interval (reserved for future use)
fidelityintegerNoNumber of data points. Default: 50
startTsintegerNoBegin of the time range (UNIX timestamp)
endTsintegerNoEnd of the time range (UNIX timestamp)

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.

Terminal window
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}]'