{"openapi":"3.1.0","info":{"title":"ROSHA Market Data API","version":"0.1.0","description":"ROSHA (روشا) is a market-data platform: clean Tehran Stock Exchange (TSE), Iran Fara Bourse (IFB) and Iranian mutual-fund data through a REST API and an MCP server. Prices are in Iranian rials; timestamps are Asia/Tehran; `ins_code` is a string. Dates accept ISO (2026-11-11), yyyymmdd or Jalali (1405-08-20). Documentation: https://poolick.ir/docs/ Errors: https://poolick.ir/docs/errors/ Free key: https://poolick.ir/panel/signup","termsOfService":"https://poolick.ir/terms/","contact":{"name":"ROSHA support","url":"https://poolick.ir/contact/"}},"paths":{"/v1/instruments":{"get":{"tags":["instruments"],"summary":"Search instruments","description":"Search by Persian ticker/name, InstrumentID or ISIN.","operationId":"search_instruments","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Search Instruments"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/instruments/{ref}":{"get":{"tags":["instruments"],"summary":"Instrument details","description":"`ref`: insCode, InstrumentID/ISIN, or Persian ticker (e.g. فولاد).","operationId":"get_instrument","parameters":[{"name":"ref","in":"path","required":true,"schema":{"type":"string","title":"Ref"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Instrument"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/instruments/{ref}/daily":{"get":{"tags":["history"],"summary":"Daily OHLCV history","description":"Daily open/high/low/close/last, volume, value (rials) and trade count, oldest first. `close` is the official closing price (قیمت پایانی), `last` the last trade. `limit` keeps the most recent rows in [start, end] (max 5000). `adjusted=true` back-adjusts prices for capital increases and dividends; volumes are not adjusted. `ref`: TSETMC insCode (e.g. 46348559193224090), 12-character InstrumentID/ISIN (IRO1FOLD0001) or exact Persian ticker (فولاد). Dates accept 2026-11-11, 20261111 or Jalali 1405-08-20. Needs the `history` data family.","operationId":"get_daily_history","parameters":[{"name":"ref","in":"path","required":true,"schema":{"type":"string","title":"Ref"}},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End"}},{"name":"adjusted","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Adjusted"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":5000,"default":1000,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Daily History"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/instruments/{ref}/adjustments":{"get":{"tags":["history"],"summary":"Price adjustment events","description":"Capital-increase and dividend events, oldest first: the closing price before (`close_unadjusted`) and after (`close_adjusted`) adjustment on the event day. The ratio adjusted/unadjusted rescales every earlier price, and day D too when the symbol was halted on D at the old price. `ref`: TSETMC insCode (e.g. 46348559193224090), 12-character InstrumentID/ISIN (IRO1FOLD0001) or exact Persian ticker (فولاد). Needs `history`.","operationId":"get_adjustments","parameters":[{"name":"ref","in":"path","required":true,"schema":{"type":"string","title":"Ref"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Get Adjustments"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/instruments/{ref}/client-type":{"get":{"tags":["history"],"summary":"Individual vs institutional flows","description":"Per day: buy/sell volume, value (rials) and trader count for individuals (`_i_`, حقیقی) and institutions (`_n_`, حقوقی), oldest first. `ref`: TSETMC insCode (e.g. 46348559193224090), 12-character InstrumentID/ISIN (IRO1FOLD0001) or exact Persian ticker (فولاد). Dates accept 2026-11-11, 20261111 or Jalali 1405-08-20. Needs `history`.","operationId":"get_client_type_history","parameters":[{"name":"ref","in":"path","required":true,"schema":{"type":"string","title":"Ref"}},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":5000,"default":1000,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Get Client Type History"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/instruments/{ref}/quote":{"get":{"tags":["intraday"],"summary":"Latest quote","description":"During market hours: the live snapshot (`source: live`) with a 5-level order book, refreshed every 30 s. Otherwise the last daily row (`source: daily`). `ref`: TSETMC insCode (e.g. 46348559193224090), 12-character InstrumentID/ISIN (IRO1FOLD0001) or exact Persian ticker (فولاد). Needs `intraday`.","operationId":"get_quote","parameters":[{"name":"ref","in":"path","required":true,"schema":{"type":"string","title":"Ref"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Quote"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/instruments/{ref}/trades":{"get":{"tags":["intraday"],"summary":"Tick trades of one day","description":"Every trade of `date` in order (up to 20,000 rows); cancelled trades are included and flagged. An empty list means no ticks are stored for that day. `ref`: TSETMC insCode (e.g. 46348559193224090), 12-character InstrumentID/ISIN (IRO1FOLD0001) or exact Persian ticker (فولاد). Needs `intraday`.","operationId":"get_trades","parameters":[{"name":"ref","in":"path","required":true,"schema":{"type":"string","title":"Ref"}},{"name":"date","in":"query","required":true,"schema":{"type":"string","title":"Date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Get Trades"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/instruments/{ref}/bars":{"get":{"tags":["intraday"],"summary":"Intraday OHLCV bars","description":"Bars of `minutes` (1-240) built from the ticks of `date`, cancelled trades excluded. `ref`: TSETMC insCode (e.g. 46348559193224090), 12-character InstrumentID/ISIN (IRO1FOLD0001) or exact Persian ticker (فولاد). Needs `intraday`.","operationId":"get_intraday_bars","parameters":[{"name":"ref","in":"path","required":true,"schema":{"type":"string","title":"Ref"}},{"name":"date","in":"query","required":true,"schema":{"type":"string","title":"Date"}},{"name":"minutes","in":"query","required":false,"schema":{"type":"integer","maximum":240,"minimum":1,"default":1,"title":"Minutes"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Get Intraday Bars"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/indices/{ref}/daily":{"get":{"tags":["history"],"summary":"Daily index values","description":"Close, low and high per day, oldest first. Indices are instruments too: find them with /v1/instruments?q=شاخص کل. Dates accept 2026-11-11, 20261111 or Jalali 1405-08-20. Needs `history`.","operationId":"get_index_history","parameters":[{"name":"ref","in":"path","required":true,"schema":{"type":"string","title":"Ref"}},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":5000,"default":1000,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Get Index History"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/calendar":{"get":{"tags":["market"],"summary":"Trading days in a range","description":"Dates on which the market traded, derived from market data. `start` and `end` are required. Dates accept 2026-11-11, 20261111 or Jalali 1405-08-20.","operationId":"get_trading_days","parameters":[{"name":"start","in":"query","required":true,"schema":{"type":"string","title":"Start"}},{"name":"end","in":"query","required":true,"schema":{"type":"string","title":"End"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"string","format":"date"},"title":"Response Get Trading Days"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/funds":{"get":{"tags":["funds"],"summary":"List and search mutual funds","description":"Funds with their latest published NAV, net assets, returns and asset mix.","operationId":"search_funds","parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q"}},{"name":"fund_type","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Fund Type"}},{"name":"active","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Active"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Search Funds"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/funds/types":{"get":{"tags":["funds"],"summary":"Fund type codes","description":"Fund type codes and their Persian names (4 fixed income, 6 equity, 7 mixed, ...).","operationId":"get_fund_types","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response Get Fund Types"}}}}}}},"/v1/funds/{ref}":{"get":{"tags":["funds"],"summary":"Fund profile and latest values","description":"Profile, sub-funds (umbrella funds), latest values and dividends.","operationId":"get_fund","parameters":[{"name":"ref","in":"path","required":true,"schema":{"type":"string","title":"Ref"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Fund"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/funds/{ref}/history":{"get":{"tags":["funds"],"summary":"Daily fund history","description":"Daily NAV, net assets, units issued/redeemed, returns, asset mix, ownership, alpha/beta.","operationId":"get_fund_history","parameters":[{"name":"ref","in":"path","required":true,"schema":{"type":"string","title":"Ref"}},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":5000,"default":1000,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Fund History"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/funds/{ref}/snapshots":{"get":{"tags":["funds"],"summary":"Per-sub-fund daily values","description":"Per-sub-fund daily values as published (the only per-sub-fund series for umbrella funds).","operationId":"get_fund_snapshots","parameters":[{"name":"ref","in":"path","required":true,"schema":{"type":"string","title":"Ref"}},{"name":"group_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Group Id"}},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":5000,"default":1000,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Fund Snapshots"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"API key: Authorization: Bearer rosha_xxxxxxxx_your-secret"},"apiKey":{"type":"apiKey","in":"header","name":"X-API-Key"}}},"servers":[{"url":"https://poolick.ir","description":"Production"}],"externalDocs":{"description":"Documentation (Persian; code in English)","url":"https://poolick.ir/docs/"},"security":[{"bearer":[]},{"apiKey":[]}]}