MCPcopy Create free account
hub / github.com/FinStep-AI/ContestTrade / run

Method run

contest_trade/utils/fmp_utils.py:40–50  ·  view source on GitHub ↗

运行FMP API请求并缓存结果 Args: endpoint: API端点路径 params: 请求参数 verbose: 是否输出详细信息

(self, endpoint: str, params: dict, verbose: bool = False)

Source from the content-addressed store, hash-verified

38 self.rate_limit_delay = 0.2 # API限制,每秒最多5次请求
39
40 def run(self, endpoint: str, params: dict, verbose: bool = False):
41 """
42 运行FMP API请求并缓存结果
43
44 Args:
45 endpoint: API端点路径
46 params: 请求参数
47 verbose: 是否输出详细信息
48 """
49 params_str = json.dumps(params, sort_keys=True)
50 return self.run_with_cache(endpoint, params_str, verbose)
51
52 def run_with_cache(self, endpoint: str, params_str: str, verbose: bool = False):
53 params = json.loads(params_str)

Callers 15

get_stock_name_by_codeFunction · 0.95
get_historical_priceMethod · 0.95
get_quoteMethod · 0.95
get_company_profileMethod · 0.95
get_income_statementMethod · 0.95
get_balance_sheetMethod · 0.95
get_cash_flowMethod · 0.95
get_key_metricsMethod · 0.95
get_financial_ratiosMethod · 0.95
get_stock_newsMethod · 0.95
get_market_capMethod · 0.95
get_analyst_estimatesMethod · 0.95

Calls 1

run_with_cacheMethod · 0.95

Tested by

no test coverage detected