{"openapi":"3.1.0","info":{"title":"StockLab API","description":"StockLab — global equity intelligence platform API. See /docs for the interactive OpenAPI reference. docs/API.md has the narrative version.","version":"0.1.0"},"paths":{"/health":{"get":{"tags":["health"],"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/database-health":{"get":{"tags":["health"],"summary":"Database Health","operationId":"database_health_database_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/provider-health":{"get":{"tags":["health"],"summary":"Provider Health","operationId":"provider_health_provider_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/ready":{"get":{"tags":["health"],"summary":"Ready","operationId":"ready_ready_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/auth/register":{"post":{"tags":["auth"],"summary":"Register","operationId":"register_v1_auth_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/login":{"post":{"tags":["auth"],"summary":"Login","operationId":"login_v1_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/refresh":{"post":{"tags":["auth"],"summary":"Refresh","operationId":"refresh_v1_auth_refresh_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/logout":{"post":{"tags":["auth"],"summary":"Logout","description":"AUDIT FIX (StockLab overhaul, final engineering pass, Part A4): revokes a refresh token on\ndemand -- the server-side \"logout\" that didn't exist before this pass (a client discarding its\ntokens was the only prior mechanism, which does nothing if the token was already copied\nelsewhere). Deliberately takes only the refresh token itself, not an access-token-authenticated\n`Depends(get_current_user)` -- consistent with /refresh's own model (possession of a valid\nrefresh token is what it means to hold that session), and with RFC 7009-style token revocation\nendpoints. An already-invalid token (expired, malformed, or already revoked) is treated as\n\"already logged out\" -- 204 either way -- rather than surfaced as an error a client would need\nto handle specially; logout is idempotent by design (see revoke_refresh_token()'s docstring).\nAccess tokens already issued from this refresh token remain valid until their own short expiry\n-- see this module's docstring for why that's an accepted scope boundary, not an oversight.","operationId":"logout_v1_auth_logout_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshRequest"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/companies/{ticker}":{"get":{"tags":["companies"],"summary":"Get Company Page","operationId":"get_company_page_v1_companies__ticker__get","parameters":[{"name":"ticker","in":"path","required":true,"schema":{"type":"string","title":"Ticker"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyPageOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/companies/{ticker}/metrics":{"get":{"tags":["companies"],"summary":"Get Company Metrics","description":"Full 30-metric breakdown (progressive disclosure drill-through, spec §48).","operationId":"get_company_metrics_v1_companies__ticker__metrics_get","parameters":[{"name":"ticker","in":"path","required":true,"schema":{"type":"string","title":"Ticker"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{},"title":"Response Get Company Metrics V1 Companies  Ticker  Metrics Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/screeners/strategies":{"get":{"tags":["screeners"],"summary":"List Strategies","operationId":"list_strategies_v1_screeners_strategies_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/screeners/strategies/{key}":{"get":{"tags":["screeners"],"summary":"Get Strategy","operationId":"get_strategy_v1_screeners_strategies__key__get","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/screeners/run":{"post":{"tags":["screeners"],"summary":"Run Screen","operationId":"run_screen_v1_screeners_run_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScreenRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScreenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rankings/{dimension}":{"get":{"tags":["rankings"],"summary":"Get Ranking","operationId":"get_ranking_v1_rankings__dimension__get","parameters":[{"name":"dimension","in":"path","required":true,"schema":{"type":"string","title":"Dimension"}},{"name":"country","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country"}},{"name":"sector","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sector"}},{"name":"strong_buy_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Strong Buy Only"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ScreenResultRow"},"title":"Response Get Ranking V1 Rankings  Dimension  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/watchlist":{"get":{"tags":["watchlist"],"summary":"Get Watchlist","operationId":"get_watchlist_v1_watchlist_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/v1/watchlist/{ticker}":{"post":{"tags":["watchlist"],"summary":"Add To Watchlist","operationId":"add_to_watchlist_v1_watchlist__ticker__post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"ticker","in":"path","required":true,"schema":{"type":"string","title":"Ticker"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["watchlist"],"summary":"Remove From Watchlist","operationId":"remove_from_watchlist_v1_watchlist__ticker__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"ticker","in":"path","required":true,"schema":{"type":"string","title":"Ticker"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/search":{"get":{"tags":["search"],"summary":"Search","operationId":"search_v1_search_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/":{"get":{"summary":"Root","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"CompanyPageOut":{"properties":{"company":{"$ref":"#/components/schemas/CompanySummaryOut"},"score":{"anyOf":[{"$ref":"#/components/schemas/ScoreOut"},{"type":"null"}]},"valuation":{"anyOf":[{"$ref":"#/components/schemas/ValuationOut"},{"type":"null"}]},"why":{"items":{"type":"string"},"type":"array","title":"Why","default":[]},"risks":{"items":{"type":"string"},"type":"array","title":"Risks","default":[]},"metrics":{"items":{"$ref":"#/components/schemas/MetricOut"},"type":"array","title":"Metrics","default":[]},"as_of":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"As Of"}},"type":"object","required":["company","score","valuation"],"title":"CompanyPageOut"},"CompanySummaryOut":{"properties":{"security_id":{"type":"string","title":"Security Id"},"ticker":{"type":"string","title":"Ticker"},"company_name":{"type":"string","title":"Company Name"},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country"},"sector":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sector"},"industry":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Industry"},"is_demo":{"type":"boolean","title":"Is Demo","default":false}},"type":"object","required":["security_id","ticker","company_name","country","sector","industry"],"title":"CompanySummaryOut"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"LoginRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","title":"Password"}},"type":"object","required":["email","password"],"title":"LoginRequest"},"MetricOut":{"properties":{"key":{"type":"string","title":"Key"},"value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value"},"display":{"type":"string","title":"Display"},"status":{"type":"string","title":"Status"},"applicability":{"type":"string","title":"Applicability"},"formula_version":{"type":"string","title":"Formula Version"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"type":"object","required":["key","value","display","status","applicability","formula_version"],"title":"MetricOut"},"RefreshRequest":{"properties":{"refresh_token":{"type":"string","title":"Refresh Token"}},"type":"object","required":["refresh_token"],"title":"RefreshRequest"},"RegisterRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","maxLength":256,"minLength":8,"title":"Password"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"}},"type":"object","required":["email","password"],"title":"RegisterRequest"},"ScoreOut":{"properties":{"quality_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Quality Score"},"financial_health_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Financial Health Score"},"growth_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Growth Score"},"competitive_advantage_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Competitive Advantage Score"},"valuation_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Valuation Score"},"overall_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Overall Score"},"risk_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Risk Score"},"recommendation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recommendation"},"confidence_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence Score"},"data_quality_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Data Quality Score"},"weights_used":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Weights Used"},"triggers_fired":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Triggers Fired"},"subscore_detail":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Subscore Detail"}},"type":"object","required":["quality_score","financial_health_score","growth_score","competitive_advantage_score","valuation_score","overall_score","risk_score","recommendation"],"title":"ScoreOut"},"ScreenFilter":{"properties":{"metric":{"type":"string","maxLength":48,"title":"Metric"},"op":{"type":"string","title":"Op"},"value":{"type":"number","title":"Value"},"value2":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value2"},"relative":{"type":"string","title":"Relative","default":"absolute"}},"type":"object","required":["metric","op","value"],"title":"ScreenFilter"},"ScreenRequest":{"properties":{"universe":{"$ref":"#/components/schemas/ScreenUniverse","default":{"include_demo":false}},"logic":{"type":"string","title":"Logic","default":"AND"},"filters":{"items":{"$ref":"#/components/schemas/ScreenFilter"},"type":"array","maxItems":20,"title":"Filters","default":[]},"sort_by":{"type":"string","title":"Sort By","default":"overall_score"},"sort_direction":{"type":"string","title":"Sort Direction","default":"desc"},"limit":{"type":"integer","maximum":200.0,"title":"Limit","default":50},"offset":{"type":"integer","minimum":0.0,"title":"Offset","default":0}},"type":"object","title":"ScreenRequest"},"ScreenResponse":{"properties":{"total":{"type":"integer","title":"Total"},"results":{"items":{"$ref":"#/components/schemas/ScreenResultRow"},"type":"array","title":"Results"}},"type":"object","required":["total","results"],"title":"ScreenResponse"},"ScreenResultRow":{"properties":{"company":{"$ref":"#/components/schemas/CompanySummaryOut"},"overall_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Overall Score"},"recommendation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recommendation"},"weighted_fair_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Weighted Fair Value"},"margin_of_safety":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Margin Of Safety"},"confidence_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence Score"},"data_quality_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Data Quality Score"}},"type":"object","required":["company","overall_score","recommendation","weighted_fair_value","margin_of_safety"],"title":"ScreenResultRow"},"ScreenUniverse":{"properties":{"region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Region"},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country"},"sector":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sector"},"market_cap_min":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Market Cap Min"},"market_cap_max":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Market Cap Max"},"include_demo":{"type":"boolean","title":"Include Demo","default":false}},"type":"object","title":"ScreenUniverse"},"TokenResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"refresh_token":{"type":"string","title":"Refresh Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"}},"type":"object","required":["access_token","refresh_token"],"title":"TokenResponse"},"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"},"ValuationOut":{"properties":{"wacc":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Wacc"},"bear_fair_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Bear Fair Value"},"base_fair_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Base Fair Value"},"bull_fair_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Bull Fair Value"},"weighted_fair_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Weighted Fair Value"},"fair_value_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Fair Value Confidence"},"price_at_calculation":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Price At Calculation"},"margin_of_safety":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Margin Of Safety"},"strong_buy_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Strong Buy Price"},"buy_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Buy Price"},"overvalued_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Overvalued Price"},"expected_return_5y":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Expected Return 5Y"},"business_profile":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Profile"}},"type":"object","required":["wacc","bear_fair_value","base_fair_value","bull_fair_value","weighted_fair_value","fair_value_confidence","price_at_calculation","margin_of_safety","strong_buy_price","buy_price","overvalued_price","expected_return_5y","business_profile"],"title":"ValuationOut"}},"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"/v1/auth/login"}}}}}}