{"openapi":"3.1.0","info":{"title":"TradingHours API","description":"REST API for TradingHours market and currency data","version":"0.6.0"},"paths":{"/health":{"get":{"summary":"Health Check","description":"Health check endpoint.","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/info":{"get":{"summary":"Api Info","description":"API information and statistics.","operationId":"api_info_info_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/markets":{"get":{"summary":"List markets","description":"List all available markets with optional filtering.","operationId":"list_markets_markets_get","parameters":[{"name":"subset","in":"query","required":false,"schema":{"type":"string","description":"Filter markets by FinID pattern (e.g., 'US.*')","default":"*","title":"Subset"},"description":"Filter markets by FinID pattern (e.g., 'US.*')"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MarketResponse"},"title":"Response List Markets Markets Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/markets/{identifier}":{"get":{"summary":"Get market","description":"Get market by FinID or MIC.","operationId":"get_market_markets__identifier__get","parameters":[{"name":"identifier","in":"path","required":true,"schema":{"type":"string","title":"Identifier"}},{"name":"follow","in":"query","required":false,"schema":{"type":"boolean","description":"Follow replaced markets","default":true,"title":"Follow"},"description":"Follow replaced markets"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/markets/{identifier}/holidays":{"get":{"summary":"Get market holidays","description":"Get market holidays for a date range.","operationId":"get_market_holidays_markets__identifier__holidays_get","parameters":[{"name":"identifier","in":"path","required":true,"schema":{"type":"string","title":"Identifier"}},{"name":"start","in":"query","required":true,"schema":{"type":"string","format":"date","description":"Start date (YYYY-MM-DD)","title":"Start"},"description":"Start date (YYYY-MM-DD)"},{"name":"end","in":"query","required":true,"schema":{"type":"string","format":"date","description":"End date (YYYY-MM-DD)","title":"End"},"description":"End date (YYYY-MM-DD)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MarketHolidayResponse"},"title":"Response Get Market Holidays Markets  Identifier  Holidays Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/markets/{identifier}/phases":{"get":{"summary":"Generate market phases","description":"Generate market phases for a date range.","operationId":"get_market_phases_markets__identifier__phases_get","parameters":[{"name":"identifier","in":"path","required":true,"schema":{"type":"string","title":"Identifier"}},{"name":"start","in":"query","required":true,"schema":{"type":"string","format":"date","description":"Start date (YYYY-MM-DD)","title":"Start"},"description":"Start date (YYYY-MM-DD)"},{"name":"end","in":"query","required":true,"schema":{"type":"string","format":"date","description":"End date (YYYY-MM-DD)","title":"End"},"description":"End date (YYYY-MM-DD)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PhaseResponse"},"title":"Response Get Market Phases Markets  Identifier  Phases Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/markets/{identifier}/schedules":{"get":{"summary":"Get market schedules","description":"Get market schedules.","operationId":"get_market_schedules_markets__identifier__schedules_get","parameters":[{"name":"identifier","in":"path","required":true,"schema":{"type":"string","title":"Identifier"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ScheduleResponse"},"title":"Response Get Market Schedules Markets  Identifier  Schedules Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/markets/{identifier}/status":{"get":{"summary":"Get market status","description":"Get market status at a specific time (or current time if not provided).\n\nTo avoid problems with timezone offsets and conversions, the datetime_utc must have the +00:00 timezone offset.\n\nAll datetimes in the response will still be in the timezone of the market, like it is returned by other endpoints.","operationId":"get_market_status_markets__identifier__status_get","parameters":[{"name":"identifier","in":"path","required":true,"schema":{"type":"string","title":"Identifier"}},{"name":"datetime_utc","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"UTC datetime in ISO format (YYYY-MM-DDTHH:MM:SS+00:00)","title":"Datetime Utc"},"description":"UTC datetime in ISO format (YYYY-MM-DDTHH:MM:SS+00:00)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/markets/{identifier}/is_available":{"get":{"summary":"Check if market is available","description":"Check if market is available under current plan.","operationId":"check_market_available_markets__identifier__is_available_get","parameters":[{"name":"identifier","in":"path","required":true,"schema":{"type":"string","title":"Identifier"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IsAvailableResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/markets/finid/{finid}":{"get":{"summary":"Get market by FinID","description":"Get market specifically by FinID.","operationId":"get_market_by_finid_markets_finid__finid__get","parameters":[{"name":"finid","in":"path","required":true,"schema":{"type":"string","title":"Finid"}},{"name":"follow","in":"query","required":false,"schema":{"type":"boolean","description":"Follow replaced markets","default":true,"title":"Follow"},"description":"Follow replaced markets"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/markets/mic/{mic}":{"get":{"summary":"Get market by MIC","description":"Get market specifically by MIC.","operationId":"get_market_by_mic_markets_mic__mic__get","parameters":[{"name":"mic","in":"path","required":true,"schema":{"type":"string","title":"Mic"}},{"name":"follow","in":"query","required":false,"schema":{"type":"boolean","description":"Follow replaced markets","default":true,"title":"Follow"},"description":"Follow replaced markets"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/currencies":{"get":{"summary":"List currencies","description":"List all available currencies.","operationId":"list_currencies_currencies_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/CurrencyResponse"},"type":"array","title":"Response List Currencies Currencies Get"}}}}}}},"/currencies/{code}":{"get":{"summary":"Get currency","description":"Get currency by code.","operationId":"get_currency_currencies__code__get","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","title":"Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrencyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/currencies/{code}/holidays":{"get":{"summary":"Get currency holidays","description":"Get currency holidays for a date range.","operationId":"get_currency_holidays_currencies__code__holidays_get","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","title":"Code"}},{"name":"start","in":"query","required":true,"schema":{"type":"string","format":"date","description":"Start date (YYYY-MM-DD)","title":"Start"},"description":"Start date (YYYY-MM-DD)"},{"name":"end","in":"query","required":true,"schema":{"type":"string","format":"date","description":"End date (YYYY-MM-DD)","title":"End"},"description":"End date (YYYY-MM-DD)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CurrencyHolidayResponse"},"title":"Response Get Currency Holidays Currencies  Code  Holidays Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/currencies/{code}/is_available":{"get":{"summary":"Check if currency is available","description":"Check if currency is available under current plan.","operationId":"check_currency_available_currencies__code__is_available_get","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","title":"Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IsAvailableResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"CurrencyHolidayResponse":{"properties":{"currency_code":{"type":"string","title":"Currency Code"},"date":{"type":"string","format":"date","title":"Date"},"holiday_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Holiday Name"},"settlement":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Settlement"},"observed":{"type":"boolean","title":"Observed"},"memo":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Memo"}},"additionalProperties":true,"type":"object","required":["currency_code","date","observed"],"title":"CurrencyHolidayResponse"},"CurrencyResponse":{"properties":{"currency_code":{"type":"string","title":"Currency Code"},"currency_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency Name"},"country_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country Code"},"central_bank":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Central Bank"},"financial_capital":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Financial Capital"},"financial_capital_timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Financial Capital Timezone"},"weekend_definition":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Weekend Definition"}},"additionalProperties":true,"type":"object","required":["currency_code"],"title":"CurrencyResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"IsAvailableResponse":{"properties":{"is_available":{"type":"boolean","title":"Is Available"}},"additionalProperties":true,"type":"object","required":["is_available"],"title":"IsAvailableResponse"},"MarketHolidayResponse":{"properties":{"fin_id":{"type":"string","title":"Fin Id"},"date":{"type":"string","format":"date","title":"Date"},"holiday_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Holiday Name"},"schedule":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schedule"},"settlement":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Settlement"},"observed":{"type":"boolean","title":"Observed"},"memo":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Memo"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"has_settlement":{"type":"boolean","title":"Has Settlement"},"is_open":{"type":"boolean","title":"Is Open"}},"additionalProperties":true,"type":"object","required":["fin_id","date","observed","has_settlement","is_open"],"title":"MarketHolidayResponse"},"MarketResponse":{"properties":{"fin_id":{"type":"string","title":"Fin Id"},"exchange_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Exchange Name"},"market_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Market Name"},"security_group":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Security Group"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"},"weekend_definition":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Weekend Definition"},"mic":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mic"},"acronym":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Acronym"},"asset_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Asset Type"},"memo":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Memo"},"permanently_closed":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Permanently Closed"},"replaced_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Replaced By"},"country_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country Code"},"holidays_min_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Holidays Min Date"},"holidays_max_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Holidays Max Date"}},"additionalProperties":true,"type":"object","required":["fin_id"],"title":"MarketResponse"},"MarketStatusResponse":{"properties":{"status":{"type":"string","title":"Status"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Until"},"next_bell":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Bell"},"phase":{"anyOf":[{"$ref":"#/components/schemas/PhaseResponse"},{"type":"null"}]},"market":{"anyOf":[{"$ref":"#/components/schemas/MarketResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","required":["status"],"title":"MarketStatusResponse"},"PhaseResponse":{"properties":{"phase_type":{"type":"string","title":"Phase Type"},"start":{"type":"string","format":"date-time","title":"Start"},"end":{"type":"string","format":"date-time","title":"End"},"phase_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phase Name"},"phase_memo":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phase Memo"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"settlement":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Settlement"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"},"has_settlement":{"type":"boolean","title":"Has Settlement"},"is_open":{"type":"boolean","title":"Is Open"}},"additionalProperties":true,"type":"object","required":["phase_type","start","end","has_settlement","is_open"],"title":"PhaseResponse"},"ScheduleResponse":{"properties":{"fin_id":{"type":"string","title":"Fin Id"},"schedule_group":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schedule Group"},"schedule_group_memo":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schedule Group Memo"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"},"phase_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phase Type"},"phase_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phase Name"},"phase_memo":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phase Memo"},"days":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Days"},"start":{"anyOf":[{"type":"string","format":"time"},{"type":"null"}],"title":"Start"},"end":{"anyOf":[{"type":"string","format":"time"},{"type":"null"}],"title":"End"},"offset_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Offset Days"},"duration":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration"},"min_start":{"anyOf":[{"type":"string","format":"time"},{"type":"null"}],"title":"Min Start"},"max_start":{"anyOf":[{"type":"string","format":"time"},{"type":"null"}],"title":"Max Start"},"min_end":{"anyOf":[{"type":"string","format":"time"},{"type":"null"}],"title":"Min End"},"max_end":{"anyOf":[{"type":"string","format":"time"},{"type":"null"}],"title":"Max End"},"in_force_start_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"In Force Start Date"},"in_force_end_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"In Force End Date"},"season_start":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Season Start"},"season_end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Season End"},"has_season":{"type":"boolean","title":"Has Season"}},"additionalProperties":true,"type":"object","required":["fin_id","has_season"],"title":"ScheduleResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}