{"openapi":"3.1.0","info":{"title":"MarketFeed API","description":"Live quotes scraped from Yahoo Finance, Google Finance and Investing.com, with a cross-source consensus and 30 days of recorded 1-minute history. Guide: /docs (Markdown: /docs.md). MCP: /mcp.","version":"0.2.0"},"paths":{"/api/bootstrap":{"get":{"tags":["meta"],"summary":"Bootstrap","description":"What the console's first screen needs in one response: instruments, groups, the cached consensus for\nevery instrument, today's sparklines and health. Served from memory; no website is contacted.","operationId":"bootstrap_api_bootstrap_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/health":{"get":{"tags":["meta"],"summary":"Health","operationId":"health_api_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/symbols":{"get":{"tags":["instruments"],"summary":"List Symbols","operationId":"list_symbols_api_symbols_get","parameters":[{"name":"asset_class","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Asset Class"}},{"name":"country","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Instrument"},"title":"Response List Symbols Api Symbols Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["instruments"],"summary":"Add Symbol","description":"Track an instrument. Send `{\"yahoo\": \"TLKM.JK\"}` and everything else is looked up, or send a full\nInstrument (symbol, name, yahoo/google/investing ids) to set it by hand.","operationId":"add_symbol_api_symbols_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"examples":[{"yahoo":"TLKM.JK"}],"title":"Body"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Instrument"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/symbols/{symbol}":{"patch":{"tags":["instruments"],"summary":"Update Symbol","operationId":"update_symbol_api_symbols__symbol__patch","parameters":[{"name":"symbol","in":"path","required":true,"schema":{"type":"string","title":"Symbol"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstrumentPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Instrument"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["instruments"],"summary":"Delete Symbol","operationId":"delete_symbol_api_symbols__symbol__delete","parameters":[{"name":"symbol","in":"path","required":true,"schema":{"type":"string","title":"Symbol"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/groups":{"get":{"tags":["groups"],"summary":"List Groups","description":"Groups in display order with their members. Automatic groups (Indices, Stocks, Commodities, ...) hold every\ninstrument of that type that hasn't been moved to a custom group.","operationId":"list_groups_api_groups_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/GroupInfo"},"type":"array","title":"Response List Groups Api Groups Get"}}}}}},"put":{"tags":["groups"],"summary":"Order Groups","description":"Set the display order: `{\"order\": [\"JKSE\", \"Indices\", \"Crypto\", ...]}`. Groups left out keep their default place.","operationId":"order_groups_api_groups_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupPatch"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/GroupInfo"},"type":"array","title":"Response Order Groups Api Groups Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/groups/move":{"post":{"tags":["groups"],"summary":"Move To Group","description":"Move instruments into a group. A new name creates the group; null or \"\" sends them back to their automatic group.","operationId":"move_to_group_api_groups_move_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MoveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Instrument"},"type":"array","title":"Response Move To Group Api Groups Move Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/groups/{name}":{"patch":{"tags":["groups"],"summary":"Rename Group","description":"Rename a group: `{\"name\": \"IDX blue chips\"}`.","operationId":"rename_group_api_groups__name__patch","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/GroupInfo"},"title":"Response Rename Group Api Groups  Name  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["groups"],"summary":"Delete Group","description":"Dissolve a custom group; its instruments go back to their automatic groups. Nothing is untracked.","operationId":"delete_group_api_groups__name__delete","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/search":{"get":{"tags":["instruments"],"summary":"Search","description":"Ticker suggestions: tracked first, then the IDX catalog (835 stocks), then Yahoo worldwide.\nAn empty query returns popular instruments and the largest IDX stocks you don't track yet.","operationId":"search_api_search_get","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","default":"","title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":40,"minimum":1,"default":12,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Suggestion"},"title":"Response Search Api Search Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/quotes":{"get":{"tags":["quotes"],"summary":"Quotes","operationId":"quotes_api_quotes_get","parameters":[{"name":"symbols","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated, e.g. SPX,BBCA. Default: all tracked","title":"Symbols"},"description":"Comma-separated, e.g. SPX,BBCA. Default: all tracked"},{"name":"sources","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated subset of yahoo,google,investing","title":"Sources"},"description":"Comma-separated subset of yahoo,google,investing"},{"name":"max_age","in":"query","required":false,"schema":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"description":"Max cache age in seconds; 0 = force fresh","title":"Max Age"},"description":"Max cache age in seconds; 0 = force fresh"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Consensus"},"title":"Response Quotes Api Quotes Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/quotes/{symbol}":{"get":{"tags":["quotes"],"summary":"Quote","operationId":"quote_api_quotes__symbol__get","parameters":[{"name":"symbol","in":"path","required":true,"schema":{"type":"string","title":"Symbol"}},{"name":"sources","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sources"}},{"name":"max_age","in":"query","required":false,"schema":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"title":"Max Age"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Consensus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/quotes/{symbol}/{source}":{"get":{"tags":["quotes"],"summary":"Quote One","operationId":"quote_one_api_quotes__symbol___source__get","parameters":[{"name":"symbol","in":"path","required":true,"schema":{"type":"string","title":"Symbol"}},{"name":"source","in":"path","required":true,"schema":{"enum":["yahoo","google","investing"],"type":"string","title":"Source"}},{"name":"max_age","in":"query","required":false,"schema":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"title":"Max Age"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Quote"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sparklines":{"get":{"tags":["quotes"],"summary":"Sparklines","description":"Today's 5-minute closes from Yahoo for many symbols at once: {symbol: [[unix_seconds, close], ...]}.","operationId":"sparklines_api_sparklines_get","parameters":[{"name":"symbols","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Symbols"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/history/{symbol}":{"get":{"tags":["history"],"summary":"History","description":"Candles from the source website itself (no local storage involved).","operationId":"history_api_history__symbol__get","parameters":[{"name":"symbol","in":"path","required":true,"schema":{"type":"string","title":"Symbol"}},{"name":"source","in":"query","required":false,"schema":{"enum":["yahoo","google","investing"],"type":"string","default":"yahoo","title":"Source"}},{"name":"interval","in":"query","required":false,"schema":{"enum":["1m","5m","15m","30m","1h","1d","1w"],"type":"string","default":"5m","title":"Interval"}},{"name":"points","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":2,"default":78,"title":"Points"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/History"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stored/{symbol}":{"get":{"tags":["history"],"summary":"Stored","description":"Bars this server recorded itself from the stream and polls: 1-minute resolution, kept 30 days.","operationId":"stored_api_stored__symbol__get","parameters":[{"name":"symbol","in":"path","required":true,"schema":{"type":"string","title":"Symbol"}},{"name":"source","in":"query","required":false,"schema":{"enum":["yahoo","google","investing"],"type":"string","default":"yahoo","title":"Source"}},{"name":"interval","in":"query","required":false,"schema":{"enum":["1m","5m","15m","30m","1h","4h","1d"],"type":"string","default":"5m","title":"Interval"}},{"name":"days","in":"query","required":false,"schema":{"anyOf":[{"type":"number","maximum":30,"exclusiveMinimum":0},{"type":"null"}],"description":"Window ending now; default: today (UTC)","title":"Days"},"description":"Window ending now; default: today (UTC)"},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End"}},{"name":"format","in":"query","required":false,"schema":{"enum":["json","csv"],"type":"string","default":"json","title":"Format"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoredHistory"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/daily/{symbol}":{"get":{"tags":["history"],"summary":"Daily","description":"Long-term daily, weekly or monthly candles from Yahoo, back to the instrument's first trade (BTC: Sept 2014,\nS&P 500: 1927). Tracked instruments are downloaded once and kept in the database; later calls are instant.\nPrices are split-adjusted, not dividend-adjusted.","operationId":"daily_api_daily__symbol__get","parameters":[{"name":"symbol","in":"path","required":true,"schema":{"type":"string","title":"Symbol"}},{"name":"range","in":"query","required":false,"schema":{"type":"string","description":"1mo 3mo 6mo ytd 1y 2y 5y 10y 20y max","default":"1y","title":"Range"},"description":"1mo 3mo 6mo ytd 1y 2y 5y 10y 20y max"},{"name":"interval","in":"query","required":false,"schema":{"enum":["1d","1wk","1mo"],"type":"string","default":"1d","title":"Interval"}},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End"}},{"name":"refresh","in":"query","required":false,"schema":{"type":"boolean","description":"Fetch the latest days now instead of using the hourly top-up","default":false,"title":"Refresh"},"description":"Fetch the latest days now instead of using the hourly top-up"},{"name":"format","in":"query","required":false,"schema":{"enum":["json","csv"],"type":"string","default":"json","title":"Format"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyHistory"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/storage":{"get":{"tags":["history"],"summary":"Storage","description":"Database size, bar counts per source and the oldest/newest stored minute.","operationId":"storage_api_storage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/raw/investing/{pair_id}":{"get":{"tags":["relay"],"summary":"Raw Investing","description":"Investing.com chart payload passed through untouched. The Cloudflare Worker uses this as a relay,\nsince Workers can't present a browser TLS fingerprint and Investing's bot check blocks them.","operationId":"raw_investing_api_raw_investing__pair_id__get","parameters":[{"name":"pair_id","in":"path","required":true,"schema":{"type":"integer","title":"Pair Id"}},{"name":"interval","in":"query","required":false,"schema":{"type":"string","pattern":"^P(T\\d+[MH]|1[DW])$","default":"P1D","title":"Interval"}},{"name":"points","in":"query","required":false,"schema":{"type":"integer","maximum":160,"minimum":2,"default":60,"title":"Points"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sources/health":{"get":{"tags":["meta"],"summary":"Sources Health","operationId":"sources_health_api_sources_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/SourceHealth"},"type":"array","title":"Response Sources Health Api Sources Health Get"}}}}}}},"/api/sources":{"get":{"tags":["sources"],"summary":"Sources Status","description":"Each source's master switch, how many instruments use it, and its health. Yahoo is the master source.","operationId":"sources_status_api_sources_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/SourceStatus"},"type":"array","title":"Response Sources Status Api Sources Get"}}}}}}},"/api/sources/{source}":{"patch":{"tags":["sources"],"summary":"Set Source","description":"Switch Google or Investing.com on or off for every instrument: `{\"enabled\": false}`. Yahoo stays on.\nPer-instrument \"compare\" settings are kept and apply again when the source is switched back on.\nAdmin: console session or master key.","operationId":"set_source_api_sources__source__patch","parameters":[{"name":"source","in":"path","required":true,"schema":{"type":"string","title":"Source"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourcePatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SourceStatus"},"title":"Response Set Source Api Sources  Source  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sources/{source}/test":{"post":{"tags":["sources"],"summary":"Test Source","description":"Make one live request to a source now (ignoring the cache and any pause) and say what the result means:\nworking, blocked, rate-limited, a site error, a network problem, or no price in the answer.","operationId":"test_source_api_sources__source__test_post","parameters":[{"name":"source","in":"path","required":true,"schema":{"type":"string","title":"Source"}},{"name":"symbol","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Symbol"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceTest"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/keys":{"get":{"tags":["keys"],"summary":"List Keys","description":"Client keys, newest first, with usage. Admin: console session or master key.","operationId":"list_keys_api_keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ApiKey"},"type":"array","title":"Response List Keys Api Keys Get"}}}}}},"post":{"tags":["keys"],"summary":"Create Key","description":"Create a key for an app: `{\"name\": \"Trading bot\", \"scope\": \"read\", \"rate_limit\": 120, \"expires_days\": 90}`.\nThe response holds the full key once; store it then.","operationId":"create_key_api_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/keys/{key_id}":{"patch":{"tags":["keys"],"summary":"Update Key","description":"Rename, change scope or rate limit, or disable / re-enable (`{\"enabled\": false}`).","operationId":"update_key_api_keys__key_id__patch","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["keys"],"summary":"Delete Key","description":"Delete a key for good; apps using it get 401 from then on.","operationId":"delete_key_api_keys__key_id__delete","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/refresh":{"post":{"tags":["quotes"],"summary":"Refresh","description":"Scrape every tracked instrument now and push the result to stream clients.","operationId":"refresh_api_refresh_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Consensus"},"type":"array","title":"Response Refresh Api Refresh Post"}}}}}}},"/api/stream":{"get":{"tags":["stream"],"summary":"Stream","description":"Server-Sent Events: `snapshot` (all instruments, every poll) and `ticks` (changed instruments, up to 4/s).","operationId":"stream_api_stream_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"ApiKey":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"hint":{"type":"string","title":"Hint","description":"First and last characters of the key, e.g. mfk_Ab3x…9QzT"},"scope":{"type":"string","enum":["read","write"],"title":"Scope","default":"read"},"rate_limit":{"type":"integer","title":"Rate Limit","description":"Requests per minute; 0 = unlimited","default":0},"created_at":{"type":"string","format":"date-time","title":"Created At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"disabled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Disabled At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"last_ip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Ip"},"requests":{"type":"integer","title":"Requests","default":0},"status":{"type":"string","enum":["active","disabled","expired"],"title":"Status","default":"active"}},"type":"object","required":["id","name","hint","created_at"],"title":"ApiKey","description":"A client API key. The secret itself is shown once, at creation; only a hint is kept in view."},"ApiKeyCreate":{"properties":{"name":{"type":"string","maxLength":60,"minLength":1,"title":"Name"},"scope":{"type":"string","enum":["read","write"],"title":"Scope","default":"read"},"rate_limit":{"type":"integer","maximum":100000.0,"minimum":0.0,"title":"Rate Limit","default":0},"expires_days":{"anyOf":[{"type":"integer","maximum":3650.0,"minimum":1.0},{"type":"null"}],"title":"Expires Days","description":"Days until it stops working; omit for never"}},"type":"object","required":["name"],"title":"ApiKeyCreate"},"ApiKeyCreated":{"properties":{"key":{"$ref":"#/components/schemas/ApiKey"},"secret":{"type":"string","title":"Secret","description":"The full key. Store it now: it can't be shown again"}},"type":"object","required":["key","secret"],"title":"ApiKeyCreated"},"ApiKeyPatch":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":60,"minLength":1},{"type":"null"}],"title":"Name"},"scope":{"anyOf":[{"type":"string","enum":["read","write"]},{"type":"null"}],"title":"Scope"},"rate_limit":{"anyOf":[{"type":"integer","maximum":100000.0,"minimum":0.0},{"type":"null"}],"title":"Rate Limit"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"}},"type":"object","title":"ApiKeyPatch"},"Candle":{"properties":{"t":{"type":"string","format":"date-time","title":"T"},"o":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"O"},"h":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"H"},"l":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"L"},"c":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"C"},"v":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"V"}},"type":"object","required":["t"],"title":"Candle"},"Consensus":{"properties":{"symbol":{"type":"string","title":"Symbol"},"name":{"type":"string","title":"Name"},"price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Price","description":"Median price across sources that answered"},"change_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Change Pct"},"spread_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Spread Pct","description":"(max - min) / median across sources, in %"},"sources_ok":{"type":"integer","title":"Sources Ok","default":0},"sources_total":{"type":"integer","title":"Sources Total","default":0},"last":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Last","description":"Freshest price: the live Yahoo tick when it is under 15 s old, else the median"},"last_change_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Last Change Pct"},"last_source":{"anyOf":[{"type":"string","enum":["live","median"]},{"type":"null"}],"title":"Last Source"},"quotes":{"additionalProperties":{"$ref":"#/components/schemas/Quote"},"type":"object","title":"Quotes","default":{}}},"type":"object","required":["symbol","name"],"title":"Consensus","description":"Cross-source view of one instrument."},"DailyHistory":{"properties":{"symbol":{"type":"string","title":"Symbol"},"source":{"type":"string","enum":["yahoo","google","investing"],"title":"Source","default":"yahoo"},"interval":{"type":"string","title":"Interval"},"range":{"type":"string","title":"Range"},"start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start"},"end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End"},"candles":{"items":{"$ref":"#/components/schemas/Candle"},"type":"array","title":"Candles"},"first_available":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"First Available","description":"Oldest daily bar stored for this instrument"},"stored":{"type":"boolean","title":"Stored","description":"True when served from (and kept in) the local database"}},"type":"object","required":["symbol","interval","range","candles","stored"],"title":"DailyHistory"},"GroupInfo":{"properties":{"name":{"type":"string","title":"Name"},"count":{"type":"integer","title":"Count"},"custom":{"type":"boolean","title":"Custom","description":"False for the automatic type groups (Indices, Stocks, ...)"},"symbols":{"items":{"type":"string"},"type":"array","title":"Symbols"}},"type":"object","required":["name","count","custom","symbols"],"title":"GroupInfo"},"GroupPatch":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"New name for the group"},"order":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Order","description":"Full display order of group names (only on PUT /api/groups)"}},"type":"object","title":"GroupPatch"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"History":{"properties":{"symbol":{"type":"string","title":"Symbol"},"source":{"type":"string","enum":["yahoo","google","investing"],"title":"Source"},"interval":{"type":"string","title":"Interval"},"candles":{"items":{"$ref":"#/components/schemas/Candle"},"type":"array","title":"Candles"},"fetched_at":{"type":"string","format":"date-time","title":"Fetched At"}},"type":"object","required":["symbol","source","interval","candles"],"title":"History"},"Instrument":{"properties":{"symbol":{"type":"string","title":"Symbol","description":"Canonical symbol used by this API, e.g. SPX, WTI, AAPL, BBCA"},"name":{"type":"string","title":"Name"},"asset_class":{"type":"string","enum":["index","equity","commodity","fx","crypto","etf","other"],"title":"Asset Class","default":"other"},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country","description":"ISO 3166 alpha-2 country, or GL for global markets (commodities, FX, crypto)"},"exchange":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Exchange","description":"Display exchange, e.g. NASDAQ, IDX, NYMEX"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"},"yahoo":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Yahoo","description":"Yahoo ticker, e.g. ^GSPC, CL=F, AAPL, BBCA.JK"},"google":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Google","description":"Google Finance id TICKER:EXCHANGE, e.g. .INX:INDEXSP, BBCA:IDX"},"investing":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Investing","description":"Investing.com pair id, e.g. 166 for S&P 500"},"compare":{"type":"boolean","title":"Compare","description":"Also poll Google and Investing.com. Off = Yahoo only (live stream + batch)","default":true},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"rank":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Rank","description":"Display order inside its group (lower first)"},"group":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Group","description":"Custom group name; empty = the automatic group for its type (Indices, Stocks, ...)"}},"type":"object","required":["symbol","name"],"title":"Instrument","description":"A tracked instrument and its identifier on each source."},"InstrumentPatch":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"asset_class":{"anyOf":[{"type":"string","enum":["index","equity","commodity","fx","crypto","etf","other"]},{"type":"null"}],"title":"Asset Class"},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country"},"exchange":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Exchange"},"google":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Google"},"investing":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Investing"},"compare":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Compare"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"rank":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Rank"},"group":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Group","description":"Move to this group; empty string = back to the automatic group"}},"type":"object","title":"InstrumentPatch"},"MoveRequest":{"properties":{"symbols":{"items":{"type":"string"},"type":"array","title":"Symbols","description":"Symbols to move, e.g. [\"BMRI\", \"BBCA\"]"},"group":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Group","description":"Target group (created if new); null or empty = automatic group"}},"type":"object","required":["symbols"],"title":"MoveRequest"},"Quote":{"properties":{"symbol":{"type":"string","title":"Symbol"},"source":{"type":"string","enum":["yahoo","google","investing"],"title":"Source"},"source_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Price"},"change":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Change"},"change_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Change Pct"},"prev_close":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Prev Close"},"open":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Open"},"day_high":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Day High"},"day_low":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Day Low"},"volume":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Volume","description":"Day volume when the source reports it"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"},"market_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Market Time","description":"Time of the last trade as reported by the source"},"fetched_at":{"type":"string","format":"date-time","title":"Fetched At"},"latency_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Latency Ms"},"ok":{"type":"boolean","title":"Ok","default":true},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"via":{"anyOf":[{"type":"string","enum":["poll","batch","stream","fast","relay"]},{"type":"null"}],"title":"Via","description":"How this value arrived"},"market_open":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Market Open","description":"Regular session open now, when the source says"}},"type":"object","required":["symbol","source"],"title":"Quote"},"SourceError":{"properties":{"at":{"type":"string","format":"date-time","title":"At"},"symbol":{"type":"string","title":"Symbol"},"kind":{"type":"string","title":"Kind"},"error":{"type":"string","title":"Error"}},"type":"object","required":["at","symbol","kind","error"],"title":"SourceError"},"SourceHealth":{"properties":{"source":{"type":"string","enum":["yahoo","google","investing"],"title":"Source"},"ok":{"type":"integer","title":"Ok","default":0},"failed":{"type":"integer","title":"Failed","default":0},"avg_latency_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Avg Latency Ms"},"last_ok":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Ok"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"},"last_error_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Error At"}},"type":"object","required":["source"],"title":"SourceHealth"},"SourcePatch":{"properties":{"enabled":{"type":"boolean","title":"Enabled"}},"type":"object","required":["enabled"],"title":"SourcePatch"},"SourceStatus":{"properties":{"source":{"type":"string","enum":["yahoo","google","investing"],"title":"Source"},"ok":{"type":"integer","title":"Ok","default":0},"failed":{"type":"integer","title":"Failed","default":0},"avg_latency_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Avg Latency Ms"},"last_ok":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Ok"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"},"last_error_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Error At"},"enabled":{"type":"boolean","title":"Enabled","default":true},"master":{"type":"boolean","title":"Master","default":false},"instruments":{"type":"integer","title":"Instruments","description":"Instruments that use this source (compare on, or Yahoo for all)","default":0},"state":{"type":"string","title":"State","description":"ok, or the kind of the latest failure: blocked, rate_limited, paused, not_found, site_error, network, no_data, other","default":"ok"},"state_label":{"type":"string","title":"State Label","default":"Working"},"advice":{"type":"string","title":"Advice","default":""},"failing_since":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Failing Since","description":"Start of the current run of failures"},"recent_ok_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Recent Ok Pct","description":"Share of the last 50 requests that got a price"},"errors_by_kind":{"additionalProperties":{"type":"integer"},"type":"object","title":"Errors By Kind","description":"Failures since the server started, by kind"},"recent_errors":{"items":{"$ref":"#/components/schemas/SourceError"},"type":"array","title":"Recent Errors","description":"The last 20 failures, newest first"}},"type":"object","required":["source"],"title":"SourceStatus","description":"A source's master switch, its health, and a diagnosis of recent failures."},"SourceTest":{"properties":{"source":{"type":"string","enum":["yahoo","google","investing"],"title":"Source"},"symbol":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Symbol"},"ok":{"type":"boolean","title":"Ok"},"state":{"type":"string","title":"State"},"state_label":{"type":"string","title":"State Label"},"advice":{"type":"string","title":"Advice"},"price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Price"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"latency_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Latency Ms"},"via":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Via"},"tested_at":{"type":"string","format":"date-time","title":"Tested At"}},"type":"object","required":["source","ok","state","state_label","advice","tested_at"],"title":"SourceTest"},"StoredHistory":{"properties":{"symbol":{"type":"string","title":"Symbol"},"source":{"type":"string","enum":["yahoo","google","investing"],"title":"Source"},"interval":{"type":"string","title":"Interval"},"start":{"type":"string","format":"date-time","title":"Start"},"end":{"type":"string","format":"date-time","title":"End"},"candles":{"items":{"$ref":"#/components/schemas/Candle"},"type":"array","title":"Candles"},"first_stored":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"First Stored","description":"Oldest stored minute for this series"},"minutes_stored":{"type":"integer","title":"Minutes Stored","description":"1-minute bars in the requested window","default":0}},"type":"object","required":["symbol","source","interval","start","end","candles"],"title":"StoredHistory"},"Suggestion":{"properties":{"symbol":{"type":"string","title":"Symbol"},"yahoo":{"type":"string","title":"Yahoo"},"name":{"type":"string","title":"Name"},"asset_class":{"type":"string","enum":["index","equity","commodity","fx","crypto","etf","other"],"title":"Asset Class"},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country"},"exchange":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Exchange"},"tracked":{"type":"boolean","title":"Tracked","default":false},"origin":{"type":"string","enum":["tracked","idx","yahoo","popular"],"title":"Origin"},"rank":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Rank"}},"type":"object","required":["symbol","yahoo","name","asset_class","origin"],"title":"Suggestion","description":"One search result for the add-ticker box."},"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"}}}}