finance_dev 0.9.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- finance_dev/__init__.py +18 -0
- finance_dev/_hooks/__init__.py +7 -0
- finance_dev/_hooks/clientcredentials.py +319 -0
- finance_dev/_hooks/oauth2scopes.py +50 -0
- finance_dev/_hooks/registration.py +13 -0
- finance_dev/_hooks/sdkhooks.py +82 -0
- finance_dev/_hooks/types.py +125 -0
- finance_dev/_version.py +16 -0
- finance_dev/accounts.py +797 -0
- finance_dev/alternativedata.py +4830 -0
- finance_dev/analytics.py +3757 -0
- finance_dev/basesdk.py +393 -0
- finance_dev/calendar.py +1523 -0
- finance_dev/chart.py +1881 -0
- finance_dev/company.py +1105 -0
- finance_dev/corporateactions.py +1795 -0
- finance_dev/economy.py +1153 -0
- finance_dev/errors/__init__.py +94 -0
- finance_dev/errors/apierror.py +41 -0
- finance_dev/errors/authenticationerrorenvelope.py +43 -0
- finance_dev/errors/badrequest.py +34 -0
- finance_dev/errors/errorenvelope.py +42 -0
- finance_dev/errors/errorresponse.py +45 -0
- finance_dev/errors/financedevapierror.py +31 -0
- finance_dev/errors/forbidden.py +34 -0
- finance_dev/errors/internalservererror.py +35 -0
- finance_dev/errors/no_response_error.py +18 -0
- finance_dev/errors/notfound.py +34 -0
- finance_dev/errors/orderhistorybadrequest.py +35 -0
- finance_dev/errors/predorderserrorenvelope.py +42 -0
- finance_dev/errors/responsevalidationerror.py +28 -0
- finance_dev/errors/unauthorized.py +34 -0
- finance_dev/estimates.py +1906 -0
- finance_dev/etf.py +1108 -0
- finance_dev/filings.py +586 -0
- finance_dev/financials.py +4079 -0
- finance_dev/history.py +477 -0
- finance_dev/httpclient.py +126 -0
- finance_dev/indices.py +2308 -0
- finance_dev/logos.py +692 -0
- finance_dev/market.py +1825 -0
- finance_dev/markets.py +952 -0
- finance_dev/models/__init__.py +4568 -0
- finance_dev/models/accountbalancev2.py +340 -0
- finance_dev/models/accountitem.py +78 -0
- finance_dev/models/accountposition.py +147 -0
- finance_dev/models/aggregatetechnicalindicatorsresponse.py +192 -0
- finance_dev/models/analystinsightitem.py +161 -0
- finance_dev/models/analystinsightsresponse.py +39 -0
- finance_dev/models/apperror.py +123 -0
- finance_dev/models/authenticationerrordetail.py +58 -0
- finance_dev/models/bankbranchesresponse.py +96 -0
- finance_dev/models/basicfinancials.py +243 -0
- finance_dev/models/bullbearanalysisresponse.py +150 -0
- finance_dev/models/cancelorderop.py +40 -0
- finance_dev/models/cancelordrequest_union.py +287 -0
- finance_dev/models/cancelordresponse.py +115 -0
- finance_dev/models/cashflowstatement.py +290 -0
- finance_dev/models/cashflowstatementsresponse.py +61 -0
- finance_dev/models/chartbars.py +111 -0
- finance_dev/models/chartconfig.py +81 -0
- finance_dev/models/chartresolution.py +46 -0
- finance_dev/models/companyesgresponse.py +408 -0
- finance_dev/models/companyexecutive.py +70 -0
- finance_dev/models/companyexecutiveresponse.py +39 -0
- finance_dev/models/companypeersresponse.py +38 -0
- finance_dev/models/companypresentationresponse.py +96 -0
- finance_dev/models/companyprofile.py +255 -0
- finance_dev/models/conferencecallsresponse.py +169 -0
- finance_dev/models/congressionaltradingresponse.py +138 -0
- finance_dev/models/covid19uscasesresponse.py +79 -0
- finance_dev/models/createconfigwatchlistop.py +40 -0
- finance_dev/models/createwatchlistrequest.py +43 -0
- finance_dev/models/dailymarketsummaryresponse.py +73 -0
- finance_dev/models/deleteconfigwatchlistbyidop.py +53 -0
- finance_dev/models/dividenditem.py +125 -0
- finance_dev/models/dividendsresponse.py +61 -0
- finance_dev/models/earningrelease.py +291 -0
- finance_dev/models/earningscallliveresponse.py +103 -0
- finance_dev/models/earningsqualityscoreresponse.py +140 -0
- finance_dev/models/earningssurprisesresponse.py +125 -0
- finance_dev/models/ebitdaestimatesresponse.py +176 -0
- finance_dev/models/ebitestimatesresponse.py +176 -0
- finance_dev/models/economicscalendarevent.py +160 -0
- finance_dev/models/economicsindicator.py +87 -0
- finance_dev/models/epsestimatesresponse.py +176 -0
- finance_dev/models/equitydetailsdto.py +569 -0
- finance_dev/models/errorcode.py +48 -0
- finance_dev/models/etblistresponse.py +43 -0
- finance_dev/models/etbsearchrequest.py +21 -0
- finance_dev/models/etbsearchresponse.py +43 -0
- finance_dev/models/etfcountryallocationresponse.py +113 -0
- finance_dev/models/etfholdingsresponse.py +163 -0
- finance_dev/models/etfprofileresponse.py +234 -0
- finance_dev/models/etfsectorallocationresponse.py +113 -0
- finance_dev/models/exchangecode.py +90 -0
- finance_dev/models/fdaadvisorycommitteecalendarresponse.py +88 -0
- finance_dev/models/filingsimilarityrecord.py +115 -0
- finance_dev/models/filingssimilarityindexdatawrapper.py +52 -0
- finance_dev/models/filingssimilarityindexresponse.py +42 -0
- finance_dev/models/financialratiosresponse.py +252 -0
- finance_dev/models/financialsreporteddatawrapper.py +49 -0
- finance_dev/models/financialsreportedresponse.py +42 -0
- finance_dev/models/financialsrevenuebreakdowndatawrapper.py +49 -0
- finance_dev/models/financialsrevenuebreakdownresponse.py +42 -0
- finance_dev/models/financialsstatementsdatawrapper.py +44 -0
- finance_dev/models/financialsstatementsresponse.py +42 -0
- finance_dev/models/financialstatement.py +171 -0
- finance_dev/models/financialstatementtype.py +14 -0
- finance_dev/models/getaccountbalanceop.py +53 -0
- finance_dev/models/getaccountpositionsop.py +53 -0
- finance_dev/models/getaccountsresponse.py +22 -0
- finance_dev/models/getaggregatetechnicalindicatorsop.py +94 -0
- finance_dev/models/getanalystinsightsop.py +164 -0
- finance_dev/models/getbankbranchesop.py +53 -0
- finance_dev/models/getbaseeventop.py +87 -0
- finance_dev/models/getbullbearanalysisop.py +91 -0
- finance_dev/models/getcashflowstatementsop.py +564 -0
- finance_dev/models/getchartconfigop.py +40 -0
- finance_dev/models/getcharthistoryop.py +122 -0
- finance_dev/models/getcharttimeop.py +39 -0
- finance_dev/models/getcompanyesgop.py +53 -0
- finance_dev/models/getcompanyexecutivesop.py +56 -0
- finance_dev/models/getcompanymetricsop.py +68 -0
- finance_dev/models/getcompanypeersop.py +53 -0
- finance_dev/models/getcompanypresentationop.py +56 -0
- finance_dev/models/getcompanyprofileop.py +86 -0
- finance_dev/models/getconferencecallsop.py +111 -0
- finance_dev/models/getconfigwatchlistbyidop.py +53 -0
- finance_dev/models/getconfigwatchlistsop.py +40 -0
- finance_dev/models/getcongressionaltradingop.py +73 -0
- finance_dev/models/getcovid19uscasesop.py +43 -0
- finance_dev/models/getdailymarketsummaryop.py +92 -0
- finance_dev/models/getdividendsop.py +294 -0
- finance_dev/models/getearningscalendarop.py +87 -0
- finance_dev/models/getearningscallliveop.py +91 -0
- finance_dev/models/getearningsqualityscoreop.py +81 -0
- finance_dev/models/getearningssurprisesop.py +80 -0
- finance_dev/models/getebitdaestimatesop.py +91 -0
- finance_dev/models/getebitestimatesop.py +88 -0
- finance_dev/models/geteconomicscalendarop.py +92 -0
- finance_dev/models/geteconomicscalendarresponse.py +56 -0
- finance_dev/models/getepsestimatesop.py +88 -0
- finance_dev/models/getequitydetailsop.py +56 -0
- finance_dev/models/getequitydetailsresponse.py +45 -0
- finance_dev/models/getetblistop.py +40 -0
- finance_dev/models/getetfcountryallocationop.py +80 -0
- finance_dev/models/getetfholdingsop.py +96 -0
- finance_dev/models/getetfprofileop.py +77 -0
- finance_dev/models/getetfsectorallocationop.py +80 -0
- finance_dev/models/geteventcontractsop.py +87 -0
- finance_dev/models/getfdaadvisorycommitteecalendarop.py +47 -0
- finance_dev/models/getfilingssimilarityindexop.py +102 -0
- finance_dev/models/getfinancialratiosop.py +612 -0
- finance_dev/models/getfinancialstatementsop.py +117 -0
- finance_dev/models/getfundownershipop.py +77 -0
- finance_dev/models/gethistoricaldataop.py +61 -0
- finance_dev/models/gethistoricalesgop.py +53 -0
- finance_dev/models/gethistorybatchop.py +74 -0
- finance_dev/models/gethistoryop.py +123 -0
- finance_dev/models/getincomestatementsop.py +564 -0
- finance_dev/models/getindexbarop.py +140 -0
- finance_dev/models/getindexbarsop.py +149 -0
- finance_dev/models/getindexchartbarsop.py +178 -0
- finance_dev/models/getindexrealtimevaluesop.py +94 -0
- finance_dev/models/getinflationexpectationsop.py +157 -0
- finance_dev/models/getinflationop.py +154 -0
- finance_dev/models/getinsidertransactionsop.py +90 -0
- finance_dev/models/getinstitutionalownershipop.py +99 -0
- finance_dev/models/getinstitutionalportfolioop.py +75 -0
- finance_dev/models/getinvestmentthemeop.py +68 -0
- finance_dev/models/getipocalendarop.py +63 -0
- finance_dev/models/getlobbyingop.py +70 -0
- finance_dev/models/getmarketbreadthop.py +40 -0
- finance_dev/models/getmarketholidaysop.py +65 -0
- finance_dev/models/getmarketstatusop.py +65 -0
- finance_dev/models/getmergersandacquisitionsop.py +113 -0
- finance_dev/models/getnetinflowop.py +40 -0
- finance_dev/models/getnewsbyidop.py +73 -0
- finance_dev/models/getnewsop.py +98 -0
- finance_dev/models/getnewssentimentop.py +53 -0
- finance_dev/models/getoptionchainsnapshotop.py +244 -0
- finance_dev/models/getoptioncontractsnapshotop.py +69 -0
- finance_dev/models/getoptiondetailsop.py +56 -0
- finance_dev/models/getoptiondetailsresponse.py +45 -0
- finance_dev/models/getoptionlasttradeop.py +56 -0
- finance_dev/models/getoptionopencloseop.py +66 -0
- finance_dev/models/getoptionpreviousdayop.py +56 -0
- finance_dev/models/getoptionquotesop.py +177 -0
- finance_dev/models/getoptionsactivityop.py +111 -0
- finance_dev/models/getoptionsetfstopvolumeop.py +70 -0
- finance_dev/models/getoptionsstockstopgainersop.py +70 -0
- finance_dev/models/getoptionsstockstopvolumeop.py +70 -0
- finance_dev/models/getoptionsunusualactivityop.py +100 -0
- finance_dev/models/getoptiontradesop.py +177 -0
- finance_dev/models/getordersv2response.py +66 -0
- finance_dev/models/getownershipdataop.py +77 -0
- finance_dev/models/getpositionsresponse.py +39 -0
- finance_dev/models/getpredictionorderop.py +88 -0
- finance_dev/models/getpricetargetop.py +53 -0
- finance_dev/models/getquotesop.py +53 -0
- finance_dev/models/getratingsop.py +164 -0
- finance_dev/models/getratingsresponse.py +39 -0
- finance_dev/models/getreportedfinancialsop.py +127 -0
- finance_dev/models/getrevenuebreakdownop.py +85 -0
- finance_dev/models/getrevenueestimatesop.py +91 -0
- finance_dev/models/getsecfilingsop.py +113 -0
- finance_dev/models/getsectortickersop.py +124 -0
- finance_dev/models/getsectorwisechangeop.py +84 -0
- finance_dev/models/getshortinterestop.py +334 -0
- finance_dev/models/getshortvolumeop.py +333 -0
- finance_dev/models/getsocialsentimentop.py +90 -0
- finance_dev/models/getspinoffsop.py +112 -0
- finance_dev/models/getstockaggregatesop.py +174 -0
- finance_dev/models/getstocklastquoteop.py +56 -0
- finance_dev/models/getstocklasttradeop.py +56 -0
- finance_dev/models/getstockopencloseop.py +90 -0
- finance_dev/models/getstockpreviousdayop.py +80 -0
- finance_dev/models/getstockquotesop.py +177 -0
- finance_dev/models/getstocksnapshotsop.py +82 -0
- finance_dev/models/getstocksplitsop.py +243 -0
- finance_dev/models/getstocktradesop.py +177 -0
- finance_dev/models/getsupplychainop.py +53 -0
- finance_dev/models/getsupportresistancelevelsop.py +90 -0
- finance_dev/models/getsymbolinfoop.py +53 -0
- finance_dev/models/gettechnicalindicatorop.py +172 -0
- finance_dev/models/gettechnicalpatternsop.py +88 -0
- finance_dev/models/gettenderoffersop.py +112 -0
- finance_dev/models/gettickhistoryop.py +104 -0
- finance_dev/models/gettopgainersop.py +78 -0
- finance_dev/models/gettoplosersop.py +78 -0
- finance_dev/models/gettopmostactiveop.py +78 -0
- finance_dev/models/gettranscriptop.py +53 -0
- finance_dev/models/gettreasuryyieldsop.py +157 -0
- finance_dev/models/getunifiedsnapshotop.py +223 -0
- finance_dev/models/getupgradesdowngradesop.py +91 -0
- finance_dev/models/getusaspendingop.py +70 -0
- finance_dev/models/getuseraccountsop.py +40 -0
- finance_dev/models/getusptopatentsop.py +70 -0
- finance_dev/models/getvisaapplicationsop.py +73 -0
- finance_dev/models/historicalesgresponse.py +439 -0
- finance_dev/models/httpmetadata.py +24 -0
- finance_dev/models/incomestatement.py +296 -0
- finance_dev/models/incomestatementsresponse.py +61 -0
- finance_dev/models/indexbarresponse.py +194 -0
- finance_dev/models/indexbarsresponse.py +123 -0
- finance_dev/models/indexchartbarsresponse.py +213 -0
- finance_dev/models/indexgroupsresponse.py +78 -0
- finance_dev/models/indexlistresponse.py +95 -0
- finance_dev/models/indexsearchresponse.py +93 -0
- finance_dev/models/indicesbygroupresponse.py +93 -0
- finance_dev/models/indicesidentifiertype.py +28 -0
- finance_dev/models/indicesrealtimeindexinfo.py +67 -0
- finance_dev/models/indicesrealtimeindexvalue.py +157 -0
- finance_dev/models/indicesrealtimevaluesitem.py +80 -0
- finance_dev/models/indicesrealtimevaluesresponse.py +42 -0
- finance_dev/models/inflationexpectationsresponse.py +140 -0
- finance_dev/models/inflationresponse.py +132 -0
- finance_dev/models/insidertransaction.py +97 -0
- finance_dev/models/insidertransactionsresponse.py +39 -0
- finance_dev/models/institutionalholding.py +77 -0
- finance_dev/models/institutionalownershipresponse.py +39 -0
- finance_dev/models/institutionalportfolioresponse.py +39 -0
- finance_dev/models/investmentthemeid.py +35 -0
- finance_dev/models/investmentthemeresponse.py +80 -0
- finance_dev/models/ipocalendarresponse.py +39 -0
- finance_dev/models/ipoitem.py +93 -0
- finance_dev/models/listactiveordersop.py +87 -0
- finance_dev/models/listcategoriesop.py +79 -0
- finance_dev/models/listindexgroupsop.py +40 -0
- finance_dev/models/listindicesbygroupop.py +58 -0
- finance_dev/models/listindicesop.py +91 -0
- finance_dev/models/listoptioncontractsop.py +66 -0
- finance_dev/models/listoptionexpirydatesop.py +56 -0
- finance_dev/models/listorderhistoryop.py +139 -0
- finance_dev/models/listpredictionordersop.py +134 -0
- finance_dev/models/listtranscriptsop.py +53 -0
- finance_dev/models/lobbyingresponse.py +166 -0
- finance_dev/models/logosearchresponse.py +152 -0
- finance_dev/models/logosyncresponse.py +277 -0
- finance_dev/models/marketbreadth.py +97 -0
- finance_dev/models/marketbreadthresponse.py +44 -0
- finance_dev/models/marketholiday.py +56 -0
- finance_dev/models/marketholidayresponse.py +39 -0
- finance_dev/models/marketstatus.py +67 -0
- finance_dev/models/mergersandacquisitionsresponse.py +186 -0
- finance_dev/models/metricseriespoint.py +43 -0
- finance_dev/models/netinflow.py +81 -0
- finance_dev/models/netinflowresponse.py +44 -0
- finance_dev/models/newsitem.py +102 -0
- finance_dev/models/newslistresponse.py +128 -0
- finance_dev/models/newssentimentresponse.py +176 -0
- finance_dev/models/newstypeenum.py +16 -0
- finance_dev/models/optionchainsnapshotresponse.py +64 -0
- finance_dev/models/optioncontractsnapshotresponse.py +64 -0
- finance_dev/models/optioncontractsnapshotrow.py +164 -0
- finance_dev/models/optioncontractsresponse.py +131 -0
- finance_dev/models/optiondetailsdto.py +72 -0
- finance_dev/models/optionexpirydatesresponse.py +53 -0
- finance_dev/models/optionlasttraderesponse.py +169 -0
- finance_dev/models/optionopencloseresponse.py +97 -0
- finance_dev/models/optionpreviousdayresponse.py +89 -0
- finance_dev/models/optionquotesresponse.py +138 -0
- finance_dev/models/optionsactivityresponse.py +265 -0
- finance_dev/models/optionsnapshotcontractdetails.py +85 -0
- finance_dev/models/optionsnapshotdaybar.py +107 -0
- finance_dev/models/optionsnapshotgreeks.py +67 -0
- finance_dev/models/optionsnapshotlastquote.py +116 -0
- finance_dev/models/optionsnapshotlasttrade.py +102 -0
- finance_dev/models/optionsnapshotunderlying.py +86 -0
- finance_dev/models/optionsscreeneritem.py +151 -0
- finance_dev/models/optionsunusualactivityresponse.py +62 -0
- finance_dev/models/optionsunusualactivitytrade.py +103 -0
- finance_dev/models/optiontradesresponse.py +132 -0
- finance_dev/models/orderrequesttimeinforceenum.py +29 -0
- finance_dev/models/ordersideenum.py +20 -0
- finance_dev/models/ordertypeenum.py +20 -0
- finance_dev/models/ordleg.py +162 -0
- finance_dev/models/ordresponse.py +202 -0
- finance_dev/models/ownershipdataresponse.py +39 -0
- finance_dev/models/ownershiprecord.py +74 -0
- finance_dev/models/placeorderop.py +40 -0
- finance_dev/models/placeordrequest_union.py +335 -0
- finance_dev/models/placepredictionorderop.py +114 -0
- finance_dev/models/predmdbaseevent.py +62 -0
- finance_dev/models/predmdbaseeventhit.py +53 -0
- finance_dev/models/predmdbaseeventsearchresult.py +46 -0
- finance_dev/models/predmdbaseeventwithevents.py +32 -0
- finance_dev/models/predmdbatchhistoryrequest.py +16 -0
- finance_dev/models/predmdbatchhistoryresponse.py +16 -0
- finance_dev/models/predmdcategory.py +48 -0
- finance_dev/models/predmdcontract.py +177 -0
- finance_dev/models/predmdcontracthit.py +157 -0
- finance_dev/models/predmdcontractsearchresult.py +46 -0
- finance_dev/models/predmdevent.py +136 -0
- finance_dev/models/predmdeventhit.py +73 -0
- finance_dev/models/predmdeventsearchresult.py +46 -0
- finance_dev/models/predmdeventwithcontracts.py +22 -0
- finance_dev/models/predmdhistoryrequest.py +59 -0
- finance_dev/models/predmdhistoryresponse.py +53 -0
- finance_dev/models/predmdtick.py +53 -0
- finance_dev/models/predordersapperror.py +78 -0
- finance_dev/models/predordersorder.py +267 -0
- finance_dev/models/predordersorderdetail.py +26 -0
- finance_dev/models/predordersorderpage.py +45 -0
- finance_dev/models/predordersorderreport.py +88 -0
- finance_dev/models/predordersplaceorderrequest.py +159 -0
- finance_dev/models/previeworderop.py +40 -0
- finance_dev/models/previeworderresponse.py +127 -0
- finance_dev/models/pricetargetresponse.py +89 -0
- finance_dev/models/quotedata.py +49 -0
- finance_dev/models/quotesresponse.py +62 -0
- finance_dev/models/quotevalues.py +114 -0
- finance_dev/models/rating.py +193 -0
- finance_dev/models/ratingsaccuracy.py +242 -0
- finance_dev/models/replaceconfigwatchlistsop.py +40 -0
- finance_dev/models/replaceorderop.py +40 -0
- finance_dev/models/replaceordrequest_union.py +367 -0
- finance_dev/models/replaceordresponse.py +144 -0
- finance_dev/models/reportedbsitem.py +53 -0
- finance_dev/models/reportedfiling.py +110 -0
- finance_dev/models/reportedreport.py +39 -0
- finance_dev/models/reportingfrequency.py +16 -0
- finance_dev/models/revenuebreakdownaxis.py +52 -0
- finance_dev/models/revenuebreakdowndatapoint.py +58 -0
- finance_dev/models/revenuebreakdownentry.py +51 -0
- finance_dev/models/revenuebreakdowninner.py +75 -0
- finance_dev/models/revenueestimatesresponse.py +176 -0
- finance_dev/models/screenclause.py +70 -0
- finance_dev/models/screengroup.py +75 -0
- finance_dev/models/searchetbsymbolsop.py +40 -0
- finance_dev/models/searchindicesop.py +55 -0
- finance_dev/models/searchlogosop.py +158 -0
- finance_dev/models/searchmarketsymbolsop.py +80 -0
- finance_dev/models/searchop.py +232 -0
- finance_dev/models/searchsymbolitem.py +76 -0
- finance_dev/models/searchsymbolresponseitem.py +71 -0
- finance_dev/models/searchsymbolsop.py +77 -0
- finance_dev/models/secfiling.py +91 -0
- finance_dev/models/secfilingsresponse.py +39 -0
- finance_dev/models/sectoravgchange.py +50 -0
- finance_dev/models/security.py +59 -0
- finance_dev/models/securitytypeenum.py +16 -0
- finance_dev/models/shortinterestresponse.py +126 -0
- finance_dev/models/shortvolumeresponse.py +198 -0
- finance_dev/models/socialsentimentresponse.py +124 -0
- finance_dev/models/sortorderenum.py +13 -0
- finance_dev/models/spinoffsresponse.py +136 -0
- finance_dev/models/stockaggregatesresponse.py +92 -0
- finance_dev/models/stocklastquoteresponse.py +175 -0
- finance_dev/models/stocklasttraderesponse.py +169 -0
- finance_dev/models/stockohlcbar.py +85 -0
- finance_dev/models/stockopencloseresponse.py +109 -0
- finance_dev/models/stockpreviousdayresponse.py +86 -0
- finance_dev/models/stockquotesresponse.py +170 -0
- finance_dev/models/stockscreenerop.py +144 -0
- finance_dev/models/stockscreenerrequest.py +131 -0
- finance_dev/models/stockscreenerresponse.py +197 -0
- finance_dev/models/stocksnapshotsresponse.py +454 -0
- finance_dev/models/stocksplitsresponse.py +144 -0
- finance_dev/models/stocktradesresponse.py +164 -0
- finance_dev/models/supplychainresponse.py +158 -0
- finance_dev/models/supportresistancelevelsresponse.py +68 -0
- finance_dev/models/symboldetails.py +119 -0
- finance_dev/models/symbolerror.py +43 -0
- finance_dev/models/symbolinfo.py +183 -0
- finance_dev/models/synclogosop.py +146 -0
- finance_dev/models/technicalindicatorresponse.py +43 -0
- finance_dev/models/technicalindicatortype.py +21 -0
- finance_dev/models/technicalpatternsresponse.py +249 -0
- finance_dev/models/tenderofferidentifiertype.py +26 -0
- finance_dev/models/tenderoffersresponse.py +548 -0
- finance_dev/models/tickchartbars.py +104 -0
- finance_dev/models/tickresolution.py +20 -0
- finance_dev/models/timeinforceenum.py +26 -0
- finance_dev/models/tradeorderlegv2.py +164 -0
- finance_dev/models/tradeorderv2.py +434 -0
- finance_dev/models/transcriptresponse.py +162 -0
- finance_dev/models/transcriptsresponse.py +89 -0
- finance_dev/models/treasuryyieldsresponse.py +160 -0
- finance_dev/models/unifiedsnapshotresponse.py +308 -0
- finance_dev/models/updateconfigwatchlistbyidop.py +65 -0
- finance_dev/models/updatewatchlistrequest_union.py +134 -0
- finance_dev/models/upgradesdowngradesresponse.py +98 -0
- finance_dev/models/usaspendingresponse.py +222 -0
- finance_dev/models/usptopatentsresponse.py +134 -0
- finance_dev/models/visaapplicationsresponse.py +228 -0
- finance_dev/models/watchlist.py +68 -0
- finance_dev/models/watchlistrequest.py +43 -0
- finance_dev/models/watchlistresponse.py +44 -0
- finance_dev/news_sdk.py +829 -0
- finance_dev/options.py +3443 -0
- finance_dev/orders.py +1907 -0
- finance_dev/ownership.py +1386 -0
- finance_dev/predictions.py +29 -0
- finance_dev/predictions_orders.py +852 -0
- finance_dev/py.typed +1 -0
- finance_dev/sdk.py +347 -0
- finance_dev/sdkconfiguration.py +50 -0
- finance_dev/signals.py +338 -0
- finance_dev/stocks.py +3131 -0
- finance_dev/technicalanalysis_sdk.py +1137 -0
- finance_dev/types/__init__.py +25 -0
- finance_dev/types/base64fileinput.py +44 -0
- finance_dev/types/basemodel.py +78 -0
- finance_dev/utils/__init__.py +181 -0
- finance_dev/utils/annotations.py +80 -0
- finance_dev/utils/datetimes.py +42 -0
- finance_dev/utils/dynamic_imports.py +55 -0
- finance_dev/utils/enums.py +135 -0
- finance_dev/utils/eventstreaming.py +327 -0
- finance_dev/utils/forms.py +240 -0
- finance_dev/utils/headers.py +137 -0
- finance_dev/utils/logger.py +23 -0
- finance_dev/utils/metadata.py +120 -0
- finance_dev/utils/queryparams.py +218 -0
- finance_dev/utils/requestbodies.py +68 -0
- finance_dev/utils/retries.py +373 -0
- finance_dev/utils/security.py +199 -0
- finance_dev/utils/serializers.py +327 -0
- finance_dev/utils/unmarshal_json_response.py +39 -0
- finance_dev/utils/url.py +155 -0
- finance_dev/utils/values.py +143 -0
- finance_dev/watchlist_sdk.py +1583 -0
- finance_dev/websocket/__init__.py +57 -0
- finance_dev/websocket/account.py +5 -0
- finance_dev/websocket/auth.py +124 -0
- finance_dev/websocket/chart.py +5 -0
- finance_dev/websocket/codec.py +66 -0
- finance_dev/websocket/config.py +52 -0
- finance_dev/websocket/errors.py +54 -0
- finance_dev/websocket/market.py +5 -0
- finance_dev/websocket/models/__init__.py +52 -0
- finance_dev/websocket/models/account.py +60 -0
- finance_dev/websocket/models/chart.py +44 -0
- finance_dev/websocket/models/common.py +85 -0
- finance_dev/websocket/models/market.py +113 -0
- finance_dev/websocket/resources.py +327 -0
- finance_dev/websocket/sdk.py +13 -0
- finance_dev/websocket/transport/async_connection.py +493 -0
- finance_dev/websocket/transport/base.py +78 -0
- finance_dev/websocket/transport/sync_connection.py +470 -0
- finance_dev-0.9.0.dist-info/METADATA +913 -0
- finance_dev-0.9.0.dist-info/RECORD +486 -0
- finance_dev-0.9.0.dist-info/WHEEL +5 -0
- finance_dev-0.9.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,4079 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
# @generated-id: 35a0e3edc5ef
|
|
3
|
+
|
|
4
|
+
from .basesdk import BaseSDK
|
|
5
|
+
from datetime import date
|
|
6
|
+
from finance_dev import errors, models, utils
|
|
7
|
+
from finance_dev._hooks import HookContext
|
|
8
|
+
from finance_dev.types import OptionalNullable, UNSET
|
|
9
|
+
from finance_dev.utils.unmarshal_json_response import unmarshal_json_response
|
|
10
|
+
from jsonpath import JSONPath
|
|
11
|
+
from typing import Any, Dict, List, Mapping, Optional, Union
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class Financials(BaseSDK):
|
|
15
|
+
def get_cash_flow_statements(
|
|
16
|
+
self,
|
|
17
|
+
*,
|
|
18
|
+
cik: Optional[str] = None,
|
|
19
|
+
ciks: Optional[str] = None,
|
|
20
|
+
cik_after: Optional[str] = None,
|
|
21
|
+
cik_from: Optional[str] = None,
|
|
22
|
+
cik_before: Optional[str] = None,
|
|
23
|
+
cik_to: Optional[str] = None,
|
|
24
|
+
period_end: Optional[date] = None,
|
|
25
|
+
period_end_after: Optional[date] = None,
|
|
26
|
+
period_end_from: Optional[date] = None,
|
|
27
|
+
period_end_before: Optional[date] = None,
|
|
28
|
+
period_end_to: Optional[date] = None,
|
|
29
|
+
filing_date: Optional[date] = None,
|
|
30
|
+
filing_date_after: Optional[date] = None,
|
|
31
|
+
filing_date_from: Optional[date] = None,
|
|
32
|
+
filing_date_before: Optional[date] = None,
|
|
33
|
+
filing_date_to: Optional[date] = None,
|
|
34
|
+
tickers: Optional[str] = None,
|
|
35
|
+
tickers_all_of: Optional[str] = None,
|
|
36
|
+
tickers_any_of: Optional[str] = None,
|
|
37
|
+
fiscal_year: Optional[float] = None,
|
|
38
|
+
fiscal_year_above: Optional[float] = None,
|
|
39
|
+
fiscal_year_min: Optional[float] = None,
|
|
40
|
+
fiscal_year_below: Optional[float] = None,
|
|
41
|
+
fiscal_year_max: Optional[float] = None,
|
|
42
|
+
fiscal_quarter: Optional[float] = None,
|
|
43
|
+
fiscal_quarter_above: Optional[float] = None,
|
|
44
|
+
fiscal_quarter_min: Optional[float] = None,
|
|
45
|
+
fiscal_quarter_below: Optional[float] = None,
|
|
46
|
+
fiscal_quarter_max: Optional[float] = None,
|
|
47
|
+
timeframe: Optional[str] = None,
|
|
48
|
+
timeframe_any_of: Optional[str] = None,
|
|
49
|
+
timeframe_after: Optional[str] = None,
|
|
50
|
+
timeframe_from: Optional[str] = None,
|
|
51
|
+
timeframe_before: Optional[str] = None,
|
|
52
|
+
timeframe_to: Optional[str] = None,
|
|
53
|
+
max_ticker: Optional[str] = None,
|
|
54
|
+
max_ticker_any_of: Optional[str] = None,
|
|
55
|
+
max_ticker_after: Optional[str] = None,
|
|
56
|
+
max_ticker_from: Optional[str] = None,
|
|
57
|
+
max_ticker_before: Optional[str] = None,
|
|
58
|
+
max_ticker_to: Optional[str] = None,
|
|
59
|
+
min_ticker: Optional[str] = None,
|
|
60
|
+
min_ticker_any_of: Optional[str] = None,
|
|
61
|
+
min_ticker_after: Optional[str] = None,
|
|
62
|
+
min_ticker_from: Optional[str] = None,
|
|
63
|
+
min_ticker_before: Optional[str] = None,
|
|
64
|
+
min_ticker_to: Optional[str] = None,
|
|
65
|
+
limit: Optional[int] = None,
|
|
66
|
+
sort: Optional[str] = None,
|
|
67
|
+
next: Optional[str] = None,
|
|
68
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
69
|
+
server_url: Optional[str] = None,
|
|
70
|
+
url_override: Optional[str] = None,
|
|
71
|
+
timeout_ms: Optional[int] = None,
|
|
72
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
73
|
+
) -> Optional[models.GetCashFlowStatementsResponse]:
|
|
74
|
+
r"""Get Cash Flow Statements
|
|
75
|
+
|
|
76
|
+
Retrieve SEC cash flow statement rows per filing period. Filter by CIK, tickers, filing or period dates, fiscal year/quarter, timeframe, and pagination. Same query shape as income statements.
|
|
77
|
+
|
|
78
|
+
If set, this operation will use `client_id` from the global security.
|
|
79
|
+
|
|
80
|
+
:param cik: Exact SEC CIK company identifier. Use this when you need one specific SEC registrant.
|
|
81
|
+
:param ciks: Comma-separated CIKs (maps to cik.any_of)
|
|
82
|
+
:param cik_after: CIK pagination lower bound. Returns records with CIK values greater than this value, excluding the value itself.
|
|
83
|
+
:param cik_from: CIK greater than or equal (inclusive)
|
|
84
|
+
:param cik_before: CIK pagination upper bound. Returns records with CIK values less than this value, excluding the value itself.
|
|
85
|
+
:param cik_to: CIK upper-bound filter. Returns records with CIK values less than or equal to this value.
|
|
86
|
+
:param period_end: Exact fiscal period-end date filter. Use it to return statements for one reporting period.
|
|
87
|
+
:param period_end_after: Fiscal period-end lower-bound filter. Returns records after this date, excluding the date itself.
|
|
88
|
+
:param period_end_from: Fiscal period-end start filter. Returns records on or after this date.
|
|
89
|
+
:param period_end_before: Fiscal period-end upper-bound filter. Returns records before this date, excluding the date itself.
|
|
90
|
+
:param period_end_to: Fiscal period-end end filter. Returns records on or before this date.
|
|
91
|
+
:param filing_date: Exact filing date filter. Use it to return filings submitted on one specific date.
|
|
92
|
+
:param filing_date_after: Filing-date lower-bound filter. Returns records after this date, excluding the date itself.
|
|
93
|
+
:param filing_date_from: Filing-date start filter. Returns records on or after this date.
|
|
94
|
+
:param filing_date_before: Filing-date upper-bound filter. Returns records before this date, excluding the date itself.
|
|
95
|
+
:param filing_date_to: Filing-date end filter. Returns records on or before this date.
|
|
96
|
+
:param tickers: Ticker symbol filter. Enter a ticker such as AAPL to narrow results to one company.
|
|
97
|
+
:param tickers_all_of: Ticker all-of filter. Return records that include all listed tickers.
|
|
98
|
+
:param tickers_any_of: Ticker any-of filter. Return records that include at least one listed ticker.
|
|
99
|
+
:param fiscal_year: Exact fiscal year filter. Use it to return statements for one reporting year.
|
|
100
|
+
:param fiscal_year_above: Fiscal year greater than (exclusive)
|
|
101
|
+
:param fiscal_year_min: Fiscal year greater than or equal (inclusive)
|
|
102
|
+
:param fiscal_year_below: Fiscal-year upper-bound filter. Returns records before this fiscal year, excluding the year itself.
|
|
103
|
+
:param fiscal_year_max: Fiscal year less than or equal (inclusive)
|
|
104
|
+
:param fiscal_quarter: Exact fiscal quarter filter. Use values such as 1, 2, 3, or 4 when supported.
|
|
105
|
+
:param fiscal_quarter_above: Fiscal quarter greater than (exclusive)
|
|
106
|
+
:param fiscal_quarter_min: Fiscal quarter greater than or equal (inclusive)
|
|
107
|
+
:param fiscal_quarter_below: Fiscal quarter less than (exclusive)
|
|
108
|
+
:param fiscal_quarter_max: Fiscal quarter less than or equal (inclusive)
|
|
109
|
+
:param timeframe: Reporting timeframe (e.g. quarterly, annual)
|
|
110
|
+
:param timeframe_any_of: Timeframe any-of filter. Return records that match at least one listed timeframe.
|
|
111
|
+
:param timeframe_after: Timeframe lower-bound filter. Returns records after this timeframe, excluding the value itself.
|
|
112
|
+
:param timeframe_from: Timeframe greater than or equal (inclusive)
|
|
113
|
+
:param timeframe_before: Timeframe upper-bound filter. Returns records before this timeframe, excluding the value itself.
|
|
114
|
+
:param timeframe_to: Timeframe less than or equal (inclusive)
|
|
115
|
+
:param max_ticker: Exact maximum ticker value from the statement record. Use only for provider-specific filtering.
|
|
116
|
+
:param max_ticker_any_of: Max ticker any-of filter. Return records matching at least one listed maxTicker value.
|
|
117
|
+
:param max_ticker_after: Max ticker greater than (exclusive)
|
|
118
|
+
:param max_ticker_from: Max ticker greater than or equal (inclusive)
|
|
119
|
+
:param max_ticker_before: Max ticker upper-bound filter. Returns records before this value, excluding the value itself.
|
|
120
|
+
:param max_ticker_to: Max ticker less than or equal (inclusive)
|
|
121
|
+
:param min_ticker: Exact minimum ticker value from the statement record. Use only for provider-specific filtering.
|
|
122
|
+
:param min_ticker_any_of: Min ticker any-of filter. Return records matching at least one listed minTicker value.
|
|
123
|
+
:param min_ticker_after: Min ticker greater than (exclusive)
|
|
124
|
+
:param min_ticker_from: Min ticker greater than or equal (inclusive)
|
|
125
|
+
:param min_ticker_before: Min ticker upper-bound filter. Returns records before this value, excluding the value itself.
|
|
126
|
+
:param min_ticker_to: Min ticker less than or equal (inclusive)
|
|
127
|
+
:param limit: Maximum number of results per page. Use smaller values for UI pages and larger values for exports within API limits.
|
|
128
|
+
:param sort: A comma-separated list of sort columns. For each column, append `.asc` or `.desc` to specify direction. Defaults to `period_end.asc` when not specified.
|
|
129
|
+
:param next: Pagination cursor from the previous response. Omit it on the first request, then send the returned cursor to fetch the next page.
|
|
130
|
+
:param retries: Override the default retry configuration for this method
|
|
131
|
+
:param server_url: Override the default server URL for this method
|
|
132
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
133
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
134
|
+
"""
|
|
135
|
+
base_url = None
|
|
136
|
+
url_variables = None
|
|
137
|
+
if timeout_ms is None:
|
|
138
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
139
|
+
|
|
140
|
+
if timeout_ms is None:
|
|
141
|
+
timeout_ms = 30000
|
|
142
|
+
|
|
143
|
+
if server_url is not None:
|
|
144
|
+
base_url = server_url
|
|
145
|
+
else:
|
|
146
|
+
base_url = self._get_url(base_url, url_variables)
|
|
147
|
+
|
|
148
|
+
request = models.GetCashFlowStatementsRequest(
|
|
149
|
+
cik=cik,
|
|
150
|
+
ciks=ciks,
|
|
151
|
+
cik_after=cik_after,
|
|
152
|
+
cik_from=cik_from,
|
|
153
|
+
cik_before=cik_before,
|
|
154
|
+
cik_to=cik_to,
|
|
155
|
+
period_end=period_end,
|
|
156
|
+
period_end_after=period_end_after,
|
|
157
|
+
period_end_from=period_end_from,
|
|
158
|
+
period_end_before=period_end_before,
|
|
159
|
+
period_end_to=period_end_to,
|
|
160
|
+
filing_date=filing_date,
|
|
161
|
+
filing_date_after=filing_date_after,
|
|
162
|
+
filing_date_from=filing_date_from,
|
|
163
|
+
filing_date_before=filing_date_before,
|
|
164
|
+
filing_date_to=filing_date_to,
|
|
165
|
+
tickers=tickers,
|
|
166
|
+
tickers_all_of=tickers_all_of,
|
|
167
|
+
tickers_any_of=tickers_any_of,
|
|
168
|
+
fiscal_year=fiscal_year,
|
|
169
|
+
fiscal_year_above=fiscal_year_above,
|
|
170
|
+
fiscal_year_min=fiscal_year_min,
|
|
171
|
+
fiscal_year_below=fiscal_year_below,
|
|
172
|
+
fiscal_year_max=fiscal_year_max,
|
|
173
|
+
fiscal_quarter=fiscal_quarter,
|
|
174
|
+
fiscal_quarter_above=fiscal_quarter_above,
|
|
175
|
+
fiscal_quarter_min=fiscal_quarter_min,
|
|
176
|
+
fiscal_quarter_below=fiscal_quarter_below,
|
|
177
|
+
fiscal_quarter_max=fiscal_quarter_max,
|
|
178
|
+
timeframe=timeframe,
|
|
179
|
+
timeframe_any_of=timeframe_any_of,
|
|
180
|
+
timeframe_after=timeframe_after,
|
|
181
|
+
timeframe_from=timeframe_from,
|
|
182
|
+
timeframe_before=timeframe_before,
|
|
183
|
+
timeframe_to=timeframe_to,
|
|
184
|
+
max_ticker=max_ticker,
|
|
185
|
+
max_ticker_any_of=max_ticker_any_of,
|
|
186
|
+
max_ticker_after=max_ticker_after,
|
|
187
|
+
max_ticker_from=max_ticker_from,
|
|
188
|
+
max_ticker_before=max_ticker_before,
|
|
189
|
+
max_ticker_to=max_ticker_to,
|
|
190
|
+
min_ticker=min_ticker,
|
|
191
|
+
min_ticker_any_of=min_ticker_any_of,
|
|
192
|
+
min_ticker_after=min_ticker_after,
|
|
193
|
+
min_ticker_from=min_ticker_from,
|
|
194
|
+
min_ticker_before=min_ticker_before,
|
|
195
|
+
min_ticker_to=min_ticker_to,
|
|
196
|
+
limit=limit,
|
|
197
|
+
sort=sort,
|
|
198
|
+
next=next,
|
|
199
|
+
)
|
|
200
|
+
|
|
201
|
+
req = self._build_request(
|
|
202
|
+
method="GET",
|
|
203
|
+
path="/v1/financials/cash-flow-statements",
|
|
204
|
+
base_url=base_url,
|
|
205
|
+
url_variables=url_variables,
|
|
206
|
+
url_override=url_override,
|
|
207
|
+
request=request,
|
|
208
|
+
request_body_required=False,
|
|
209
|
+
request_has_path_params=False,
|
|
210
|
+
request_has_query_params=True,
|
|
211
|
+
user_agent_header="user-agent",
|
|
212
|
+
accept_header_value="application/json",
|
|
213
|
+
http_headers=http_headers,
|
|
214
|
+
security=self.sdk_configuration.security,
|
|
215
|
+
allow_empty_value=None,
|
|
216
|
+
allowed_fields=["client_id"],
|
|
217
|
+
timeout_ms=timeout_ms,
|
|
218
|
+
)
|
|
219
|
+
|
|
220
|
+
if retries == UNSET:
|
|
221
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
222
|
+
retries = self.sdk_configuration.retry_config
|
|
223
|
+
else:
|
|
224
|
+
retries = utils.RetryConfig(
|
|
225
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
226
|
+
)
|
|
227
|
+
|
|
228
|
+
retry_config = None
|
|
229
|
+
if isinstance(retries, utils.RetryConfig):
|
|
230
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
231
|
+
|
|
232
|
+
http_res = self.do_request(
|
|
233
|
+
hook_ctx=HookContext(
|
|
234
|
+
config=self.sdk_configuration,
|
|
235
|
+
base_url=base_url or "",
|
|
236
|
+
operation_id="getCashFlowStatements",
|
|
237
|
+
oauth2_scopes=["market:supplemental"],
|
|
238
|
+
security_source=self.sdk_configuration.security,
|
|
239
|
+
tags=["Financials"],
|
|
240
|
+
extensions=None,
|
|
241
|
+
),
|
|
242
|
+
request=req,
|
|
243
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
244
|
+
retry_config=retry_config,
|
|
245
|
+
)
|
|
246
|
+
|
|
247
|
+
def next_func() -> Optional[models.GetCashFlowStatementsResponse]:
|
|
248
|
+
body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]])
|
|
249
|
+
next_url_match = JSONPath("$.nextUrl").parse(body)
|
|
250
|
+
if len(next_url_match) == 0:
|
|
251
|
+
return None
|
|
252
|
+
|
|
253
|
+
next_url = next_url_match[0]
|
|
254
|
+
if not next_url:
|
|
255
|
+
return None
|
|
256
|
+
|
|
257
|
+
if next_url[0] == "/":
|
|
258
|
+
url = self._get_url(base_url, url_variables)
|
|
259
|
+
next_url = url + next_url
|
|
260
|
+
|
|
261
|
+
return self.get_cash_flow_statements(
|
|
262
|
+
cik=cik,
|
|
263
|
+
ciks=ciks,
|
|
264
|
+
cik_after=cik_after,
|
|
265
|
+
cik_from=cik_from,
|
|
266
|
+
cik_before=cik_before,
|
|
267
|
+
cik_to=cik_to,
|
|
268
|
+
period_end=period_end,
|
|
269
|
+
period_end_after=period_end_after,
|
|
270
|
+
period_end_from=period_end_from,
|
|
271
|
+
period_end_before=period_end_before,
|
|
272
|
+
period_end_to=period_end_to,
|
|
273
|
+
filing_date=filing_date,
|
|
274
|
+
filing_date_after=filing_date_after,
|
|
275
|
+
filing_date_from=filing_date_from,
|
|
276
|
+
filing_date_before=filing_date_before,
|
|
277
|
+
filing_date_to=filing_date_to,
|
|
278
|
+
tickers=tickers,
|
|
279
|
+
tickers_all_of=tickers_all_of,
|
|
280
|
+
tickers_any_of=tickers_any_of,
|
|
281
|
+
fiscal_year=fiscal_year,
|
|
282
|
+
fiscal_year_above=fiscal_year_above,
|
|
283
|
+
fiscal_year_min=fiscal_year_min,
|
|
284
|
+
fiscal_year_below=fiscal_year_below,
|
|
285
|
+
fiscal_year_max=fiscal_year_max,
|
|
286
|
+
fiscal_quarter=fiscal_quarter,
|
|
287
|
+
fiscal_quarter_above=fiscal_quarter_above,
|
|
288
|
+
fiscal_quarter_min=fiscal_quarter_min,
|
|
289
|
+
fiscal_quarter_below=fiscal_quarter_below,
|
|
290
|
+
fiscal_quarter_max=fiscal_quarter_max,
|
|
291
|
+
timeframe=timeframe,
|
|
292
|
+
timeframe_any_of=timeframe_any_of,
|
|
293
|
+
timeframe_after=timeframe_after,
|
|
294
|
+
timeframe_from=timeframe_from,
|
|
295
|
+
timeframe_before=timeframe_before,
|
|
296
|
+
timeframe_to=timeframe_to,
|
|
297
|
+
max_ticker=max_ticker,
|
|
298
|
+
max_ticker_any_of=max_ticker_any_of,
|
|
299
|
+
max_ticker_after=max_ticker_after,
|
|
300
|
+
max_ticker_from=max_ticker_from,
|
|
301
|
+
max_ticker_before=max_ticker_before,
|
|
302
|
+
max_ticker_to=max_ticker_to,
|
|
303
|
+
min_ticker=min_ticker,
|
|
304
|
+
min_ticker_any_of=min_ticker_any_of,
|
|
305
|
+
min_ticker_after=min_ticker_after,
|
|
306
|
+
min_ticker_from=min_ticker_from,
|
|
307
|
+
min_ticker_before=min_ticker_before,
|
|
308
|
+
min_ticker_to=min_ticker_to,
|
|
309
|
+
limit=limit,
|
|
310
|
+
sort=sort,
|
|
311
|
+
next=next,
|
|
312
|
+
retries=retries,
|
|
313
|
+
server_url=server_url,
|
|
314
|
+
timeout_ms=timeout_ms,
|
|
315
|
+
http_headers=http_headers,
|
|
316
|
+
url_override=next_url,
|
|
317
|
+
)
|
|
318
|
+
|
|
319
|
+
response_data: Any = None
|
|
320
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
321
|
+
return models.GetCashFlowStatementsResponse(
|
|
322
|
+
cash_flow_statements_response=unmarshal_json_response(
|
|
323
|
+
Optional[models.CashFlowStatementsResponse], http_res
|
|
324
|
+
),
|
|
325
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
326
|
+
next=next_func,
|
|
327
|
+
)
|
|
328
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
329
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
330
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
331
|
+
request=req, response=http_res
|
|
332
|
+
)
|
|
333
|
+
raise errors.BadRequest(response_data, http_res)
|
|
334
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
335
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
336
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
337
|
+
request=req, response=http_res
|
|
338
|
+
)
|
|
339
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
340
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
341
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
342
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
343
|
+
request=req, response=http_res
|
|
344
|
+
)
|
|
345
|
+
raise errors.Forbidden(response_data, http_res)
|
|
346
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
347
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
348
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
349
|
+
request=req, response=http_res
|
|
350
|
+
)
|
|
351
|
+
raise errors.NotFound(response_data, http_res)
|
|
352
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
353
|
+
response_data = unmarshal_json_response(
|
|
354
|
+
errors.InternalServerErrorUnion, http_res
|
|
355
|
+
)
|
|
356
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
357
|
+
request=req, response=http_res
|
|
358
|
+
)
|
|
359
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
360
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
361
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
362
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
363
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
364
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
365
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
366
|
+
|
|
367
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
368
|
+
|
|
369
|
+
async def get_cash_flow_statements_async(
|
|
370
|
+
self,
|
|
371
|
+
*,
|
|
372
|
+
cik: Optional[str] = None,
|
|
373
|
+
ciks: Optional[str] = None,
|
|
374
|
+
cik_after: Optional[str] = None,
|
|
375
|
+
cik_from: Optional[str] = None,
|
|
376
|
+
cik_before: Optional[str] = None,
|
|
377
|
+
cik_to: Optional[str] = None,
|
|
378
|
+
period_end: Optional[date] = None,
|
|
379
|
+
period_end_after: Optional[date] = None,
|
|
380
|
+
period_end_from: Optional[date] = None,
|
|
381
|
+
period_end_before: Optional[date] = None,
|
|
382
|
+
period_end_to: Optional[date] = None,
|
|
383
|
+
filing_date: Optional[date] = None,
|
|
384
|
+
filing_date_after: Optional[date] = None,
|
|
385
|
+
filing_date_from: Optional[date] = None,
|
|
386
|
+
filing_date_before: Optional[date] = None,
|
|
387
|
+
filing_date_to: Optional[date] = None,
|
|
388
|
+
tickers: Optional[str] = None,
|
|
389
|
+
tickers_all_of: Optional[str] = None,
|
|
390
|
+
tickers_any_of: Optional[str] = None,
|
|
391
|
+
fiscal_year: Optional[float] = None,
|
|
392
|
+
fiscal_year_above: Optional[float] = None,
|
|
393
|
+
fiscal_year_min: Optional[float] = None,
|
|
394
|
+
fiscal_year_below: Optional[float] = None,
|
|
395
|
+
fiscal_year_max: Optional[float] = None,
|
|
396
|
+
fiscal_quarter: Optional[float] = None,
|
|
397
|
+
fiscal_quarter_above: Optional[float] = None,
|
|
398
|
+
fiscal_quarter_min: Optional[float] = None,
|
|
399
|
+
fiscal_quarter_below: Optional[float] = None,
|
|
400
|
+
fiscal_quarter_max: Optional[float] = None,
|
|
401
|
+
timeframe: Optional[str] = None,
|
|
402
|
+
timeframe_any_of: Optional[str] = None,
|
|
403
|
+
timeframe_after: Optional[str] = None,
|
|
404
|
+
timeframe_from: Optional[str] = None,
|
|
405
|
+
timeframe_before: Optional[str] = None,
|
|
406
|
+
timeframe_to: Optional[str] = None,
|
|
407
|
+
max_ticker: Optional[str] = None,
|
|
408
|
+
max_ticker_any_of: Optional[str] = None,
|
|
409
|
+
max_ticker_after: Optional[str] = None,
|
|
410
|
+
max_ticker_from: Optional[str] = None,
|
|
411
|
+
max_ticker_before: Optional[str] = None,
|
|
412
|
+
max_ticker_to: Optional[str] = None,
|
|
413
|
+
min_ticker: Optional[str] = None,
|
|
414
|
+
min_ticker_any_of: Optional[str] = None,
|
|
415
|
+
min_ticker_after: Optional[str] = None,
|
|
416
|
+
min_ticker_from: Optional[str] = None,
|
|
417
|
+
min_ticker_before: Optional[str] = None,
|
|
418
|
+
min_ticker_to: Optional[str] = None,
|
|
419
|
+
limit: Optional[int] = None,
|
|
420
|
+
sort: Optional[str] = None,
|
|
421
|
+
next: Optional[str] = None,
|
|
422
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
423
|
+
server_url: Optional[str] = None,
|
|
424
|
+
url_override: Optional[str] = None,
|
|
425
|
+
timeout_ms: Optional[int] = None,
|
|
426
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
427
|
+
) -> Optional[models.GetCashFlowStatementsResponse]:
|
|
428
|
+
r"""Get Cash Flow Statements
|
|
429
|
+
|
|
430
|
+
Retrieve SEC cash flow statement rows per filing period. Filter by CIK, tickers, filing or period dates, fiscal year/quarter, timeframe, and pagination. Same query shape as income statements.
|
|
431
|
+
|
|
432
|
+
If set, this operation will use `client_id` from the global security.
|
|
433
|
+
|
|
434
|
+
:param cik: Exact SEC CIK company identifier. Use this when you need one specific SEC registrant.
|
|
435
|
+
:param ciks: Comma-separated CIKs (maps to cik.any_of)
|
|
436
|
+
:param cik_after: CIK pagination lower bound. Returns records with CIK values greater than this value, excluding the value itself.
|
|
437
|
+
:param cik_from: CIK greater than or equal (inclusive)
|
|
438
|
+
:param cik_before: CIK pagination upper bound. Returns records with CIK values less than this value, excluding the value itself.
|
|
439
|
+
:param cik_to: CIK upper-bound filter. Returns records with CIK values less than or equal to this value.
|
|
440
|
+
:param period_end: Exact fiscal period-end date filter. Use it to return statements for one reporting period.
|
|
441
|
+
:param period_end_after: Fiscal period-end lower-bound filter. Returns records after this date, excluding the date itself.
|
|
442
|
+
:param period_end_from: Fiscal period-end start filter. Returns records on or after this date.
|
|
443
|
+
:param period_end_before: Fiscal period-end upper-bound filter. Returns records before this date, excluding the date itself.
|
|
444
|
+
:param period_end_to: Fiscal period-end end filter. Returns records on or before this date.
|
|
445
|
+
:param filing_date: Exact filing date filter. Use it to return filings submitted on one specific date.
|
|
446
|
+
:param filing_date_after: Filing-date lower-bound filter. Returns records after this date, excluding the date itself.
|
|
447
|
+
:param filing_date_from: Filing-date start filter. Returns records on or after this date.
|
|
448
|
+
:param filing_date_before: Filing-date upper-bound filter. Returns records before this date, excluding the date itself.
|
|
449
|
+
:param filing_date_to: Filing-date end filter. Returns records on or before this date.
|
|
450
|
+
:param tickers: Ticker symbol filter. Enter a ticker such as AAPL to narrow results to one company.
|
|
451
|
+
:param tickers_all_of: Ticker all-of filter. Return records that include all listed tickers.
|
|
452
|
+
:param tickers_any_of: Ticker any-of filter. Return records that include at least one listed ticker.
|
|
453
|
+
:param fiscal_year: Exact fiscal year filter. Use it to return statements for one reporting year.
|
|
454
|
+
:param fiscal_year_above: Fiscal year greater than (exclusive)
|
|
455
|
+
:param fiscal_year_min: Fiscal year greater than or equal (inclusive)
|
|
456
|
+
:param fiscal_year_below: Fiscal-year upper-bound filter. Returns records before this fiscal year, excluding the year itself.
|
|
457
|
+
:param fiscal_year_max: Fiscal year less than or equal (inclusive)
|
|
458
|
+
:param fiscal_quarter: Exact fiscal quarter filter. Use values such as 1, 2, 3, or 4 when supported.
|
|
459
|
+
:param fiscal_quarter_above: Fiscal quarter greater than (exclusive)
|
|
460
|
+
:param fiscal_quarter_min: Fiscal quarter greater than or equal (inclusive)
|
|
461
|
+
:param fiscal_quarter_below: Fiscal quarter less than (exclusive)
|
|
462
|
+
:param fiscal_quarter_max: Fiscal quarter less than or equal (inclusive)
|
|
463
|
+
:param timeframe: Reporting timeframe (e.g. quarterly, annual)
|
|
464
|
+
:param timeframe_any_of: Timeframe any-of filter. Return records that match at least one listed timeframe.
|
|
465
|
+
:param timeframe_after: Timeframe lower-bound filter. Returns records after this timeframe, excluding the value itself.
|
|
466
|
+
:param timeframe_from: Timeframe greater than or equal (inclusive)
|
|
467
|
+
:param timeframe_before: Timeframe upper-bound filter. Returns records before this timeframe, excluding the value itself.
|
|
468
|
+
:param timeframe_to: Timeframe less than or equal (inclusive)
|
|
469
|
+
:param max_ticker: Exact maximum ticker value from the statement record. Use only for provider-specific filtering.
|
|
470
|
+
:param max_ticker_any_of: Max ticker any-of filter. Return records matching at least one listed maxTicker value.
|
|
471
|
+
:param max_ticker_after: Max ticker greater than (exclusive)
|
|
472
|
+
:param max_ticker_from: Max ticker greater than or equal (inclusive)
|
|
473
|
+
:param max_ticker_before: Max ticker upper-bound filter. Returns records before this value, excluding the value itself.
|
|
474
|
+
:param max_ticker_to: Max ticker less than or equal (inclusive)
|
|
475
|
+
:param min_ticker: Exact minimum ticker value from the statement record. Use only for provider-specific filtering.
|
|
476
|
+
:param min_ticker_any_of: Min ticker any-of filter. Return records matching at least one listed minTicker value.
|
|
477
|
+
:param min_ticker_after: Min ticker greater than (exclusive)
|
|
478
|
+
:param min_ticker_from: Min ticker greater than or equal (inclusive)
|
|
479
|
+
:param min_ticker_before: Min ticker upper-bound filter. Returns records before this value, excluding the value itself.
|
|
480
|
+
:param min_ticker_to: Min ticker less than or equal (inclusive)
|
|
481
|
+
:param limit: Maximum number of results per page. Use smaller values for UI pages and larger values for exports within API limits.
|
|
482
|
+
:param sort: A comma-separated list of sort columns. For each column, append `.asc` or `.desc` to specify direction. Defaults to `period_end.asc` when not specified.
|
|
483
|
+
:param next: Pagination cursor from the previous response. Omit it on the first request, then send the returned cursor to fetch the next page.
|
|
484
|
+
:param retries: Override the default retry configuration for this method
|
|
485
|
+
:param server_url: Override the default server URL for this method
|
|
486
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
487
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
488
|
+
"""
|
|
489
|
+
base_url = None
|
|
490
|
+
url_variables = None
|
|
491
|
+
if timeout_ms is None:
|
|
492
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
493
|
+
|
|
494
|
+
if timeout_ms is None:
|
|
495
|
+
timeout_ms = 30000
|
|
496
|
+
|
|
497
|
+
if server_url is not None:
|
|
498
|
+
base_url = server_url
|
|
499
|
+
else:
|
|
500
|
+
base_url = self._get_url(base_url, url_variables)
|
|
501
|
+
|
|
502
|
+
request = models.GetCashFlowStatementsRequest(
|
|
503
|
+
cik=cik,
|
|
504
|
+
ciks=ciks,
|
|
505
|
+
cik_after=cik_after,
|
|
506
|
+
cik_from=cik_from,
|
|
507
|
+
cik_before=cik_before,
|
|
508
|
+
cik_to=cik_to,
|
|
509
|
+
period_end=period_end,
|
|
510
|
+
period_end_after=period_end_after,
|
|
511
|
+
period_end_from=period_end_from,
|
|
512
|
+
period_end_before=period_end_before,
|
|
513
|
+
period_end_to=period_end_to,
|
|
514
|
+
filing_date=filing_date,
|
|
515
|
+
filing_date_after=filing_date_after,
|
|
516
|
+
filing_date_from=filing_date_from,
|
|
517
|
+
filing_date_before=filing_date_before,
|
|
518
|
+
filing_date_to=filing_date_to,
|
|
519
|
+
tickers=tickers,
|
|
520
|
+
tickers_all_of=tickers_all_of,
|
|
521
|
+
tickers_any_of=tickers_any_of,
|
|
522
|
+
fiscal_year=fiscal_year,
|
|
523
|
+
fiscal_year_above=fiscal_year_above,
|
|
524
|
+
fiscal_year_min=fiscal_year_min,
|
|
525
|
+
fiscal_year_below=fiscal_year_below,
|
|
526
|
+
fiscal_year_max=fiscal_year_max,
|
|
527
|
+
fiscal_quarter=fiscal_quarter,
|
|
528
|
+
fiscal_quarter_above=fiscal_quarter_above,
|
|
529
|
+
fiscal_quarter_min=fiscal_quarter_min,
|
|
530
|
+
fiscal_quarter_below=fiscal_quarter_below,
|
|
531
|
+
fiscal_quarter_max=fiscal_quarter_max,
|
|
532
|
+
timeframe=timeframe,
|
|
533
|
+
timeframe_any_of=timeframe_any_of,
|
|
534
|
+
timeframe_after=timeframe_after,
|
|
535
|
+
timeframe_from=timeframe_from,
|
|
536
|
+
timeframe_before=timeframe_before,
|
|
537
|
+
timeframe_to=timeframe_to,
|
|
538
|
+
max_ticker=max_ticker,
|
|
539
|
+
max_ticker_any_of=max_ticker_any_of,
|
|
540
|
+
max_ticker_after=max_ticker_after,
|
|
541
|
+
max_ticker_from=max_ticker_from,
|
|
542
|
+
max_ticker_before=max_ticker_before,
|
|
543
|
+
max_ticker_to=max_ticker_to,
|
|
544
|
+
min_ticker=min_ticker,
|
|
545
|
+
min_ticker_any_of=min_ticker_any_of,
|
|
546
|
+
min_ticker_after=min_ticker_after,
|
|
547
|
+
min_ticker_from=min_ticker_from,
|
|
548
|
+
min_ticker_before=min_ticker_before,
|
|
549
|
+
min_ticker_to=min_ticker_to,
|
|
550
|
+
limit=limit,
|
|
551
|
+
sort=sort,
|
|
552
|
+
next=next,
|
|
553
|
+
)
|
|
554
|
+
|
|
555
|
+
req = self._build_request_async(
|
|
556
|
+
method="GET",
|
|
557
|
+
path="/v1/financials/cash-flow-statements",
|
|
558
|
+
base_url=base_url,
|
|
559
|
+
url_variables=url_variables,
|
|
560
|
+
url_override=url_override,
|
|
561
|
+
request=request,
|
|
562
|
+
request_body_required=False,
|
|
563
|
+
request_has_path_params=False,
|
|
564
|
+
request_has_query_params=True,
|
|
565
|
+
user_agent_header="user-agent",
|
|
566
|
+
accept_header_value="application/json",
|
|
567
|
+
http_headers=http_headers,
|
|
568
|
+
security=self.sdk_configuration.security,
|
|
569
|
+
allow_empty_value=None,
|
|
570
|
+
allowed_fields=["client_id"],
|
|
571
|
+
timeout_ms=timeout_ms,
|
|
572
|
+
)
|
|
573
|
+
|
|
574
|
+
if retries == UNSET:
|
|
575
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
576
|
+
retries = self.sdk_configuration.retry_config
|
|
577
|
+
else:
|
|
578
|
+
retries = utils.RetryConfig(
|
|
579
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
580
|
+
)
|
|
581
|
+
|
|
582
|
+
retry_config = None
|
|
583
|
+
if isinstance(retries, utils.RetryConfig):
|
|
584
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
585
|
+
|
|
586
|
+
http_res = await self.do_request_async(
|
|
587
|
+
hook_ctx=HookContext(
|
|
588
|
+
config=self.sdk_configuration,
|
|
589
|
+
base_url=base_url or "",
|
|
590
|
+
operation_id="getCashFlowStatements",
|
|
591
|
+
oauth2_scopes=["market:supplemental"],
|
|
592
|
+
security_source=self.sdk_configuration.security,
|
|
593
|
+
tags=["Financials"],
|
|
594
|
+
extensions=None,
|
|
595
|
+
),
|
|
596
|
+
request=req,
|
|
597
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
598
|
+
retry_config=retry_config,
|
|
599
|
+
)
|
|
600
|
+
|
|
601
|
+
def next_func() -> Optional[models.GetCashFlowStatementsResponse]:
|
|
602
|
+
body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]])
|
|
603
|
+
next_url_match = JSONPath("$.nextUrl").parse(body)
|
|
604
|
+
if len(next_url_match) == 0:
|
|
605
|
+
return None
|
|
606
|
+
|
|
607
|
+
next_url = next_url_match[0]
|
|
608
|
+
if not next_url:
|
|
609
|
+
return None
|
|
610
|
+
|
|
611
|
+
if next_url[0] == "/":
|
|
612
|
+
url = self._get_url(base_url, url_variables)
|
|
613
|
+
next_url = url + next_url
|
|
614
|
+
|
|
615
|
+
return self.get_cash_flow_statements(
|
|
616
|
+
cik=cik,
|
|
617
|
+
ciks=ciks,
|
|
618
|
+
cik_after=cik_after,
|
|
619
|
+
cik_from=cik_from,
|
|
620
|
+
cik_before=cik_before,
|
|
621
|
+
cik_to=cik_to,
|
|
622
|
+
period_end=period_end,
|
|
623
|
+
period_end_after=period_end_after,
|
|
624
|
+
period_end_from=period_end_from,
|
|
625
|
+
period_end_before=period_end_before,
|
|
626
|
+
period_end_to=period_end_to,
|
|
627
|
+
filing_date=filing_date,
|
|
628
|
+
filing_date_after=filing_date_after,
|
|
629
|
+
filing_date_from=filing_date_from,
|
|
630
|
+
filing_date_before=filing_date_before,
|
|
631
|
+
filing_date_to=filing_date_to,
|
|
632
|
+
tickers=tickers,
|
|
633
|
+
tickers_all_of=tickers_all_of,
|
|
634
|
+
tickers_any_of=tickers_any_of,
|
|
635
|
+
fiscal_year=fiscal_year,
|
|
636
|
+
fiscal_year_above=fiscal_year_above,
|
|
637
|
+
fiscal_year_min=fiscal_year_min,
|
|
638
|
+
fiscal_year_below=fiscal_year_below,
|
|
639
|
+
fiscal_year_max=fiscal_year_max,
|
|
640
|
+
fiscal_quarter=fiscal_quarter,
|
|
641
|
+
fiscal_quarter_above=fiscal_quarter_above,
|
|
642
|
+
fiscal_quarter_min=fiscal_quarter_min,
|
|
643
|
+
fiscal_quarter_below=fiscal_quarter_below,
|
|
644
|
+
fiscal_quarter_max=fiscal_quarter_max,
|
|
645
|
+
timeframe=timeframe,
|
|
646
|
+
timeframe_any_of=timeframe_any_of,
|
|
647
|
+
timeframe_after=timeframe_after,
|
|
648
|
+
timeframe_from=timeframe_from,
|
|
649
|
+
timeframe_before=timeframe_before,
|
|
650
|
+
timeframe_to=timeframe_to,
|
|
651
|
+
max_ticker=max_ticker,
|
|
652
|
+
max_ticker_any_of=max_ticker_any_of,
|
|
653
|
+
max_ticker_after=max_ticker_after,
|
|
654
|
+
max_ticker_from=max_ticker_from,
|
|
655
|
+
max_ticker_before=max_ticker_before,
|
|
656
|
+
max_ticker_to=max_ticker_to,
|
|
657
|
+
min_ticker=min_ticker,
|
|
658
|
+
min_ticker_any_of=min_ticker_any_of,
|
|
659
|
+
min_ticker_after=min_ticker_after,
|
|
660
|
+
min_ticker_from=min_ticker_from,
|
|
661
|
+
min_ticker_before=min_ticker_before,
|
|
662
|
+
min_ticker_to=min_ticker_to,
|
|
663
|
+
limit=limit,
|
|
664
|
+
sort=sort,
|
|
665
|
+
next=next,
|
|
666
|
+
retries=retries,
|
|
667
|
+
server_url=server_url,
|
|
668
|
+
timeout_ms=timeout_ms,
|
|
669
|
+
http_headers=http_headers,
|
|
670
|
+
url_override=next_url,
|
|
671
|
+
)
|
|
672
|
+
|
|
673
|
+
response_data: Any = None
|
|
674
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
675
|
+
return models.GetCashFlowStatementsResponse(
|
|
676
|
+
cash_flow_statements_response=unmarshal_json_response(
|
|
677
|
+
Optional[models.CashFlowStatementsResponse], http_res
|
|
678
|
+
),
|
|
679
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
680
|
+
next=next_func,
|
|
681
|
+
)
|
|
682
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
683
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
684
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
685
|
+
request=req, response=http_res
|
|
686
|
+
)
|
|
687
|
+
raise errors.BadRequest(response_data, http_res)
|
|
688
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
689
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
690
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
691
|
+
request=req, response=http_res
|
|
692
|
+
)
|
|
693
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
694
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
695
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
696
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
697
|
+
request=req, response=http_res
|
|
698
|
+
)
|
|
699
|
+
raise errors.Forbidden(response_data, http_res)
|
|
700
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
701
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
702
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
703
|
+
request=req, response=http_res
|
|
704
|
+
)
|
|
705
|
+
raise errors.NotFound(response_data, http_res)
|
|
706
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
707
|
+
response_data = unmarshal_json_response(
|
|
708
|
+
errors.InternalServerErrorUnion, http_res
|
|
709
|
+
)
|
|
710
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
711
|
+
request=req, response=http_res
|
|
712
|
+
)
|
|
713
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
714
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
715
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
716
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
717
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
718
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
719
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
720
|
+
|
|
721
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
722
|
+
|
|
723
|
+
def get_income_statements(
|
|
724
|
+
self,
|
|
725
|
+
*,
|
|
726
|
+
cik: Optional[str] = None,
|
|
727
|
+
ciks: Optional[str] = None,
|
|
728
|
+
cik_after: Optional[str] = None,
|
|
729
|
+
cik_from: Optional[str] = None,
|
|
730
|
+
cik_before: Optional[str] = None,
|
|
731
|
+
cik_to: Optional[str] = None,
|
|
732
|
+
period_end: Optional[date] = None,
|
|
733
|
+
period_end_after: Optional[date] = None,
|
|
734
|
+
period_end_from: Optional[date] = None,
|
|
735
|
+
period_end_before: Optional[date] = None,
|
|
736
|
+
period_end_to: Optional[date] = None,
|
|
737
|
+
filing_date: Optional[date] = None,
|
|
738
|
+
filing_date_after: Optional[date] = None,
|
|
739
|
+
filing_date_from: Optional[date] = None,
|
|
740
|
+
filing_date_before: Optional[date] = None,
|
|
741
|
+
filing_date_to: Optional[date] = None,
|
|
742
|
+
tickers: Optional[str] = None,
|
|
743
|
+
tickers_all_of: Optional[str] = None,
|
|
744
|
+
tickers_any_of: Optional[str] = None,
|
|
745
|
+
fiscal_year: Optional[float] = None,
|
|
746
|
+
fiscal_year_above: Optional[float] = None,
|
|
747
|
+
fiscal_year_min: Optional[float] = None,
|
|
748
|
+
fiscal_year_below: Optional[float] = None,
|
|
749
|
+
fiscal_year_max: Optional[float] = None,
|
|
750
|
+
fiscal_quarter: Optional[float] = None,
|
|
751
|
+
fiscal_quarter_above: Optional[float] = None,
|
|
752
|
+
fiscal_quarter_min: Optional[float] = None,
|
|
753
|
+
fiscal_quarter_below: Optional[float] = None,
|
|
754
|
+
fiscal_quarter_max: Optional[float] = None,
|
|
755
|
+
timeframe: Optional[str] = None,
|
|
756
|
+
timeframe_any_of: Optional[str] = None,
|
|
757
|
+
timeframe_after: Optional[str] = None,
|
|
758
|
+
timeframe_from: Optional[str] = None,
|
|
759
|
+
timeframe_before: Optional[str] = None,
|
|
760
|
+
timeframe_to: Optional[str] = None,
|
|
761
|
+
max_ticker: Optional[str] = None,
|
|
762
|
+
max_ticker_any_of: Optional[str] = None,
|
|
763
|
+
max_ticker_after: Optional[str] = None,
|
|
764
|
+
max_ticker_from: Optional[str] = None,
|
|
765
|
+
max_ticker_before: Optional[str] = None,
|
|
766
|
+
max_ticker_to: Optional[str] = None,
|
|
767
|
+
min_ticker: Optional[str] = None,
|
|
768
|
+
min_ticker_any_of: Optional[str] = None,
|
|
769
|
+
min_ticker_after: Optional[str] = None,
|
|
770
|
+
min_ticker_from: Optional[str] = None,
|
|
771
|
+
min_ticker_before: Optional[str] = None,
|
|
772
|
+
min_ticker_to: Optional[str] = None,
|
|
773
|
+
limit: Optional[int] = None,
|
|
774
|
+
sort: Optional[str] = None,
|
|
775
|
+
next: Optional[str] = None,
|
|
776
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
777
|
+
server_url: Optional[str] = None,
|
|
778
|
+
url_override: Optional[str] = None,
|
|
779
|
+
timeout_ms: Optional[int] = None,
|
|
780
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
781
|
+
) -> Optional[models.GetIncomeStatementsResponse]:
|
|
782
|
+
r"""Get Income Statements
|
|
783
|
+
|
|
784
|
+
Retrieve SEC income statement rows per filing period. Filter by CIK, tickers, filing or period dates, fiscal year/quarter, timeframe, and pagination. Same query shape as cash flow statements.
|
|
785
|
+
|
|
786
|
+
If set, this operation will use `client_id` from the global security.
|
|
787
|
+
|
|
788
|
+
:param cik: Exact SEC CIK company identifier. Use this when you need one specific SEC registrant.
|
|
789
|
+
:param ciks: Comma-separated CIKs (maps to cik.any_of)
|
|
790
|
+
:param cik_after: CIK pagination lower bound. Returns records with CIK values greater than this value, excluding the value itself.
|
|
791
|
+
:param cik_from: CIK greater than or equal (inclusive)
|
|
792
|
+
:param cik_before: CIK pagination upper bound. Returns records with CIK values less than this value, excluding the value itself.
|
|
793
|
+
:param cik_to: CIK upper-bound filter. Returns records with CIK values less than or equal to this value.
|
|
794
|
+
:param period_end: Exact fiscal period-end date filter. Use it to return statements for one reporting period.
|
|
795
|
+
:param period_end_after: Fiscal period-end lower-bound filter. Returns records after this date, excluding the date itself.
|
|
796
|
+
:param period_end_from: Fiscal period-end start filter. Returns records on or after this date.
|
|
797
|
+
:param period_end_before: Fiscal period-end upper-bound filter. Returns records before this date, excluding the date itself.
|
|
798
|
+
:param period_end_to: Fiscal period-end end filter. Returns records on or before this date.
|
|
799
|
+
:param filing_date: Exact filing date filter. Use it to return filings submitted on one specific date.
|
|
800
|
+
:param filing_date_after: Filing-date lower-bound filter. Returns records after this date, excluding the date itself.
|
|
801
|
+
:param filing_date_from: Filing-date start filter. Returns records on or after this date.
|
|
802
|
+
:param filing_date_before: Filing-date upper-bound filter. Returns records before this date, excluding the date itself.
|
|
803
|
+
:param filing_date_to: Filing-date end filter. Returns records on or before this date.
|
|
804
|
+
:param tickers: Ticker symbol filter. Enter a ticker such as AAPL to narrow results to one company.
|
|
805
|
+
:param tickers_all_of: Ticker all-of filter. Return records that include all listed tickers.
|
|
806
|
+
:param tickers_any_of: Ticker any-of filter. Return records that include at least one listed ticker.
|
|
807
|
+
:param fiscal_year: Exact fiscal year filter. Use it to return statements for one reporting year.
|
|
808
|
+
:param fiscal_year_above: Fiscal year greater than (exclusive)
|
|
809
|
+
:param fiscal_year_min: Fiscal year greater than or equal (inclusive)
|
|
810
|
+
:param fiscal_year_below: Fiscal-year upper-bound filter. Returns records before this fiscal year, excluding the year itself.
|
|
811
|
+
:param fiscal_year_max: Fiscal year less than or equal (inclusive)
|
|
812
|
+
:param fiscal_quarter: Exact fiscal quarter filter. Use values such as 1, 2, 3, or 4 when supported.
|
|
813
|
+
:param fiscal_quarter_above: Fiscal quarter greater than (exclusive)
|
|
814
|
+
:param fiscal_quarter_min: Fiscal quarter greater than or equal (inclusive)
|
|
815
|
+
:param fiscal_quarter_below: Fiscal quarter less than (exclusive)
|
|
816
|
+
:param fiscal_quarter_max: Fiscal quarter less than or equal (inclusive)
|
|
817
|
+
:param timeframe: Reporting timeframe (e.g. quarterly, annual)
|
|
818
|
+
:param timeframe_any_of: Timeframe any-of filter. Return records that match at least one listed timeframe.
|
|
819
|
+
:param timeframe_after: Timeframe lower-bound filter. Returns records after this timeframe, excluding the value itself.
|
|
820
|
+
:param timeframe_from: Timeframe greater than or equal (inclusive)
|
|
821
|
+
:param timeframe_before: Timeframe upper-bound filter. Returns records before this timeframe, excluding the value itself.
|
|
822
|
+
:param timeframe_to: Timeframe less than or equal (inclusive)
|
|
823
|
+
:param max_ticker: Exact maximum ticker value from the statement record. Use only for provider-specific filtering.
|
|
824
|
+
:param max_ticker_any_of: Max ticker any-of filter. Return records matching at least one listed maxTicker value.
|
|
825
|
+
:param max_ticker_after: Max ticker greater than (exclusive)
|
|
826
|
+
:param max_ticker_from: Max ticker greater than or equal (inclusive)
|
|
827
|
+
:param max_ticker_before: Max ticker upper-bound filter. Returns records before this value, excluding the value itself.
|
|
828
|
+
:param max_ticker_to: Max ticker less than or equal (inclusive)
|
|
829
|
+
:param min_ticker: Exact minimum ticker value from the statement record. Use only for provider-specific filtering.
|
|
830
|
+
:param min_ticker_any_of: Min ticker any-of filter. Return records matching at least one listed minTicker value.
|
|
831
|
+
:param min_ticker_after: Min ticker greater than (exclusive)
|
|
832
|
+
:param min_ticker_from: Min ticker greater than or equal (inclusive)
|
|
833
|
+
:param min_ticker_before: Min ticker upper-bound filter. Returns records before this value, excluding the value itself.
|
|
834
|
+
:param min_ticker_to: Min ticker less than or equal (inclusive)
|
|
835
|
+
:param limit: Maximum number of results per page. Use smaller values for UI pages and larger values for exports within API limits.
|
|
836
|
+
:param sort: A comma-separated list of sort columns. For each column, append `.asc` or `.desc` to specify direction. Defaults to `period_end.asc` when not specified.
|
|
837
|
+
:param next: Pagination cursor from the previous response. Omit it on the first request, then send the returned cursor to fetch the next page.
|
|
838
|
+
:param retries: Override the default retry configuration for this method
|
|
839
|
+
:param server_url: Override the default server URL for this method
|
|
840
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
841
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
842
|
+
"""
|
|
843
|
+
base_url = None
|
|
844
|
+
url_variables = None
|
|
845
|
+
if timeout_ms is None:
|
|
846
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
847
|
+
|
|
848
|
+
if timeout_ms is None:
|
|
849
|
+
timeout_ms = 30000
|
|
850
|
+
|
|
851
|
+
if server_url is not None:
|
|
852
|
+
base_url = server_url
|
|
853
|
+
else:
|
|
854
|
+
base_url = self._get_url(base_url, url_variables)
|
|
855
|
+
|
|
856
|
+
request = models.GetIncomeStatementsRequest(
|
|
857
|
+
cik=cik,
|
|
858
|
+
ciks=ciks,
|
|
859
|
+
cik_after=cik_after,
|
|
860
|
+
cik_from=cik_from,
|
|
861
|
+
cik_before=cik_before,
|
|
862
|
+
cik_to=cik_to,
|
|
863
|
+
period_end=period_end,
|
|
864
|
+
period_end_after=period_end_after,
|
|
865
|
+
period_end_from=period_end_from,
|
|
866
|
+
period_end_before=period_end_before,
|
|
867
|
+
period_end_to=period_end_to,
|
|
868
|
+
filing_date=filing_date,
|
|
869
|
+
filing_date_after=filing_date_after,
|
|
870
|
+
filing_date_from=filing_date_from,
|
|
871
|
+
filing_date_before=filing_date_before,
|
|
872
|
+
filing_date_to=filing_date_to,
|
|
873
|
+
tickers=tickers,
|
|
874
|
+
tickers_all_of=tickers_all_of,
|
|
875
|
+
tickers_any_of=tickers_any_of,
|
|
876
|
+
fiscal_year=fiscal_year,
|
|
877
|
+
fiscal_year_above=fiscal_year_above,
|
|
878
|
+
fiscal_year_min=fiscal_year_min,
|
|
879
|
+
fiscal_year_below=fiscal_year_below,
|
|
880
|
+
fiscal_year_max=fiscal_year_max,
|
|
881
|
+
fiscal_quarter=fiscal_quarter,
|
|
882
|
+
fiscal_quarter_above=fiscal_quarter_above,
|
|
883
|
+
fiscal_quarter_min=fiscal_quarter_min,
|
|
884
|
+
fiscal_quarter_below=fiscal_quarter_below,
|
|
885
|
+
fiscal_quarter_max=fiscal_quarter_max,
|
|
886
|
+
timeframe=timeframe,
|
|
887
|
+
timeframe_any_of=timeframe_any_of,
|
|
888
|
+
timeframe_after=timeframe_after,
|
|
889
|
+
timeframe_from=timeframe_from,
|
|
890
|
+
timeframe_before=timeframe_before,
|
|
891
|
+
timeframe_to=timeframe_to,
|
|
892
|
+
max_ticker=max_ticker,
|
|
893
|
+
max_ticker_any_of=max_ticker_any_of,
|
|
894
|
+
max_ticker_after=max_ticker_after,
|
|
895
|
+
max_ticker_from=max_ticker_from,
|
|
896
|
+
max_ticker_before=max_ticker_before,
|
|
897
|
+
max_ticker_to=max_ticker_to,
|
|
898
|
+
min_ticker=min_ticker,
|
|
899
|
+
min_ticker_any_of=min_ticker_any_of,
|
|
900
|
+
min_ticker_after=min_ticker_after,
|
|
901
|
+
min_ticker_from=min_ticker_from,
|
|
902
|
+
min_ticker_before=min_ticker_before,
|
|
903
|
+
min_ticker_to=min_ticker_to,
|
|
904
|
+
limit=limit,
|
|
905
|
+
sort=sort,
|
|
906
|
+
next=next,
|
|
907
|
+
)
|
|
908
|
+
|
|
909
|
+
req = self._build_request(
|
|
910
|
+
method="GET",
|
|
911
|
+
path="/v1/financials/income-statements",
|
|
912
|
+
base_url=base_url,
|
|
913
|
+
url_variables=url_variables,
|
|
914
|
+
url_override=url_override,
|
|
915
|
+
request=request,
|
|
916
|
+
request_body_required=False,
|
|
917
|
+
request_has_path_params=False,
|
|
918
|
+
request_has_query_params=True,
|
|
919
|
+
user_agent_header="user-agent",
|
|
920
|
+
accept_header_value="application/json",
|
|
921
|
+
http_headers=http_headers,
|
|
922
|
+
security=self.sdk_configuration.security,
|
|
923
|
+
allow_empty_value=None,
|
|
924
|
+
allowed_fields=["client_id"],
|
|
925
|
+
timeout_ms=timeout_ms,
|
|
926
|
+
)
|
|
927
|
+
|
|
928
|
+
if retries == UNSET:
|
|
929
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
930
|
+
retries = self.sdk_configuration.retry_config
|
|
931
|
+
else:
|
|
932
|
+
retries = utils.RetryConfig(
|
|
933
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
934
|
+
)
|
|
935
|
+
|
|
936
|
+
retry_config = None
|
|
937
|
+
if isinstance(retries, utils.RetryConfig):
|
|
938
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
939
|
+
|
|
940
|
+
http_res = self.do_request(
|
|
941
|
+
hook_ctx=HookContext(
|
|
942
|
+
config=self.sdk_configuration,
|
|
943
|
+
base_url=base_url or "",
|
|
944
|
+
operation_id="getIncomeStatements",
|
|
945
|
+
oauth2_scopes=["market:supplemental"],
|
|
946
|
+
security_source=self.sdk_configuration.security,
|
|
947
|
+
tags=["Financials"],
|
|
948
|
+
extensions=None,
|
|
949
|
+
),
|
|
950
|
+
request=req,
|
|
951
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
952
|
+
retry_config=retry_config,
|
|
953
|
+
)
|
|
954
|
+
|
|
955
|
+
def next_func() -> Optional[models.GetIncomeStatementsResponse]:
|
|
956
|
+
body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]])
|
|
957
|
+
next_url_match = JSONPath("$.nextUrl").parse(body)
|
|
958
|
+
if len(next_url_match) == 0:
|
|
959
|
+
return None
|
|
960
|
+
|
|
961
|
+
next_url = next_url_match[0]
|
|
962
|
+
if not next_url:
|
|
963
|
+
return None
|
|
964
|
+
|
|
965
|
+
if next_url[0] == "/":
|
|
966
|
+
url = self._get_url(base_url, url_variables)
|
|
967
|
+
next_url = url + next_url
|
|
968
|
+
|
|
969
|
+
return self.get_income_statements(
|
|
970
|
+
cik=cik,
|
|
971
|
+
ciks=ciks,
|
|
972
|
+
cik_after=cik_after,
|
|
973
|
+
cik_from=cik_from,
|
|
974
|
+
cik_before=cik_before,
|
|
975
|
+
cik_to=cik_to,
|
|
976
|
+
period_end=period_end,
|
|
977
|
+
period_end_after=period_end_after,
|
|
978
|
+
period_end_from=period_end_from,
|
|
979
|
+
period_end_before=period_end_before,
|
|
980
|
+
period_end_to=period_end_to,
|
|
981
|
+
filing_date=filing_date,
|
|
982
|
+
filing_date_after=filing_date_after,
|
|
983
|
+
filing_date_from=filing_date_from,
|
|
984
|
+
filing_date_before=filing_date_before,
|
|
985
|
+
filing_date_to=filing_date_to,
|
|
986
|
+
tickers=tickers,
|
|
987
|
+
tickers_all_of=tickers_all_of,
|
|
988
|
+
tickers_any_of=tickers_any_of,
|
|
989
|
+
fiscal_year=fiscal_year,
|
|
990
|
+
fiscal_year_above=fiscal_year_above,
|
|
991
|
+
fiscal_year_min=fiscal_year_min,
|
|
992
|
+
fiscal_year_below=fiscal_year_below,
|
|
993
|
+
fiscal_year_max=fiscal_year_max,
|
|
994
|
+
fiscal_quarter=fiscal_quarter,
|
|
995
|
+
fiscal_quarter_above=fiscal_quarter_above,
|
|
996
|
+
fiscal_quarter_min=fiscal_quarter_min,
|
|
997
|
+
fiscal_quarter_below=fiscal_quarter_below,
|
|
998
|
+
fiscal_quarter_max=fiscal_quarter_max,
|
|
999
|
+
timeframe=timeframe,
|
|
1000
|
+
timeframe_any_of=timeframe_any_of,
|
|
1001
|
+
timeframe_after=timeframe_after,
|
|
1002
|
+
timeframe_from=timeframe_from,
|
|
1003
|
+
timeframe_before=timeframe_before,
|
|
1004
|
+
timeframe_to=timeframe_to,
|
|
1005
|
+
max_ticker=max_ticker,
|
|
1006
|
+
max_ticker_any_of=max_ticker_any_of,
|
|
1007
|
+
max_ticker_after=max_ticker_after,
|
|
1008
|
+
max_ticker_from=max_ticker_from,
|
|
1009
|
+
max_ticker_before=max_ticker_before,
|
|
1010
|
+
max_ticker_to=max_ticker_to,
|
|
1011
|
+
min_ticker=min_ticker,
|
|
1012
|
+
min_ticker_any_of=min_ticker_any_of,
|
|
1013
|
+
min_ticker_after=min_ticker_after,
|
|
1014
|
+
min_ticker_from=min_ticker_from,
|
|
1015
|
+
min_ticker_before=min_ticker_before,
|
|
1016
|
+
min_ticker_to=min_ticker_to,
|
|
1017
|
+
limit=limit,
|
|
1018
|
+
sort=sort,
|
|
1019
|
+
next=next,
|
|
1020
|
+
retries=retries,
|
|
1021
|
+
server_url=server_url,
|
|
1022
|
+
timeout_ms=timeout_ms,
|
|
1023
|
+
http_headers=http_headers,
|
|
1024
|
+
url_override=next_url,
|
|
1025
|
+
)
|
|
1026
|
+
|
|
1027
|
+
response_data: Any = None
|
|
1028
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1029
|
+
return models.GetIncomeStatementsResponse(
|
|
1030
|
+
income_statements_response=unmarshal_json_response(
|
|
1031
|
+
Optional[models.IncomeStatementsResponse], http_res
|
|
1032
|
+
),
|
|
1033
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
1034
|
+
next=next_func,
|
|
1035
|
+
)
|
|
1036
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
1037
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
1038
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1039
|
+
request=req, response=http_res
|
|
1040
|
+
)
|
|
1041
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1042
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
1043
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
1044
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1045
|
+
request=req, response=http_res
|
|
1046
|
+
)
|
|
1047
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1048
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
1049
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
1050
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1051
|
+
request=req, response=http_res
|
|
1052
|
+
)
|
|
1053
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1054
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
1055
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
1056
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1057
|
+
request=req, response=http_res
|
|
1058
|
+
)
|
|
1059
|
+
raise errors.NotFound(response_data, http_res)
|
|
1060
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
1061
|
+
response_data = unmarshal_json_response(
|
|
1062
|
+
errors.InternalServerErrorUnion, http_res
|
|
1063
|
+
)
|
|
1064
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1065
|
+
request=req, response=http_res
|
|
1066
|
+
)
|
|
1067
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1068
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1069
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1070
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1071
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1072
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1073
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1074
|
+
|
|
1075
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1076
|
+
|
|
1077
|
+
async def get_income_statements_async(
|
|
1078
|
+
self,
|
|
1079
|
+
*,
|
|
1080
|
+
cik: Optional[str] = None,
|
|
1081
|
+
ciks: Optional[str] = None,
|
|
1082
|
+
cik_after: Optional[str] = None,
|
|
1083
|
+
cik_from: Optional[str] = None,
|
|
1084
|
+
cik_before: Optional[str] = None,
|
|
1085
|
+
cik_to: Optional[str] = None,
|
|
1086
|
+
period_end: Optional[date] = None,
|
|
1087
|
+
period_end_after: Optional[date] = None,
|
|
1088
|
+
period_end_from: Optional[date] = None,
|
|
1089
|
+
period_end_before: Optional[date] = None,
|
|
1090
|
+
period_end_to: Optional[date] = None,
|
|
1091
|
+
filing_date: Optional[date] = None,
|
|
1092
|
+
filing_date_after: Optional[date] = None,
|
|
1093
|
+
filing_date_from: Optional[date] = None,
|
|
1094
|
+
filing_date_before: Optional[date] = None,
|
|
1095
|
+
filing_date_to: Optional[date] = None,
|
|
1096
|
+
tickers: Optional[str] = None,
|
|
1097
|
+
tickers_all_of: Optional[str] = None,
|
|
1098
|
+
tickers_any_of: Optional[str] = None,
|
|
1099
|
+
fiscal_year: Optional[float] = None,
|
|
1100
|
+
fiscal_year_above: Optional[float] = None,
|
|
1101
|
+
fiscal_year_min: Optional[float] = None,
|
|
1102
|
+
fiscal_year_below: Optional[float] = None,
|
|
1103
|
+
fiscal_year_max: Optional[float] = None,
|
|
1104
|
+
fiscal_quarter: Optional[float] = None,
|
|
1105
|
+
fiscal_quarter_above: Optional[float] = None,
|
|
1106
|
+
fiscal_quarter_min: Optional[float] = None,
|
|
1107
|
+
fiscal_quarter_below: Optional[float] = None,
|
|
1108
|
+
fiscal_quarter_max: Optional[float] = None,
|
|
1109
|
+
timeframe: Optional[str] = None,
|
|
1110
|
+
timeframe_any_of: Optional[str] = None,
|
|
1111
|
+
timeframe_after: Optional[str] = None,
|
|
1112
|
+
timeframe_from: Optional[str] = None,
|
|
1113
|
+
timeframe_before: Optional[str] = None,
|
|
1114
|
+
timeframe_to: Optional[str] = None,
|
|
1115
|
+
max_ticker: Optional[str] = None,
|
|
1116
|
+
max_ticker_any_of: Optional[str] = None,
|
|
1117
|
+
max_ticker_after: Optional[str] = None,
|
|
1118
|
+
max_ticker_from: Optional[str] = None,
|
|
1119
|
+
max_ticker_before: Optional[str] = None,
|
|
1120
|
+
max_ticker_to: Optional[str] = None,
|
|
1121
|
+
min_ticker: Optional[str] = None,
|
|
1122
|
+
min_ticker_any_of: Optional[str] = None,
|
|
1123
|
+
min_ticker_after: Optional[str] = None,
|
|
1124
|
+
min_ticker_from: Optional[str] = None,
|
|
1125
|
+
min_ticker_before: Optional[str] = None,
|
|
1126
|
+
min_ticker_to: Optional[str] = None,
|
|
1127
|
+
limit: Optional[int] = None,
|
|
1128
|
+
sort: Optional[str] = None,
|
|
1129
|
+
next: Optional[str] = None,
|
|
1130
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1131
|
+
server_url: Optional[str] = None,
|
|
1132
|
+
url_override: Optional[str] = None,
|
|
1133
|
+
timeout_ms: Optional[int] = None,
|
|
1134
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1135
|
+
) -> Optional[models.GetIncomeStatementsResponse]:
|
|
1136
|
+
r"""Get Income Statements
|
|
1137
|
+
|
|
1138
|
+
Retrieve SEC income statement rows per filing period. Filter by CIK, tickers, filing or period dates, fiscal year/quarter, timeframe, and pagination. Same query shape as cash flow statements.
|
|
1139
|
+
|
|
1140
|
+
If set, this operation will use `client_id` from the global security.
|
|
1141
|
+
|
|
1142
|
+
:param cik: Exact SEC CIK company identifier. Use this when you need one specific SEC registrant.
|
|
1143
|
+
:param ciks: Comma-separated CIKs (maps to cik.any_of)
|
|
1144
|
+
:param cik_after: CIK pagination lower bound. Returns records with CIK values greater than this value, excluding the value itself.
|
|
1145
|
+
:param cik_from: CIK greater than or equal (inclusive)
|
|
1146
|
+
:param cik_before: CIK pagination upper bound. Returns records with CIK values less than this value, excluding the value itself.
|
|
1147
|
+
:param cik_to: CIK upper-bound filter. Returns records with CIK values less than or equal to this value.
|
|
1148
|
+
:param period_end: Exact fiscal period-end date filter. Use it to return statements for one reporting period.
|
|
1149
|
+
:param period_end_after: Fiscal period-end lower-bound filter. Returns records after this date, excluding the date itself.
|
|
1150
|
+
:param period_end_from: Fiscal period-end start filter. Returns records on or after this date.
|
|
1151
|
+
:param period_end_before: Fiscal period-end upper-bound filter. Returns records before this date, excluding the date itself.
|
|
1152
|
+
:param period_end_to: Fiscal period-end end filter. Returns records on or before this date.
|
|
1153
|
+
:param filing_date: Exact filing date filter. Use it to return filings submitted on one specific date.
|
|
1154
|
+
:param filing_date_after: Filing-date lower-bound filter. Returns records after this date, excluding the date itself.
|
|
1155
|
+
:param filing_date_from: Filing-date start filter. Returns records on or after this date.
|
|
1156
|
+
:param filing_date_before: Filing-date upper-bound filter. Returns records before this date, excluding the date itself.
|
|
1157
|
+
:param filing_date_to: Filing-date end filter. Returns records on or before this date.
|
|
1158
|
+
:param tickers: Ticker symbol filter. Enter a ticker such as AAPL to narrow results to one company.
|
|
1159
|
+
:param tickers_all_of: Ticker all-of filter. Return records that include all listed tickers.
|
|
1160
|
+
:param tickers_any_of: Ticker any-of filter. Return records that include at least one listed ticker.
|
|
1161
|
+
:param fiscal_year: Exact fiscal year filter. Use it to return statements for one reporting year.
|
|
1162
|
+
:param fiscal_year_above: Fiscal year greater than (exclusive)
|
|
1163
|
+
:param fiscal_year_min: Fiscal year greater than or equal (inclusive)
|
|
1164
|
+
:param fiscal_year_below: Fiscal-year upper-bound filter. Returns records before this fiscal year, excluding the year itself.
|
|
1165
|
+
:param fiscal_year_max: Fiscal year less than or equal (inclusive)
|
|
1166
|
+
:param fiscal_quarter: Exact fiscal quarter filter. Use values such as 1, 2, 3, or 4 when supported.
|
|
1167
|
+
:param fiscal_quarter_above: Fiscal quarter greater than (exclusive)
|
|
1168
|
+
:param fiscal_quarter_min: Fiscal quarter greater than or equal (inclusive)
|
|
1169
|
+
:param fiscal_quarter_below: Fiscal quarter less than (exclusive)
|
|
1170
|
+
:param fiscal_quarter_max: Fiscal quarter less than or equal (inclusive)
|
|
1171
|
+
:param timeframe: Reporting timeframe (e.g. quarterly, annual)
|
|
1172
|
+
:param timeframe_any_of: Timeframe any-of filter. Return records that match at least one listed timeframe.
|
|
1173
|
+
:param timeframe_after: Timeframe lower-bound filter. Returns records after this timeframe, excluding the value itself.
|
|
1174
|
+
:param timeframe_from: Timeframe greater than or equal (inclusive)
|
|
1175
|
+
:param timeframe_before: Timeframe upper-bound filter. Returns records before this timeframe, excluding the value itself.
|
|
1176
|
+
:param timeframe_to: Timeframe less than or equal (inclusive)
|
|
1177
|
+
:param max_ticker: Exact maximum ticker value from the statement record. Use only for provider-specific filtering.
|
|
1178
|
+
:param max_ticker_any_of: Max ticker any-of filter. Return records matching at least one listed maxTicker value.
|
|
1179
|
+
:param max_ticker_after: Max ticker greater than (exclusive)
|
|
1180
|
+
:param max_ticker_from: Max ticker greater than or equal (inclusive)
|
|
1181
|
+
:param max_ticker_before: Max ticker upper-bound filter. Returns records before this value, excluding the value itself.
|
|
1182
|
+
:param max_ticker_to: Max ticker less than or equal (inclusive)
|
|
1183
|
+
:param min_ticker: Exact minimum ticker value from the statement record. Use only for provider-specific filtering.
|
|
1184
|
+
:param min_ticker_any_of: Min ticker any-of filter. Return records matching at least one listed minTicker value.
|
|
1185
|
+
:param min_ticker_after: Min ticker greater than (exclusive)
|
|
1186
|
+
:param min_ticker_from: Min ticker greater than or equal (inclusive)
|
|
1187
|
+
:param min_ticker_before: Min ticker upper-bound filter. Returns records before this value, excluding the value itself.
|
|
1188
|
+
:param min_ticker_to: Min ticker less than or equal (inclusive)
|
|
1189
|
+
:param limit: Maximum number of results per page. Use smaller values for UI pages and larger values for exports within API limits.
|
|
1190
|
+
:param sort: A comma-separated list of sort columns. For each column, append `.asc` or `.desc` to specify direction. Defaults to `period_end.asc` when not specified.
|
|
1191
|
+
:param next: Pagination cursor from the previous response. Omit it on the first request, then send the returned cursor to fetch the next page.
|
|
1192
|
+
:param retries: Override the default retry configuration for this method
|
|
1193
|
+
:param server_url: Override the default server URL for this method
|
|
1194
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1195
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1196
|
+
"""
|
|
1197
|
+
base_url = None
|
|
1198
|
+
url_variables = None
|
|
1199
|
+
if timeout_ms is None:
|
|
1200
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1201
|
+
|
|
1202
|
+
if timeout_ms is None:
|
|
1203
|
+
timeout_ms = 30000
|
|
1204
|
+
|
|
1205
|
+
if server_url is not None:
|
|
1206
|
+
base_url = server_url
|
|
1207
|
+
else:
|
|
1208
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1209
|
+
|
|
1210
|
+
request = models.GetIncomeStatementsRequest(
|
|
1211
|
+
cik=cik,
|
|
1212
|
+
ciks=ciks,
|
|
1213
|
+
cik_after=cik_after,
|
|
1214
|
+
cik_from=cik_from,
|
|
1215
|
+
cik_before=cik_before,
|
|
1216
|
+
cik_to=cik_to,
|
|
1217
|
+
period_end=period_end,
|
|
1218
|
+
period_end_after=period_end_after,
|
|
1219
|
+
period_end_from=period_end_from,
|
|
1220
|
+
period_end_before=period_end_before,
|
|
1221
|
+
period_end_to=period_end_to,
|
|
1222
|
+
filing_date=filing_date,
|
|
1223
|
+
filing_date_after=filing_date_after,
|
|
1224
|
+
filing_date_from=filing_date_from,
|
|
1225
|
+
filing_date_before=filing_date_before,
|
|
1226
|
+
filing_date_to=filing_date_to,
|
|
1227
|
+
tickers=tickers,
|
|
1228
|
+
tickers_all_of=tickers_all_of,
|
|
1229
|
+
tickers_any_of=tickers_any_of,
|
|
1230
|
+
fiscal_year=fiscal_year,
|
|
1231
|
+
fiscal_year_above=fiscal_year_above,
|
|
1232
|
+
fiscal_year_min=fiscal_year_min,
|
|
1233
|
+
fiscal_year_below=fiscal_year_below,
|
|
1234
|
+
fiscal_year_max=fiscal_year_max,
|
|
1235
|
+
fiscal_quarter=fiscal_quarter,
|
|
1236
|
+
fiscal_quarter_above=fiscal_quarter_above,
|
|
1237
|
+
fiscal_quarter_min=fiscal_quarter_min,
|
|
1238
|
+
fiscal_quarter_below=fiscal_quarter_below,
|
|
1239
|
+
fiscal_quarter_max=fiscal_quarter_max,
|
|
1240
|
+
timeframe=timeframe,
|
|
1241
|
+
timeframe_any_of=timeframe_any_of,
|
|
1242
|
+
timeframe_after=timeframe_after,
|
|
1243
|
+
timeframe_from=timeframe_from,
|
|
1244
|
+
timeframe_before=timeframe_before,
|
|
1245
|
+
timeframe_to=timeframe_to,
|
|
1246
|
+
max_ticker=max_ticker,
|
|
1247
|
+
max_ticker_any_of=max_ticker_any_of,
|
|
1248
|
+
max_ticker_after=max_ticker_after,
|
|
1249
|
+
max_ticker_from=max_ticker_from,
|
|
1250
|
+
max_ticker_before=max_ticker_before,
|
|
1251
|
+
max_ticker_to=max_ticker_to,
|
|
1252
|
+
min_ticker=min_ticker,
|
|
1253
|
+
min_ticker_any_of=min_ticker_any_of,
|
|
1254
|
+
min_ticker_after=min_ticker_after,
|
|
1255
|
+
min_ticker_from=min_ticker_from,
|
|
1256
|
+
min_ticker_before=min_ticker_before,
|
|
1257
|
+
min_ticker_to=min_ticker_to,
|
|
1258
|
+
limit=limit,
|
|
1259
|
+
sort=sort,
|
|
1260
|
+
next=next,
|
|
1261
|
+
)
|
|
1262
|
+
|
|
1263
|
+
req = self._build_request_async(
|
|
1264
|
+
method="GET",
|
|
1265
|
+
path="/v1/financials/income-statements",
|
|
1266
|
+
base_url=base_url,
|
|
1267
|
+
url_variables=url_variables,
|
|
1268
|
+
url_override=url_override,
|
|
1269
|
+
request=request,
|
|
1270
|
+
request_body_required=False,
|
|
1271
|
+
request_has_path_params=False,
|
|
1272
|
+
request_has_query_params=True,
|
|
1273
|
+
user_agent_header="user-agent",
|
|
1274
|
+
accept_header_value="application/json",
|
|
1275
|
+
http_headers=http_headers,
|
|
1276
|
+
security=self.sdk_configuration.security,
|
|
1277
|
+
allow_empty_value=None,
|
|
1278
|
+
allowed_fields=["client_id"],
|
|
1279
|
+
timeout_ms=timeout_ms,
|
|
1280
|
+
)
|
|
1281
|
+
|
|
1282
|
+
if retries == UNSET:
|
|
1283
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1284
|
+
retries = self.sdk_configuration.retry_config
|
|
1285
|
+
else:
|
|
1286
|
+
retries = utils.RetryConfig(
|
|
1287
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
1288
|
+
)
|
|
1289
|
+
|
|
1290
|
+
retry_config = None
|
|
1291
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1292
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1293
|
+
|
|
1294
|
+
http_res = await self.do_request_async(
|
|
1295
|
+
hook_ctx=HookContext(
|
|
1296
|
+
config=self.sdk_configuration,
|
|
1297
|
+
base_url=base_url or "",
|
|
1298
|
+
operation_id="getIncomeStatements",
|
|
1299
|
+
oauth2_scopes=["market:supplemental"],
|
|
1300
|
+
security_source=self.sdk_configuration.security,
|
|
1301
|
+
tags=["Financials"],
|
|
1302
|
+
extensions=None,
|
|
1303
|
+
),
|
|
1304
|
+
request=req,
|
|
1305
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
1306
|
+
retry_config=retry_config,
|
|
1307
|
+
)
|
|
1308
|
+
|
|
1309
|
+
def next_func() -> Optional[models.GetIncomeStatementsResponse]:
|
|
1310
|
+
body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]])
|
|
1311
|
+
next_url_match = JSONPath("$.nextUrl").parse(body)
|
|
1312
|
+
if len(next_url_match) == 0:
|
|
1313
|
+
return None
|
|
1314
|
+
|
|
1315
|
+
next_url = next_url_match[0]
|
|
1316
|
+
if not next_url:
|
|
1317
|
+
return None
|
|
1318
|
+
|
|
1319
|
+
if next_url[0] == "/":
|
|
1320
|
+
url = self._get_url(base_url, url_variables)
|
|
1321
|
+
next_url = url + next_url
|
|
1322
|
+
|
|
1323
|
+
return self.get_income_statements(
|
|
1324
|
+
cik=cik,
|
|
1325
|
+
ciks=ciks,
|
|
1326
|
+
cik_after=cik_after,
|
|
1327
|
+
cik_from=cik_from,
|
|
1328
|
+
cik_before=cik_before,
|
|
1329
|
+
cik_to=cik_to,
|
|
1330
|
+
period_end=period_end,
|
|
1331
|
+
period_end_after=period_end_after,
|
|
1332
|
+
period_end_from=period_end_from,
|
|
1333
|
+
period_end_before=period_end_before,
|
|
1334
|
+
period_end_to=period_end_to,
|
|
1335
|
+
filing_date=filing_date,
|
|
1336
|
+
filing_date_after=filing_date_after,
|
|
1337
|
+
filing_date_from=filing_date_from,
|
|
1338
|
+
filing_date_before=filing_date_before,
|
|
1339
|
+
filing_date_to=filing_date_to,
|
|
1340
|
+
tickers=tickers,
|
|
1341
|
+
tickers_all_of=tickers_all_of,
|
|
1342
|
+
tickers_any_of=tickers_any_of,
|
|
1343
|
+
fiscal_year=fiscal_year,
|
|
1344
|
+
fiscal_year_above=fiscal_year_above,
|
|
1345
|
+
fiscal_year_min=fiscal_year_min,
|
|
1346
|
+
fiscal_year_below=fiscal_year_below,
|
|
1347
|
+
fiscal_year_max=fiscal_year_max,
|
|
1348
|
+
fiscal_quarter=fiscal_quarter,
|
|
1349
|
+
fiscal_quarter_above=fiscal_quarter_above,
|
|
1350
|
+
fiscal_quarter_min=fiscal_quarter_min,
|
|
1351
|
+
fiscal_quarter_below=fiscal_quarter_below,
|
|
1352
|
+
fiscal_quarter_max=fiscal_quarter_max,
|
|
1353
|
+
timeframe=timeframe,
|
|
1354
|
+
timeframe_any_of=timeframe_any_of,
|
|
1355
|
+
timeframe_after=timeframe_after,
|
|
1356
|
+
timeframe_from=timeframe_from,
|
|
1357
|
+
timeframe_before=timeframe_before,
|
|
1358
|
+
timeframe_to=timeframe_to,
|
|
1359
|
+
max_ticker=max_ticker,
|
|
1360
|
+
max_ticker_any_of=max_ticker_any_of,
|
|
1361
|
+
max_ticker_after=max_ticker_after,
|
|
1362
|
+
max_ticker_from=max_ticker_from,
|
|
1363
|
+
max_ticker_before=max_ticker_before,
|
|
1364
|
+
max_ticker_to=max_ticker_to,
|
|
1365
|
+
min_ticker=min_ticker,
|
|
1366
|
+
min_ticker_any_of=min_ticker_any_of,
|
|
1367
|
+
min_ticker_after=min_ticker_after,
|
|
1368
|
+
min_ticker_from=min_ticker_from,
|
|
1369
|
+
min_ticker_before=min_ticker_before,
|
|
1370
|
+
min_ticker_to=min_ticker_to,
|
|
1371
|
+
limit=limit,
|
|
1372
|
+
sort=sort,
|
|
1373
|
+
next=next,
|
|
1374
|
+
retries=retries,
|
|
1375
|
+
server_url=server_url,
|
|
1376
|
+
timeout_ms=timeout_ms,
|
|
1377
|
+
http_headers=http_headers,
|
|
1378
|
+
url_override=next_url,
|
|
1379
|
+
)
|
|
1380
|
+
|
|
1381
|
+
response_data: Any = None
|
|
1382
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1383
|
+
return models.GetIncomeStatementsResponse(
|
|
1384
|
+
income_statements_response=unmarshal_json_response(
|
|
1385
|
+
Optional[models.IncomeStatementsResponse], http_res
|
|
1386
|
+
),
|
|
1387
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
1388
|
+
next=next_func,
|
|
1389
|
+
)
|
|
1390
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
1391
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
1392
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1393
|
+
request=req, response=http_res
|
|
1394
|
+
)
|
|
1395
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1396
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
1397
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
1398
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1399
|
+
request=req, response=http_res
|
|
1400
|
+
)
|
|
1401
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1402
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
1403
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
1404
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1405
|
+
request=req, response=http_res
|
|
1406
|
+
)
|
|
1407
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1408
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
1409
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
1410
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1411
|
+
request=req, response=http_res
|
|
1412
|
+
)
|
|
1413
|
+
raise errors.NotFound(response_data, http_res)
|
|
1414
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
1415
|
+
response_data = unmarshal_json_response(
|
|
1416
|
+
errors.InternalServerErrorUnion, http_res
|
|
1417
|
+
)
|
|
1418
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1419
|
+
request=req, response=http_res
|
|
1420
|
+
)
|
|
1421
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1422
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1423
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1424
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1425
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1426
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1427
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1428
|
+
|
|
1429
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1430
|
+
|
|
1431
|
+
def get_financial_ratios(
|
|
1432
|
+
self,
|
|
1433
|
+
*,
|
|
1434
|
+
ticker: Optional[str] = None,
|
|
1435
|
+
tickers_any_of: Optional[str] = None,
|
|
1436
|
+
ticker_after: Optional[str] = None,
|
|
1437
|
+
ticker_from: Optional[str] = None,
|
|
1438
|
+
ticker_before: Optional[str] = None,
|
|
1439
|
+
ticker_to: Optional[str] = None,
|
|
1440
|
+
cik: Optional[str] = None,
|
|
1441
|
+
ciks: Optional[str] = None,
|
|
1442
|
+
cik_after: Optional[str] = None,
|
|
1443
|
+
cik_from: Optional[str] = None,
|
|
1444
|
+
cik_before: Optional[str] = None,
|
|
1445
|
+
cik_to: Optional[str] = None,
|
|
1446
|
+
price: Optional[float] = None,
|
|
1447
|
+
price_above: Optional[float] = None,
|
|
1448
|
+
price_min: Optional[float] = None,
|
|
1449
|
+
price_below: Optional[float] = None,
|
|
1450
|
+
price_max: Optional[float] = None,
|
|
1451
|
+
average_volume: Optional[float] = None,
|
|
1452
|
+
average_volume_above: Optional[float] = None,
|
|
1453
|
+
average_volume_min: Optional[float] = None,
|
|
1454
|
+
average_volume_below: Optional[float] = None,
|
|
1455
|
+
average_volume_max: Optional[float] = None,
|
|
1456
|
+
market_cap: Optional[float] = None,
|
|
1457
|
+
market_cap_above: Optional[float] = None,
|
|
1458
|
+
market_cap_min: Optional[float] = None,
|
|
1459
|
+
market_cap_below: Optional[float] = None,
|
|
1460
|
+
market_cap_max: Optional[float] = None,
|
|
1461
|
+
eps: Optional[float] = None,
|
|
1462
|
+
eps_above: Optional[float] = None,
|
|
1463
|
+
eps_min: Optional[float] = None,
|
|
1464
|
+
eps_below: Optional[float] = None,
|
|
1465
|
+
eps_max: Optional[float] = None,
|
|
1466
|
+
pe_ratio: Optional[float] = None,
|
|
1467
|
+
pe_ratio_above: Optional[float] = None,
|
|
1468
|
+
pe_ratio_min: Optional[float] = None,
|
|
1469
|
+
pe_ratio_below: Optional[float] = None,
|
|
1470
|
+
pe_ratio_max: Optional[float] = None,
|
|
1471
|
+
pb_ratio: Optional[float] = None,
|
|
1472
|
+
pb_ratio_above: Optional[float] = None,
|
|
1473
|
+
pb_ratio_min: Optional[float] = None,
|
|
1474
|
+
pb_ratio_below: Optional[float] = None,
|
|
1475
|
+
pb_ratio_max: Optional[float] = None,
|
|
1476
|
+
ps_ratio: Optional[float] = None,
|
|
1477
|
+
ps_ratio_above: Optional[float] = None,
|
|
1478
|
+
ps_ratio_min: Optional[float] = None,
|
|
1479
|
+
ps_ratio_below: Optional[float] = None,
|
|
1480
|
+
ps_ratio_max: Optional[float] = None,
|
|
1481
|
+
pcf_ratio: Optional[float] = None,
|
|
1482
|
+
pcf_ratio_above: Optional[float] = None,
|
|
1483
|
+
pcf_ratio_min: Optional[float] = None,
|
|
1484
|
+
pcf_ratio_below: Optional[float] = None,
|
|
1485
|
+
pcf_ratio_max: Optional[float] = None,
|
|
1486
|
+
limit: Optional[int] = None,
|
|
1487
|
+
sort: Optional[str] = None,
|
|
1488
|
+
next: Optional[str] = None,
|
|
1489
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1490
|
+
server_url: Optional[str] = None,
|
|
1491
|
+
url_override: Optional[str] = None,
|
|
1492
|
+
timeout_ms: Optional[int] = None,
|
|
1493
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1494
|
+
) -> Optional[models.GetFinancialRatiosResponse]:
|
|
1495
|
+
r"""Get Financial Ratios
|
|
1496
|
+
|
|
1497
|
+
Retrieve comprehensive financial ratios including liquidity, profitability, leverage, and efficiency metrics for fundamental analysis. `ticker` accepts a single symbol only. Use `tickersAnyOf` for multiple symbols. If `ticker` contains multiple comma-separated values, the API returns 400: \"Multiple tickers are not supported. Please provide a single ticker.\" If both `ticker` and `tickersAnyOf` are set, the API returns 400: \"Cannot specify both ticker and tickersAnyOf. Use ticker for a single symbol or tickersAnyOf for multiple.\"
|
|
1498
|
+
|
|
1499
|
+
If set, this operation will use `client_id` from the global security.
|
|
1500
|
+
|
|
1501
|
+
:param ticker: Single ticker symbol filter. Enter one ticker such as AAPL to narrow results to one company.
|
|
1502
|
+
:param tickers_any_of: Comma-separated list of ticker symbols.
|
|
1503
|
+
:param ticker_after: Ticker pagination lower bound. Returns symbols alphabetically after this ticker, excluding the ticker itself.
|
|
1504
|
+
:param ticker_from: Ticker greater than or equal (inclusive)
|
|
1505
|
+
:param ticker_before: Ticker pagination upper bound. Returns symbols alphabetically before this ticker, excluding the ticker itself.
|
|
1506
|
+
:param ticker_to: Ticker less than or equal (inclusive)
|
|
1507
|
+
:param cik: CIK company identifier from the SEC. Use this when filtering by SEC registrant instead of ticker.
|
|
1508
|
+
:param ciks: Comma-separated SEC CIK identifiers. Use this to filter several registrants in one request.
|
|
1509
|
+
:param cik_after: CIK pagination lower bound. Returns records with CIK values greater than this value, excluding the value itself.
|
|
1510
|
+
:param cik_from: CIK greater than or equal (inclusive)
|
|
1511
|
+
:param cik_before: CIK pagination upper bound. Returns records with CIK values less than this value, excluding the value itself.
|
|
1512
|
+
:param cik_to: CIK upper-bound filter. Returns records with CIK values less than or equal to this value.
|
|
1513
|
+
:param price: Exact price filter. Use it when you need records matching one specific price value.
|
|
1514
|
+
:param price_above: Price lower-bound filter. Returns records above this value, excluding the value itself.
|
|
1515
|
+
:param price_min: Price greater than or equal (inclusive)
|
|
1516
|
+
:param price_below: Price upper-bound filter. Returns records below this value, excluding the value itself.
|
|
1517
|
+
:param price_max: Price less than or equal (inclusive)
|
|
1518
|
+
:param average_volume: Exact average-volume filter. Use it when screening for one specific average volume value.
|
|
1519
|
+
:param average_volume_above: Average volume greater than (exclusive)
|
|
1520
|
+
:param average_volume_min: Average volume greater than or equal (inclusive)
|
|
1521
|
+
:param average_volume_below: Average volume less than (exclusive)
|
|
1522
|
+
:param average_volume_max: Average volume less than or equal (inclusive)
|
|
1523
|
+
:param market_cap: Exact market-cap filter. Use it when screening for one specific company size value.
|
|
1524
|
+
:param market_cap_above: Market cap greater than (exclusive)
|
|
1525
|
+
:param market_cap_min: Market cap greater than or equal (inclusive)
|
|
1526
|
+
:param market_cap_below: Market-cap upper-bound filter. Returns companies below this value, excluding the value itself.
|
|
1527
|
+
:param market_cap_max: Market cap less than or equal (inclusive)
|
|
1528
|
+
:param eps: Exact earnings-per-share filter. Use it when screening for one EPS value.
|
|
1529
|
+
:param eps_above: EPS lower-bound filter. Returns companies with EPS above this value, excluding the value itself.
|
|
1530
|
+
:param eps_min: EPS greater than or equal (inclusive)
|
|
1531
|
+
:param eps_below: EPS upper-bound filter. Returns companies with EPS below this value, excluding the value itself.
|
|
1532
|
+
:param eps_max: EPS upper-bound filter. Returns companies with EPS less than or equal to this value.
|
|
1533
|
+
:param pe_ratio: Exact price-to-earnings ratio filter. Use it when screening for one valuation value.
|
|
1534
|
+
:param pe_ratio_above: P/E ratio lower-bound filter. Returns companies above this valuation, excluding the value itself.
|
|
1535
|
+
:param pe_ratio_min: P/E ratio greater than or equal (inclusive)
|
|
1536
|
+
:param pe_ratio_below: P/E ratio upper-bound filter. Returns companies below this valuation, excluding the value itself.
|
|
1537
|
+
:param pe_ratio_max: P/E ratio less than or equal (inclusive)
|
|
1538
|
+
:param pb_ratio: Exact price-to-book ratio filter. Use it when screening for one valuation value.
|
|
1539
|
+
:param pb_ratio_above: P/B ratio lower-bound filter. Returns companies above this valuation, excluding the value itself.
|
|
1540
|
+
:param pb_ratio_min: P/B ratio greater than or equal (inclusive)
|
|
1541
|
+
:param pb_ratio_below: P/B ratio upper-bound filter. Returns companies below this valuation, excluding the value itself.
|
|
1542
|
+
:param pb_ratio_max: P/B ratio less than or equal (inclusive)
|
|
1543
|
+
:param ps_ratio: Exact price-to-sales ratio filter. Use it when screening for one valuation value.
|
|
1544
|
+
:param ps_ratio_above: P/S ratio lower-bound filter. Returns companies above this valuation, excluding the value itself.
|
|
1545
|
+
:param ps_ratio_min: P/S ratio greater than or equal (inclusive)
|
|
1546
|
+
:param ps_ratio_below: P/S ratio upper-bound filter. Returns companies below this valuation, excluding the value itself.
|
|
1547
|
+
:param ps_ratio_max: P/S ratio less than or equal (inclusive)
|
|
1548
|
+
:param pcf_ratio: Exact price-to-cash-flow ratio filter. Use it when screening for one valuation value.
|
|
1549
|
+
:param pcf_ratio_above: P/CF ratio greater than (exclusive)
|
|
1550
|
+
:param pcf_ratio_min: P/CF ratio greater than or equal (inclusive)
|
|
1551
|
+
:param pcf_ratio_below: P/CF ratio upper-bound filter. Returns companies below this valuation, excluding the value itself.
|
|
1552
|
+
:param pcf_ratio_max: P/CF ratio less than or equal (inclusive)
|
|
1553
|
+
:param limit: Maximum number of results to return. Use smaller values for UI pages and larger values for exports within API limits.
|
|
1554
|
+
:param sort: A comma-separated list of sort columns. For each column, append `.asc` or `.desc` to specify direction. Defaults to `ticker.asc` when not specified.
|
|
1555
|
+
:param next: Pagination cursor from the previous response. Omit it on the first request, then send the returned cursor to fetch the next page.
|
|
1556
|
+
:param retries: Override the default retry configuration for this method
|
|
1557
|
+
:param server_url: Override the default server URL for this method
|
|
1558
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1559
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1560
|
+
"""
|
|
1561
|
+
base_url = None
|
|
1562
|
+
url_variables = None
|
|
1563
|
+
if timeout_ms is None:
|
|
1564
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1565
|
+
|
|
1566
|
+
if timeout_ms is None:
|
|
1567
|
+
timeout_ms = 30000
|
|
1568
|
+
|
|
1569
|
+
if server_url is not None:
|
|
1570
|
+
base_url = server_url
|
|
1571
|
+
else:
|
|
1572
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1573
|
+
|
|
1574
|
+
request = models.GetFinancialRatiosRequest(
|
|
1575
|
+
ticker=ticker,
|
|
1576
|
+
tickers_any_of=tickers_any_of,
|
|
1577
|
+
ticker_after=ticker_after,
|
|
1578
|
+
ticker_from=ticker_from,
|
|
1579
|
+
ticker_before=ticker_before,
|
|
1580
|
+
ticker_to=ticker_to,
|
|
1581
|
+
cik=cik,
|
|
1582
|
+
ciks=ciks,
|
|
1583
|
+
cik_after=cik_after,
|
|
1584
|
+
cik_from=cik_from,
|
|
1585
|
+
cik_before=cik_before,
|
|
1586
|
+
cik_to=cik_to,
|
|
1587
|
+
price=price,
|
|
1588
|
+
price_above=price_above,
|
|
1589
|
+
price_min=price_min,
|
|
1590
|
+
price_below=price_below,
|
|
1591
|
+
price_max=price_max,
|
|
1592
|
+
average_volume=average_volume,
|
|
1593
|
+
average_volume_above=average_volume_above,
|
|
1594
|
+
average_volume_min=average_volume_min,
|
|
1595
|
+
average_volume_below=average_volume_below,
|
|
1596
|
+
average_volume_max=average_volume_max,
|
|
1597
|
+
market_cap=market_cap,
|
|
1598
|
+
market_cap_above=market_cap_above,
|
|
1599
|
+
market_cap_min=market_cap_min,
|
|
1600
|
+
market_cap_below=market_cap_below,
|
|
1601
|
+
market_cap_max=market_cap_max,
|
|
1602
|
+
eps=eps,
|
|
1603
|
+
eps_above=eps_above,
|
|
1604
|
+
eps_min=eps_min,
|
|
1605
|
+
eps_below=eps_below,
|
|
1606
|
+
eps_max=eps_max,
|
|
1607
|
+
pe_ratio=pe_ratio,
|
|
1608
|
+
pe_ratio_above=pe_ratio_above,
|
|
1609
|
+
pe_ratio_min=pe_ratio_min,
|
|
1610
|
+
pe_ratio_below=pe_ratio_below,
|
|
1611
|
+
pe_ratio_max=pe_ratio_max,
|
|
1612
|
+
pb_ratio=pb_ratio,
|
|
1613
|
+
pb_ratio_above=pb_ratio_above,
|
|
1614
|
+
pb_ratio_min=pb_ratio_min,
|
|
1615
|
+
pb_ratio_below=pb_ratio_below,
|
|
1616
|
+
pb_ratio_max=pb_ratio_max,
|
|
1617
|
+
ps_ratio=ps_ratio,
|
|
1618
|
+
ps_ratio_above=ps_ratio_above,
|
|
1619
|
+
ps_ratio_min=ps_ratio_min,
|
|
1620
|
+
ps_ratio_below=ps_ratio_below,
|
|
1621
|
+
ps_ratio_max=ps_ratio_max,
|
|
1622
|
+
pcf_ratio=pcf_ratio,
|
|
1623
|
+
pcf_ratio_above=pcf_ratio_above,
|
|
1624
|
+
pcf_ratio_min=pcf_ratio_min,
|
|
1625
|
+
pcf_ratio_below=pcf_ratio_below,
|
|
1626
|
+
pcf_ratio_max=pcf_ratio_max,
|
|
1627
|
+
limit=limit,
|
|
1628
|
+
sort=sort,
|
|
1629
|
+
next=next,
|
|
1630
|
+
)
|
|
1631
|
+
|
|
1632
|
+
req = self._build_request(
|
|
1633
|
+
method="GET",
|
|
1634
|
+
path="/v1/financials/ratios",
|
|
1635
|
+
base_url=base_url,
|
|
1636
|
+
url_variables=url_variables,
|
|
1637
|
+
url_override=url_override,
|
|
1638
|
+
request=request,
|
|
1639
|
+
request_body_required=False,
|
|
1640
|
+
request_has_path_params=False,
|
|
1641
|
+
request_has_query_params=True,
|
|
1642
|
+
user_agent_header="user-agent",
|
|
1643
|
+
accept_header_value="application/json",
|
|
1644
|
+
http_headers=http_headers,
|
|
1645
|
+
security=self.sdk_configuration.security,
|
|
1646
|
+
allow_empty_value=None,
|
|
1647
|
+
allowed_fields=["client_id"],
|
|
1648
|
+
timeout_ms=timeout_ms,
|
|
1649
|
+
)
|
|
1650
|
+
|
|
1651
|
+
if retries == UNSET:
|
|
1652
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1653
|
+
retries = self.sdk_configuration.retry_config
|
|
1654
|
+
else:
|
|
1655
|
+
retries = utils.RetryConfig(
|
|
1656
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
1657
|
+
)
|
|
1658
|
+
|
|
1659
|
+
retry_config = None
|
|
1660
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1661
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1662
|
+
|
|
1663
|
+
http_res = self.do_request(
|
|
1664
|
+
hook_ctx=HookContext(
|
|
1665
|
+
config=self.sdk_configuration,
|
|
1666
|
+
base_url=base_url or "",
|
|
1667
|
+
operation_id="getFinancialRatios",
|
|
1668
|
+
oauth2_scopes=["market:supplemental"],
|
|
1669
|
+
security_source=self.sdk_configuration.security,
|
|
1670
|
+
tags=["Financials"],
|
|
1671
|
+
extensions=None,
|
|
1672
|
+
),
|
|
1673
|
+
request=req,
|
|
1674
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
1675
|
+
retry_config=retry_config,
|
|
1676
|
+
)
|
|
1677
|
+
|
|
1678
|
+
def next_func() -> Optional[models.GetFinancialRatiosResponse]:
|
|
1679
|
+
body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]])
|
|
1680
|
+
next_url_match = JSONPath("$.nextUrl").parse(body)
|
|
1681
|
+
if len(next_url_match) == 0:
|
|
1682
|
+
return None
|
|
1683
|
+
|
|
1684
|
+
next_url = next_url_match[0]
|
|
1685
|
+
if not next_url:
|
|
1686
|
+
return None
|
|
1687
|
+
|
|
1688
|
+
if next_url[0] == "/":
|
|
1689
|
+
url = self._get_url(base_url, url_variables)
|
|
1690
|
+
next_url = url + next_url
|
|
1691
|
+
|
|
1692
|
+
return self.get_financial_ratios(
|
|
1693
|
+
ticker=ticker,
|
|
1694
|
+
tickers_any_of=tickers_any_of,
|
|
1695
|
+
ticker_after=ticker_after,
|
|
1696
|
+
ticker_from=ticker_from,
|
|
1697
|
+
ticker_before=ticker_before,
|
|
1698
|
+
ticker_to=ticker_to,
|
|
1699
|
+
cik=cik,
|
|
1700
|
+
ciks=ciks,
|
|
1701
|
+
cik_after=cik_after,
|
|
1702
|
+
cik_from=cik_from,
|
|
1703
|
+
cik_before=cik_before,
|
|
1704
|
+
cik_to=cik_to,
|
|
1705
|
+
price=price,
|
|
1706
|
+
price_above=price_above,
|
|
1707
|
+
price_min=price_min,
|
|
1708
|
+
price_below=price_below,
|
|
1709
|
+
price_max=price_max,
|
|
1710
|
+
average_volume=average_volume,
|
|
1711
|
+
average_volume_above=average_volume_above,
|
|
1712
|
+
average_volume_min=average_volume_min,
|
|
1713
|
+
average_volume_below=average_volume_below,
|
|
1714
|
+
average_volume_max=average_volume_max,
|
|
1715
|
+
market_cap=market_cap,
|
|
1716
|
+
market_cap_above=market_cap_above,
|
|
1717
|
+
market_cap_min=market_cap_min,
|
|
1718
|
+
market_cap_below=market_cap_below,
|
|
1719
|
+
market_cap_max=market_cap_max,
|
|
1720
|
+
eps=eps,
|
|
1721
|
+
eps_above=eps_above,
|
|
1722
|
+
eps_min=eps_min,
|
|
1723
|
+
eps_below=eps_below,
|
|
1724
|
+
eps_max=eps_max,
|
|
1725
|
+
pe_ratio=pe_ratio,
|
|
1726
|
+
pe_ratio_above=pe_ratio_above,
|
|
1727
|
+
pe_ratio_min=pe_ratio_min,
|
|
1728
|
+
pe_ratio_below=pe_ratio_below,
|
|
1729
|
+
pe_ratio_max=pe_ratio_max,
|
|
1730
|
+
pb_ratio=pb_ratio,
|
|
1731
|
+
pb_ratio_above=pb_ratio_above,
|
|
1732
|
+
pb_ratio_min=pb_ratio_min,
|
|
1733
|
+
pb_ratio_below=pb_ratio_below,
|
|
1734
|
+
pb_ratio_max=pb_ratio_max,
|
|
1735
|
+
ps_ratio=ps_ratio,
|
|
1736
|
+
ps_ratio_above=ps_ratio_above,
|
|
1737
|
+
ps_ratio_min=ps_ratio_min,
|
|
1738
|
+
ps_ratio_below=ps_ratio_below,
|
|
1739
|
+
ps_ratio_max=ps_ratio_max,
|
|
1740
|
+
pcf_ratio=pcf_ratio,
|
|
1741
|
+
pcf_ratio_above=pcf_ratio_above,
|
|
1742
|
+
pcf_ratio_min=pcf_ratio_min,
|
|
1743
|
+
pcf_ratio_below=pcf_ratio_below,
|
|
1744
|
+
pcf_ratio_max=pcf_ratio_max,
|
|
1745
|
+
limit=limit,
|
|
1746
|
+
sort=sort,
|
|
1747
|
+
next=next,
|
|
1748
|
+
retries=retries,
|
|
1749
|
+
server_url=server_url,
|
|
1750
|
+
timeout_ms=timeout_ms,
|
|
1751
|
+
http_headers=http_headers,
|
|
1752
|
+
url_override=next_url,
|
|
1753
|
+
)
|
|
1754
|
+
|
|
1755
|
+
response_data: Any = None
|
|
1756
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1757
|
+
return models.GetFinancialRatiosResponse(
|
|
1758
|
+
financial_ratios_response=unmarshal_json_response(
|
|
1759
|
+
Optional[models.FinancialRatiosResponse], http_res
|
|
1760
|
+
),
|
|
1761
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
1762
|
+
next=next_func,
|
|
1763
|
+
)
|
|
1764
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
1765
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
1766
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1767
|
+
request=req, response=http_res
|
|
1768
|
+
)
|
|
1769
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1770
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
1771
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
1772
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1773
|
+
request=req, response=http_res
|
|
1774
|
+
)
|
|
1775
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1776
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
1777
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
1778
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1779
|
+
request=req, response=http_res
|
|
1780
|
+
)
|
|
1781
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1782
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
1783
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
1784
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1785
|
+
request=req, response=http_res
|
|
1786
|
+
)
|
|
1787
|
+
raise errors.NotFound(response_data, http_res)
|
|
1788
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
1789
|
+
response_data = unmarshal_json_response(
|
|
1790
|
+
errors.InternalServerErrorUnion, http_res
|
|
1791
|
+
)
|
|
1792
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1793
|
+
request=req, response=http_res
|
|
1794
|
+
)
|
|
1795
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1796
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1797
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1798
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1799
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1800
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1801
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1802
|
+
|
|
1803
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1804
|
+
|
|
1805
|
+
async def get_financial_ratios_async(
|
|
1806
|
+
self,
|
|
1807
|
+
*,
|
|
1808
|
+
ticker: Optional[str] = None,
|
|
1809
|
+
tickers_any_of: Optional[str] = None,
|
|
1810
|
+
ticker_after: Optional[str] = None,
|
|
1811
|
+
ticker_from: Optional[str] = None,
|
|
1812
|
+
ticker_before: Optional[str] = None,
|
|
1813
|
+
ticker_to: Optional[str] = None,
|
|
1814
|
+
cik: Optional[str] = None,
|
|
1815
|
+
ciks: Optional[str] = None,
|
|
1816
|
+
cik_after: Optional[str] = None,
|
|
1817
|
+
cik_from: Optional[str] = None,
|
|
1818
|
+
cik_before: Optional[str] = None,
|
|
1819
|
+
cik_to: Optional[str] = None,
|
|
1820
|
+
price: Optional[float] = None,
|
|
1821
|
+
price_above: Optional[float] = None,
|
|
1822
|
+
price_min: Optional[float] = None,
|
|
1823
|
+
price_below: Optional[float] = None,
|
|
1824
|
+
price_max: Optional[float] = None,
|
|
1825
|
+
average_volume: Optional[float] = None,
|
|
1826
|
+
average_volume_above: Optional[float] = None,
|
|
1827
|
+
average_volume_min: Optional[float] = None,
|
|
1828
|
+
average_volume_below: Optional[float] = None,
|
|
1829
|
+
average_volume_max: Optional[float] = None,
|
|
1830
|
+
market_cap: Optional[float] = None,
|
|
1831
|
+
market_cap_above: Optional[float] = None,
|
|
1832
|
+
market_cap_min: Optional[float] = None,
|
|
1833
|
+
market_cap_below: Optional[float] = None,
|
|
1834
|
+
market_cap_max: Optional[float] = None,
|
|
1835
|
+
eps: Optional[float] = None,
|
|
1836
|
+
eps_above: Optional[float] = None,
|
|
1837
|
+
eps_min: Optional[float] = None,
|
|
1838
|
+
eps_below: Optional[float] = None,
|
|
1839
|
+
eps_max: Optional[float] = None,
|
|
1840
|
+
pe_ratio: Optional[float] = None,
|
|
1841
|
+
pe_ratio_above: Optional[float] = None,
|
|
1842
|
+
pe_ratio_min: Optional[float] = None,
|
|
1843
|
+
pe_ratio_below: Optional[float] = None,
|
|
1844
|
+
pe_ratio_max: Optional[float] = None,
|
|
1845
|
+
pb_ratio: Optional[float] = None,
|
|
1846
|
+
pb_ratio_above: Optional[float] = None,
|
|
1847
|
+
pb_ratio_min: Optional[float] = None,
|
|
1848
|
+
pb_ratio_below: Optional[float] = None,
|
|
1849
|
+
pb_ratio_max: Optional[float] = None,
|
|
1850
|
+
ps_ratio: Optional[float] = None,
|
|
1851
|
+
ps_ratio_above: Optional[float] = None,
|
|
1852
|
+
ps_ratio_min: Optional[float] = None,
|
|
1853
|
+
ps_ratio_below: Optional[float] = None,
|
|
1854
|
+
ps_ratio_max: Optional[float] = None,
|
|
1855
|
+
pcf_ratio: Optional[float] = None,
|
|
1856
|
+
pcf_ratio_above: Optional[float] = None,
|
|
1857
|
+
pcf_ratio_min: Optional[float] = None,
|
|
1858
|
+
pcf_ratio_below: Optional[float] = None,
|
|
1859
|
+
pcf_ratio_max: Optional[float] = None,
|
|
1860
|
+
limit: Optional[int] = None,
|
|
1861
|
+
sort: Optional[str] = None,
|
|
1862
|
+
next: Optional[str] = None,
|
|
1863
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1864
|
+
server_url: Optional[str] = None,
|
|
1865
|
+
url_override: Optional[str] = None,
|
|
1866
|
+
timeout_ms: Optional[int] = None,
|
|
1867
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1868
|
+
) -> Optional[models.GetFinancialRatiosResponse]:
|
|
1869
|
+
r"""Get Financial Ratios
|
|
1870
|
+
|
|
1871
|
+
Retrieve comprehensive financial ratios including liquidity, profitability, leverage, and efficiency metrics for fundamental analysis. `ticker` accepts a single symbol only. Use `tickersAnyOf` for multiple symbols. If `ticker` contains multiple comma-separated values, the API returns 400: \"Multiple tickers are not supported. Please provide a single ticker.\" If both `ticker` and `tickersAnyOf` are set, the API returns 400: \"Cannot specify both ticker and tickersAnyOf. Use ticker for a single symbol or tickersAnyOf for multiple.\"
|
|
1872
|
+
|
|
1873
|
+
If set, this operation will use `client_id` from the global security.
|
|
1874
|
+
|
|
1875
|
+
:param ticker: Single ticker symbol filter. Enter one ticker such as AAPL to narrow results to one company.
|
|
1876
|
+
:param tickers_any_of: Comma-separated list of ticker symbols.
|
|
1877
|
+
:param ticker_after: Ticker pagination lower bound. Returns symbols alphabetically after this ticker, excluding the ticker itself.
|
|
1878
|
+
:param ticker_from: Ticker greater than or equal (inclusive)
|
|
1879
|
+
:param ticker_before: Ticker pagination upper bound. Returns symbols alphabetically before this ticker, excluding the ticker itself.
|
|
1880
|
+
:param ticker_to: Ticker less than or equal (inclusive)
|
|
1881
|
+
:param cik: CIK company identifier from the SEC. Use this when filtering by SEC registrant instead of ticker.
|
|
1882
|
+
:param ciks: Comma-separated SEC CIK identifiers. Use this to filter several registrants in one request.
|
|
1883
|
+
:param cik_after: CIK pagination lower bound. Returns records with CIK values greater than this value, excluding the value itself.
|
|
1884
|
+
:param cik_from: CIK greater than or equal (inclusive)
|
|
1885
|
+
:param cik_before: CIK pagination upper bound. Returns records with CIK values less than this value, excluding the value itself.
|
|
1886
|
+
:param cik_to: CIK upper-bound filter. Returns records with CIK values less than or equal to this value.
|
|
1887
|
+
:param price: Exact price filter. Use it when you need records matching one specific price value.
|
|
1888
|
+
:param price_above: Price lower-bound filter. Returns records above this value, excluding the value itself.
|
|
1889
|
+
:param price_min: Price greater than or equal (inclusive)
|
|
1890
|
+
:param price_below: Price upper-bound filter. Returns records below this value, excluding the value itself.
|
|
1891
|
+
:param price_max: Price less than or equal (inclusive)
|
|
1892
|
+
:param average_volume: Exact average-volume filter. Use it when screening for one specific average volume value.
|
|
1893
|
+
:param average_volume_above: Average volume greater than (exclusive)
|
|
1894
|
+
:param average_volume_min: Average volume greater than or equal (inclusive)
|
|
1895
|
+
:param average_volume_below: Average volume less than (exclusive)
|
|
1896
|
+
:param average_volume_max: Average volume less than or equal (inclusive)
|
|
1897
|
+
:param market_cap: Exact market-cap filter. Use it when screening for one specific company size value.
|
|
1898
|
+
:param market_cap_above: Market cap greater than (exclusive)
|
|
1899
|
+
:param market_cap_min: Market cap greater than or equal (inclusive)
|
|
1900
|
+
:param market_cap_below: Market-cap upper-bound filter. Returns companies below this value, excluding the value itself.
|
|
1901
|
+
:param market_cap_max: Market cap less than or equal (inclusive)
|
|
1902
|
+
:param eps: Exact earnings-per-share filter. Use it when screening for one EPS value.
|
|
1903
|
+
:param eps_above: EPS lower-bound filter. Returns companies with EPS above this value, excluding the value itself.
|
|
1904
|
+
:param eps_min: EPS greater than or equal (inclusive)
|
|
1905
|
+
:param eps_below: EPS upper-bound filter. Returns companies with EPS below this value, excluding the value itself.
|
|
1906
|
+
:param eps_max: EPS upper-bound filter. Returns companies with EPS less than or equal to this value.
|
|
1907
|
+
:param pe_ratio: Exact price-to-earnings ratio filter. Use it when screening for one valuation value.
|
|
1908
|
+
:param pe_ratio_above: P/E ratio lower-bound filter. Returns companies above this valuation, excluding the value itself.
|
|
1909
|
+
:param pe_ratio_min: P/E ratio greater than or equal (inclusive)
|
|
1910
|
+
:param pe_ratio_below: P/E ratio upper-bound filter. Returns companies below this valuation, excluding the value itself.
|
|
1911
|
+
:param pe_ratio_max: P/E ratio less than or equal (inclusive)
|
|
1912
|
+
:param pb_ratio: Exact price-to-book ratio filter. Use it when screening for one valuation value.
|
|
1913
|
+
:param pb_ratio_above: P/B ratio lower-bound filter. Returns companies above this valuation, excluding the value itself.
|
|
1914
|
+
:param pb_ratio_min: P/B ratio greater than or equal (inclusive)
|
|
1915
|
+
:param pb_ratio_below: P/B ratio upper-bound filter. Returns companies below this valuation, excluding the value itself.
|
|
1916
|
+
:param pb_ratio_max: P/B ratio less than or equal (inclusive)
|
|
1917
|
+
:param ps_ratio: Exact price-to-sales ratio filter. Use it when screening for one valuation value.
|
|
1918
|
+
:param ps_ratio_above: P/S ratio lower-bound filter. Returns companies above this valuation, excluding the value itself.
|
|
1919
|
+
:param ps_ratio_min: P/S ratio greater than or equal (inclusive)
|
|
1920
|
+
:param ps_ratio_below: P/S ratio upper-bound filter. Returns companies below this valuation, excluding the value itself.
|
|
1921
|
+
:param ps_ratio_max: P/S ratio less than or equal (inclusive)
|
|
1922
|
+
:param pcf_ratio: Exact price-to-cash-flow ratio filter. Use it when screening for one valuation value.
|
|
1923
|
+
:param pcf_ratio_above: P/CF ratio greater than (exclusive)
|
|
1924
|
+
:param pcf_ratio_min: P/CF ratio greater than or equal (inclusive)
|
|
1925
|
+
:param pcf_ratio_below: P/CF ratio upper-bound filter. Returns companies below this valuation, excluding the value itself.
|
|
1926
|
+
:param pcf_ratio_max: P/CF ratio less than or equal (inclusive)
|
|
1927
|
+
:param limit: Maximum number of results to return. Use smaller values for UI pages and larger values for exports within API limits.
|
|
1928
|
+
:param sort: A comma-separated list of sort columns. For each column, append `.asc` or `.desc` to specify direction. Defaults to `ticker.asc` when not specified.
|
|
1929
|
+
:param next: Pagination cursor from the previous response. Omit it on the first request, then send the returned cursor to fetch the next page.
|
|
1930
|
+
:param retries: Override the default retry configuration for this method
|
|
1931
|
+
:param server_url: Override the default server URL for this method
|
|
1932
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1933
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1934
|
+
"""
|
|
1935
|
+
base_url = None
|
|
1936
|
+
url_variables = None
|
|
1937
|
+
if timeout_ms is None:
|
|
1938
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1939
|
+
|
|
1940
|
+
if timeout_ms is None:
|
|
1941
|
+
timeout_ms = 30000
|
|
1942
|
+
|
|
1943
|
+
if server_url is not None:
|
|
1944
|
+
base_url = server_url
|
|
1945
|
+
else:
|
|
1946
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1947
|
+
|
|
1948
|
+
request = models.GetFinancialRatiosRequest(
|
|
1949
|
+
ticker=ticker,
|
|
1950
|
+
tickers_any_of=tickers_any_of,
|
|
1951
|
+
ticker_after=ticker_after,
|
|
1952
|
+
ticker_from=ticker_from,
|
|
1953
|
+
ticker_before=ticker_before,
|
|
1954
|
+
ticker_to=ticker_to,
|
|
1955
|
+
cik=cik,
|
|
1956
|
+
ciks=ciks,
|
|
1957
|
+
cik_after=cik_after,
|
|
1958
|
+
cik_from=cik_from,
|
|
1959
|
+
cik_before=cik_before,
|
|
1960
|
+
cik_to=cik_to,
|
|
1961
|
+
price=price,
|
|
1962
|
+
price_above=price_above,
|
|
1963
|
+
price_min=price_min,
|
|
1964
|
+
price_below=price_below,
|
|
1965
|
+
price_max=price_max,
|
|
1966
|
+
average_volume=average_volume,
|
|
1967
|
+
average_volume_above=average_volume_above,
|
|
1968
|
+
average_volume_min=average_volume_min,
|
|
1969
|
+
average_volume_below=average_volume_below,
|
|
1970
|
+
average_volume_max=average_volume_max,
|
|
1971
|
+
market_cap=market_cap,
|
|
1972
|
+
market_cap_above=market_cap_above,
|
|
1973
|
+
market_cap_min=market_cap_min,
|
|
1974
|
+
market_cap_below=market_cap_below,
|
|
1975
|
+
market_cap_max=market_cap_max,
|
|
1976
|
+
eps=eps,
|
|
1977
|
+
eps_above=eps_above,
|
|
1978
|
+
eps_min=eps_min,
|
|
1979
|
+
eps_below=eps_below,
|
|
1980
|
+
eps_max=eps_max,
|
|
1981
|
+
pe_ratio=pe_ratio,
|
|
1982
|
+
pe_ratio_above=pe_ratio_above,
|
|
1983
|
+
pe_ratio_min=pe_ratio_min,
|
|
1984
|
+
pe_ratio_below=pe_ratio_below,
|
|
1985
|
+
pe_ratio_max=pe_ratio_max,
|
|
1986
|
+
pb_ratio=pb_ratio,
|
|
1987
|
+
pb_ratio_above=pb_ratio_above,
|
|
1988
|
+
pb_ratio_min=pb_ratio_min,
|
|
1989
|
+
pb_ratio_below=pb_ratio_below,
|
|
1990
|
+
pb_ratio_max=pb_ratio_max,
|
|
1991
|
+
ps_ratio=ps_ratio,
|
|
1992
|
+
ps_ratio_above=ps_ratio_above,
|
|
1993
|
+
ps_ratio_min=ps_ratio_min,
|
|
1994
|
+
ps_ratio_below=ps_ratio_below,
|
|
1995
|
+
ps_ratio_max=ps_ratio_max,
|
|
1996
|
+
pcf_ratio=pcf_ratio,
|
|
1997
|
+
pcf_ratio_above=pcf_ratio_above,
|
|
1998
|
+
pcf_ratio_min=pcf_ratio_min,
|
|
1999
|
+
pcf_ratio_below=pcf_ratio_below,
|
|
2000
|
+
pcf_ratio_max=pcf_ratio_max,
|
|
2001
|
+
limit=limit,
|
|
2002
|
+
sort=sort,
|
|
2003
|
+
next=next,
|
|
2004
|
+
)
|
|
2005
|
+
|
|
2006
|
+
req = self._build_request_async(
|
|
2007
|
+
method="GET",
|
|
2008
|
+
path="/v1/financials/ratios",
|
|
2009
|
+
base_url=base_url,
|
|
2010
|
+
url_variables=url_variables,
|
|
2011
|
+
url_override=url_override,
|
|
2012
|
+
request=request,
|
|
2013
|
+
request_body_required=False,
|
|
2014
|
+
request_has_path_params=False,
|
|
2015
|
+
request_has_query_params=True,
|
|
2016
|
+
user_agent_header="user-agent",
|
|
2017
|
+
accept_header_value="application/json",
|
|
2018
|
+
http_headers=http_headers,
|
|
2019
|
+
security=self.sdk_configuration.security,
|
|
2020
|
+
allow_empty_value=None,
|
|
2021
|
+
allowed_fields=["client_id"],
|
|
2022
|
+
timeout_ms=timeout_ms,
|
|
2023
|
+
)
|
|
2024
|
+
|
|
2025
|
+
if retries == UNSET:
|
|
2026
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
2027
|
+
retries = self.sdk_configuration.retry_config
|
|
2028
|
+
else:
|
|
2029
|
+
retries = utils.RetryConfig(
|
|
2030
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
2031
|
+
)
|
|
2032
|
+
|
|
2033
|
+
retry_config = None
|
|
2034
|
+
if isinstance(retries, utils.RetryConfig):
|
|
2035
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
2036
|
+
|
|
2037
|
+
http_res = await self.do_request_async(
|
|
2038
|
+
hook_ctx=HookContext(
|
|
2039
|
+
config=self.sdk_configuration,
|
|
2040
|
+
base_url=base_url or "",
|
|
2041
|
+
operation_id="getFinancialRatios",
|
|
2042
|
+
oauth2_scopes=["market:supplemental"],
|
|
2043
|
+
security_source=self.sdk_configuration.security,
|
|
2044
|
+
tags=["Financials"],
|
|
2045
|
+
extensions=None,
|
|
2046
|
+
),
|
|
2047
|
+
request=req,
|
|
2048
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
2049
|
+
retry_config=retry_config,
|
|
2050
|
+
)
|
|
2051
|
+
|
|
2052
|
+
def next_func() -> Optional[models.GetFinancialRatiosResponse]:
|
|
2053
|
+
body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]])
|
|
2054
|
+
next_url_match = JSONPath("$.nextUrl").parse(body)
|
|
2055
|
+
if len(next_url_match) == 0:
|
|
2056
|
+
return None
|
|
2057
|
+
|
|
2058
|
+
next_url = next_url_match[0]
|
|
2059
|
+
if not next_url:
|
|
2060
|
+
return None
|
|
2061
|
+
|
|
2062
|
+
if next_url[0] == "/":
|
|
2063
|
+
url = self._get_url(base_url, url_variables)
|
|
2064
|
+
next_url = url + next_url
|
|
2065
|
+
|
|
2066
|
+
return self.get_financial_ratios(
|
|
2067
|
+
ticker=ticker,
|
|
2068
|
+
tickers_any_of=tickers_any_of,
|
|
2069
|
+
ticker_after=ticker_after,
|
|
2070
|
+
ticker_from=ticker_from,
|
|
2071
|
+
ticker_before=ticker_before,
|
|
2072
|
+
ticker_to=ticker_to,
|
|
2073
|
+
cik=cik,
|
|
2074
|
+
ciks=ciks,
|
|
2075
|
+
cik_after=cik_after,
|
|
2076
|
+
cik_from=cik_from,
|
|
2077
|
+
cik_before=cik_before,
|
|
2078
|
+
cik_to=cik_to,
|
|
2079
|
+
price=price,
|
|
2080
|
+
price_above=price_above,
|
|
2081
|
+
price_min=price_min,
|
|
2082
|
+
price_below=price_below,
|
|
2083
|
+
price_max=price_max,
|
|
2084
|
+
average_volume=average_volume,
|
|
2085
|
+
average_volume_above=average_volume_above,
|
|
2086
|
+
average_volume_min=average_volume_min,
|
|
2087
|
+
average_volume_below=average_volume_below,
|
|
2088
|
+
average_volume_max=average_volume_max,
|
|
2089
|
+
market_cap=market_cap,
|
|
2090
|
+
market_cap_above=market_cap_above,
|
|
2091
|
+
market_cap_min=market_cap_min,
|
|
2092
|
+
market_cap_below=market_cap_below,
|
|
2093
|
+
market_cap_max=market_cap_max,
|
|
2094
|
+
eps=eps,
|
|
2095
|
+
eps_above=eps_above,
|
|
2096
|
+
eps_min=eps_min,
|
|
2097
|
+
eps_below=eps_below,
|
|
2098
|
+
eps_max=eps_max,
|
|
2099
|
+
pe_ratio=pe_ratio,
|
|
2100
|
+
pe_ratio_above=pe_ratio_above,
|
|
2101
|
+
pe_ratio_min=pe_ratio_min,
|
|
2102
|
+
pe_ratio_below=pe_ratio_below,
|
|
2103
|
+
pe_ratio_max=pe_ratio_max,
|
|
2104
|
+
pb_ratio=pb_ratio,
|
|
2105
|
+
pb_ratio_above=pb_ratio_above,
|
|
2106
|
+
pb_ratio_min=pb_ratio_min,
|
|
2107
|
+
pb_ratio_below=pb_ratio_below,
|
|
2108
|
+
pb_ratio_max=pb_ratio_max,
|
|
2109
|
+
ps_ratio=ps_ratio,
|
|
2110
|
+
ps_ratio_above=ps_ratio_above,
|
|
2111
|
+
ps_ratio_min=ps_ratio_min,
|
|
2112
|
+
ps_ratio_below=ps_ratio_below,
|
|
2113
|
+
ps_ratio_max=ps_ratio_max,
|
|
2114
|
+
pcf_ratio=pcf_ratio,
|
|
2115
|
+
pcf_ratio_above=pcf_ratio_above,
|
|
2116
|
+
pcf_ratio_min=pcf_ratio_min,
|
|
2117
|
+
pcf_ratio_below=pcf_ratio_below,
|
|
2118
|
+
pcf_ratio_max=pcf_ratio_max,
|
|
2119
|
+
limit=limit,
|
|
2120
|
+
sort=sort,
|
|
2121
|
+
next=next,
|
|
2122
|
+
retries=retries,
|
|
2123
|
+
server_url=server_url,
|
|
2124
|
+
timeout_ms=timeout_ms,
|
|
2125
|
+
http_headers=http_headers,
|
|
2126
|
+
url_override=next_url,
|
|
2127
|
+
)
|
|
2128
|
+
|
|
2129
|
+
response_data: Any = None
|
|
2130
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
2131
|
+
return models.GetFinancialRatiosResponse(
|
|
2132
|
+
financial_ratios_response=unmarshal_json_response(
|
|
2133
|
+
Optional[models.FinancialRatiosResponse], http_res
|
|
2134
|
+
),
|
|
2135
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
2136
|
+
next=next_func,
|
|
2137
|
+
)
|
|
2138
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
2139
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
2140
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2141
|
+
request=req, response=http_res
|
|
2142
|
+
)
|
|
2143
|
+
raise errors.BadRequest(response_data, http_res)
|
|
2144
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
2145
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
2146
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2147
|
+
request=req, response=http_res
|
|
2148
|
+
)
|
|
2149
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
2150
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
2151
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
2152
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2153
|
+
request=req, response=http_res
|
|
2154
|
+
)
|
|
2155
|
+
raise errors.Forbidden(response_data, http_res)
|
|
2156
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
2157
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
2158
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2159
|
+
request=req, response=http_res
|
|
2160
|
+
)
|
|
2161
|
+
raise errors.NotFound(response_data, http_res)
|
|
2162
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
2163
|
+
response_data = unmarshal_json_response(
|
|
2164
|
+
errors.InternalServerErrorUnion, http_res
|
|
2165
|
+
)
|
|
2166
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2167
|
+
request=req, response=http_res
|
|
2168
|
+
)
|
|
2169
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
2170
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
2171
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2172
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2173
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
2174
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2175
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2176
|
+
|
|
2177
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
2178
|
+
|
|
2179
|
+
def get_reported_financials(
|
|
2180
|
+
self,
|
|
2181
|
+
*,
|
|
2182
|
+
symbol: Optional[str] = None,
|
|
2183
|
+
cik: Optional[str] = None,
|
|
2184
|
+
access_number: Optional[str] = None,
|
|
2185
|
+
freq: Optional[models.ReportingFrequency] = None,
|
|
2186
|
+
from_: Optional[date] = None,
|
|
2187
|
+
to: Optional[date] = None,
|
|
2188
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
2189
|
+
server_url: Optional[str] = None,
|
|
2190
|
+
timeout_ms: Optional[int] = None,
|
|
2191
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
2192
|
+
) -> models.GetReportedFinancialsResponse:
|
|
2193
|
+
r"""Get Reported Financials
|
|
2194
|
+
|
|
2195
|
+
Retrieve as-reported financial data from company filings. At least one of `symbol`, `cik`, or `accessNumber` is required. Optional filters: `freq`, `from`, and `to`.
|
|
2196
|
+
|
|
2197
|
+
At least one of symbol, cik, or accessNumber is required. Multiple identifiers are accepted.
|
|
2198
|
+
|
|
2199
|
+
If set, this operation will use `client_id` from the global security.
|
|
2200
|
+
|
|
2201
|
+
:param symbol: Stock symbol, such as AAPL. Use it to narrow results to one company. Required when both `cik` and `accessNumber` are omitted.
|
|
2202
|
+
:param cik: SEC CIK. Optional when `symbol` or `accessNumber` is provided.
|
|
2203
|
+
:param access_number: SEC access number. Optional when `symbol` or `cik` is provided.
|
|
2204
|
+
:param freq: Optional reporting frequency filter. Use it to limit results to annual or quarterly reports.
|
|
2205
|
+
:param from_: Optional start date in YYYY-MM-DD format. Use it to begin the research window.
|
|
2206
|
+
:param to: Optional end date in YYYY-MM-DD format. Use it to end the research window.
|
|
2207
|
+
:param retries: Override the default retry configuration for this method
|
|
2208
|
+
:param server_url: Override the default server URL for this method
|
|
2209
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
2210
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
2211
|
+
"""
|
|
2212
|
+
base_url = None
|
|
2213
|
+
url_variables = None
|
|
2214
|
+
if timeout_ms is None:
|
|
2215
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
2216
|
+
|
|
2217
|
+
if timeout_ms is None:
|
|
2218
|
+
timeout_ms = 30000
|
|
2219
|
+
|
|
2220
|
+
if server_url is not None:
|
|
2221
|
+
base_url = server_url
|
|
2222
|
+
else:
|
|
2223
|
+
base_url = self._get_url(base_url, url_variables)
|
|
2224
|
+
|
|
2225
|
+
request = models.GetReportedFinancialsRequest(
|
|
2226
|
+
symbol=symbol,
|
|
2227
|
+
cik=cik,
|
|
2228
|
+
access_number=access_number,
|
|
2229
|
+
freq=freq,
|
|
2230
|
+
from_=from_,
|
|
2231
|
+
to=to,
|
|
2232
|
+
)
|
|
2233
|
+
|
|
2234
|
+
req = self._build_request(
|
|
2235
|
+
method="GET",
|
|
2236
|
+
path="/v1/financials/reported",
|
|
2237
|
+
base_url=base_url,
|
|
2238
|
+
url_variables=url_variables,
|
|
2239
|
+
request=request,
|
|
2240
|
+
request_body_required=False,
|
|
2241
|
+
request_has_path_params=False,
|
|
2242
|
+
request_has_query_params=True,
|
|
2243
|
+
user_agent_header="user-agent",
|
|
2244
|
+
accept_header_value="application/json",
|
|
2245
|
+
http_headers=http_headers,
|
|
2246
|
+
security=self.sdk_configuration.security,
|
|
2247
|
+
allow_empty_value=None,
|
|
2248
|
+
allowed_fields=["client_id"],
|
|
2249
|
+
timeout_ms=timeout_ms,
|
|
2250
|
+
)
|
|
2251
|
+
|
|
2252
|
+
if retries == UNSET:
|
|
2253
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
2254
|
+
retries = self.sdk_configuration.retry_config
|
|
2255
|
+
else:
|
|
2256
|
+
retries = utils.RetryConfig(
|
|
2257
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
2258
|
+
)
|
|
2259
|
+
|
|
2260
|
+
retry_config = None
|
|
2261
|
+
if isinstance(retries, utils.RetryConfig):
|
|
2262
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
2263
|
+
|
|
2264
|
+
http_res = self.do_request(
|
|
2265
|
+
hook_ctx=HookContext(
|
|
2266
|
+
config=self.sdk_configuration,
|
|
2267
|
+
base_url=base_url or "",
|
|
2268
|
+
operation_id="getReportedFinancials",
|
|
2269
|
+
oauth2_scopes=["market:supplemental"],
|
|
2270
|
+
security_source=self.sdk_configuration.security,
|
|
2271
|
+
tags=["Financials"],
|
|
2272
|
+
extensions=None,
|
|
2273
|
+
),
|
|
2274
|
+
request=req,
|
|
2275
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
2276
|
+
retry_config=retry_config,
|
|
2277
|
+
)
|
|
2278
|
+
|
|
2279
|
+
response_data: Any = None
|
|
2280
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
2281
|
+
return models.GetReportedFinancialsResponse(
|
|
2282
|
+
financials_reported_response=unmarshal_json_response(
|
|
2283
|
+
Optional[models.FinancialsReportedResponse], http_res
|
|
2284
|
+
),
|
|
2285
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
2286
|
+
)
|
|
2287
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
2288
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
2289
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2290
|
+
request=req, response=http_res
|
|
2291
|
+
)
|
|
2292
|
+
raise errors.BadRequest(response_data, http_res)
|
|
2293
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
2294
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
2295
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2296
|
+
request=req, response=http_res
|
|
2297
|
+
)
|
|
2298
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
2299
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
2300
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
2301
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2302
|
+
request=req, response=http_res
|
|
2303
|
+
)
|
|
2304
|
+
raise errors.Forbidden(response_data, http_res)
|
|
2305
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
2306
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
2307
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2308
|
+
request=req, response=http_res
|
|
2309
|
+
)
|
|
2310
|
+
raise errors.NotFound(response_data, http_res)
|
|
2311
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
2312
|
+
response_data = unmarshal_json_response(
|
|
2313
|
+
errors.InternalServerErrorUnion, http_res
|
|
2314
|
+
)
|
|
2315
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2316
|
+
request=req, response=http_res
|
|
2317
|
+
)
|
|
2318
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
2319
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
2320
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
2321
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2322
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
2323
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
2324
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2325
|
+
|
|
2326
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
2327
|
+
|
|
2328
|
+
async def get_reported_financials_async(
|
|
2329
|
+
self,
|
|
2330
|
+
*,
|
|
2331
|
+
symbol: Optional[str] = None,
|
|
2332
|
+
cik: Optional[str] = None,
|
|
2333
|
+
access_number: Optional[str] = None,
|
|
2334
|
+
freq: Optional[models.ReportingFrequency] = None,
|
|
2335
|
+
from_: Optional[date] = None,
|
|
2336
|
+
to: Optional[date] = None,
|
|
2337
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
2338
|
+
server_url: Optional[str] = None,
|
|
2339
|
+
timeout_ms: Optional[int] = None,
|
|
2340
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
2341
|
+
) -> models.GetReportedFinancialsResponse:
|
|
2342
|
+
r"""Get Reported Financials
|
|
2343
|
+
|
|
2344
|
+
Retrieve as-reported financial data from company filings. At least one of `symbol`, `cik`, or `accessNumber` is required. Optional filters: `freq`, `from`, and `to`.
|
|
2345
|
+
|
|
2346
|
+
At least one of symbol, cik, or accessNumber is required. Multiple identifiers are accepted.
|
|
2347
|
+
|
|
2348
|
+
If set, this operation will use `client_id` from the global security.
|
|
2349
|
+
|
|
2350
|
+
:param symbol: Stock symbol, such as AAPL. Use it to narrow results to one company. Required when both `cik` and `accessNumber` are omitted.
|
|
2351
|
+
:param cik: SEC CIK. Optional when `symbol` or `accessNumber` is provided.
|
|
2352
|
+
:param access_number: SEC access number. Optional when `symbol` or `cik` is provided.
|
|
2353
|
+
:param freq: Optional reporting frequency filter. Use it to limit results to annual or quarterly reports.
|
|
2354
|
+
:param from_: Optional start date in YYYY-MM-DD format. Use it to begin the research window.
|
|
2355
|
+
:param to: Optional end date in YYYY-MM-DD format. Use it to end the research window.
|
|
2356
|
+
:param retries: Override the default retry configuration for this method
|
|
2357
|
+
:param server_url: Override the default server URL for this method
|
|
2358
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
2359
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
2360
|
+
"""
|
|
2361
|
+
base_url = None
|
|
2362
|
+
url_variables = None
|
|
2363
|
+
if timeout_ms is None:
|
|
2364
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
2365
|
+
|
|
2366
|
+
if timeout_ms is None:
|
|
2367
|
+
timeout_ms = 30000
|
|
2368
|
+
|
|
2369
|
+
if server_url is not None:
|
|
2370
|
+
base_url = server_url
|
|
2371
|
+
else:
|
|
2372
|
+
base_url = self._get_url(base_url, url_variables)
|
|
2373
|
+
|
|
2374
|
+
request = models.GetReportedFinancialsRequest(
|
|
2375
|
+
symbol=symbol,
|
|
2376
|
+
cik=cik,
|
|
2377
|
+
access_number=access_number,
|
|
2378
|
+
freq=freq,
|
|
2379
|
+
from_=from_,
|
|
2380
|
+
to=to,
|
|
2381
|
+
)
|
|
2382
|
+
|
|
2383
|
+
req = self._build_request_async(
|
|
2384
|
+
method="GET",
|
|
2385
|
+
path="/v1/financials/reported",
|
|
2386
|
+
base_url=base_url,
|
|
2387
|
+
url_variables=url_variables,
|
|
2388
|
+
request=request,
|
|
2389
|
+
request_body_required=False,
|
|
2390
|
+
request_has_path_params=False,
|
|
2391
|
+
request_has_query_params=True,
|
|
2392
|
+
user_agent_header="user-agent",
|
|
2393
|
+
accept_header_value="application/json",
|
|
2394
|
+
http_headers=http_headers,
|
|
2395
|
+
security=self.sdk_configuration.security,
|
|
2396
|
+
allow_empty_value=None,
|
|
2397
|
+
allowed_fields=["client_id"],
|
|
2398
|
+
timeout_ms=timeout_ms,
|
|
2399
|
+
)
|
|
2400
|
+
|
|
2401
|
+
if retries == UNSET:
|
|
2402
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
2403
|
+
retries = self.sdk_configuration.retry_config
|
|
2404
|
+
else:
|
|
2405
|
+
retries = utils.RetryConfig(
|
|
2406
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
2407
|
+
)
|
|
2408
|
+
|
|
2409
|
+
retry_config = None
|
|
2410
|
+
if isinstance(retries, utils.RetryConfig):
|
|
2411
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
2412
|
+
|
|
2413
|
+
http_res = await self.do_request_async(
|
|
2414
|
+
hook_ctx=HookContext(
|
|
2415
|
+
config=self.sdk_configuration,
|
|
2416
|
+
base_url=base_url or "",
|
|
2417
|
+
operation_id="getReportedFinancials",
|
|
2418
|
+
oauth2_scopes=["market:supplemental"],
|
|
2419
|
+
security_source=self.sdk_configuration.security,
|
|
2420
|
+
tags=["Financials"],
|
|
2421
|
+
extensions=None,
|
|
2422
|
+
),
|
|
2423
|
+
request=req,
|
|
2424
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
2425
|
+
retry_config=retry_config,
|
|
2426
|
+
)
|
|
2427
|
+
|
|
2428
|
+
response_data: Any = None
|
|
2429
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
2430
|
+
return models.GetReportedFinancialsResponse(
|
|
2431
|
+
financials_reported_response=unmarshal_json_response(
|
|
2432
|
+
Optional[models.FinancialsReportedResponse], http_res
|
|
2433
|
+
),
|
|
2434
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
2435
|
+
)
|
|
2436
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
2437
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
2438
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2439
|
+
request=req, response=http_res
|
|
2440
|
+
)
|
|
2441
|
+
raise errors.BadRequest(response_data, http_res)
|
|
2442
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
2443
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
2444
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2445
|
+
request=req, response=http_res
|
|
2446
|
+
)
|
|
2447
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
2448
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
2449
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
2450
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2451
|
+
request=req, response=http_res
|
|
2452
|
+
)
|
|
2453
|
+
raise errors.Forbidden(response_data, http_res)
|
|
2454
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
2455
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
2456
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2457
|
+
request=req, response=http_res
|
|
2458
|
+
)
|
|
2459
|
+
raise errors.NotFound(response_data, http_res)
|
|
2460
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
2461
|
+
response_data = unmarshal_json_response(
|
|
2462
|
+
errors.InternalServerErrorUnion, http_res
|
|
2463
|
+
)
|
|
2464
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2465
|
+
request=req, response=http_res
|
|
2466
|
+
)
|
|
2467
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
2468
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
2469
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2470
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2471
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
2472
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2473
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2474
|
+
|
|
2475
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
2476
|
+
|
|
2477
|
+
def get_revenue_breakdown(
|
|
2478
|
+
self,
|
|
2479
|
+
*,
|
|
2480
|
+
symbol: Optional[str] = None,
|
|
2481
|
+
cik: Optional[str] = None,
|
|
2482
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
2483
|
+
server_url: Optional[str] = None,
|
|
2484
|
+
timeout_ms: Optional[int] = None,
|
|
2485
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
2486
|
+
) -> models.GetRevenueBreakdownResponse:
|
|
2487
|
+
r"""Get Revenue Breakdown
|
|
2488
|
+
|
|
2489
|
+
Retrieve revenue segmentation by product, geography, or business unit. Provide at least one of `symbol` or `cik`.
|
|
2490
|
+
|
|
2491
|
+
At least one of symbol or cik is required; both are accepted.
|
|
2492
|
+
|
|
2493
|
+
If set, this operation will use `client_id` from the global security.
|
|
2494
|
+
|
|
2495
|
+
:param symbol: Stock ticker symbol to research, such as AAPL. Required when `cik` is omitted.
|
|
2496
|
+
:param cik: SEC CIK. Optional when `symbol` is provided.
|
|
2497
|
+
:param retries: Override the default retry configuration for this method
|
|
2498
|
+
:param server_url: Override the default server URL for this method
|
|
2499
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
2500
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
2501
|
+
"""
|
|
2502
|
+
base_url = None
|
|
2503
|
+
url_variables = None
|
|
2504
|
+
if timeout_ms is None:
|
|
2505
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
2506
|
+
|
|
2507
|
+
if timeout_ms is None:
|
|
2508
|
+
timeout_ms = 30000
|
|
2509
|
+
|
|
2510
|
+
if server_url is not None:
|
|
2511
|
+
base_url = server_url
|
|
2512
|
+
else:
|
|
2513
|
+
base_url = self._get_url(base_url, url_variables)
|
|
2514
|
+
|
|
2515
|
+
request = models.GetRevenueBreakdownRequest(
|
|
2516
|
+
symbol=symbol,
|
|
2517
|
+
cik=cik,
|
|
2518
|
+
)
|
|
2519
|
+
|
|
2520
|
+
req = self._build_request(
|
|
2521
|
+
method="GET",
|
|
2522
|
+
path="/v1/financials/revenue-breakdown",
|
|
2523
|
+
base_url=base_url,
|
|
2524
|
+
url_variables=url_variables,
|
|
2525
|
+
request=request,
|
|
2526
|
+
request_body_required=False,
|
|
2527
|
+
request_has_path_params=False,
|
|
2528
|
+
request_has_query_params=True,
|
|
2529
|
+
user_agent_header="user-agent",
|
|
2530
|
+
accept_header_value="application/json",
|
|
2531
|
+
http_headers=http_headers,
|
|
2532
|
+
security=self.sdk_configuration.security,
|
|
2533
|
+
allow_empty_value=None,
|
|
2534
|
+
allowed_fields=["client_id"],
|
|
2535
|
+
timeout_ms=timeout_ms,
|
|
2536
|
+
)
|
|
2537
|
+
|
|
2538
|
+
if retries == UNSET:
|
|
2539
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
2540
|
+
retries = self.sdk_configuration.retry_config
|
|
2541
|
+
else:
|
|
2542
|
+
retries = utils.RetryConfig(
|
|
2543
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
2544
|
+
)
|
|
2545
|
+
|
|
2546
|
+
retry_config = None
|
|
2547
|
+
if isinstance(retries, utils.RetryConfig):
|
|
2548
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
2549
|
+
|
|
2550
|
+
http_res = self.do_request(
|
|
2551
|
+
hook_ctx=HookContext(
|
|
2552
|
+
config=self.sdk_configuration,
|
|
2553
|
+
base_url=base_url or "",
|
|
2554
|
+
operation_id="getRevenueBreakdown",
|
|
2555
|
+
oauth2_scopes=["market:supplemental"],
|
|
2556
|
+
security_source=self.sdk_configuration.security,
|
|
2557
|
+
tags=["Financials"],
|
|
2558
|
+
extensions=None,
|
|
2559
|
+
),
|
|
2560
|
+
request=req,
|
|
2561
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
2562
|
+
retry_config=retry_config,
|
|
2563
|
+
)
|
|
2564
|
+
|
|
2565
|
+
response_data: Any = None
|
|
2566
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
2567
|
+
return models.GetRevenueBreakdownResponse(
|
|
2568
|
+
financials_revenue_breakdown_response=unmarshal_json_response(
|
|
2569
|
+
Optional[models.FinancialsRevenueBreakdownResponse], http_res
|
|
2570
|
+
),
|
|
2571
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
2572
|
+
)
|
|
2573
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
2574
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
2575
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2576
|
+
request=req, response=http_res
|
|
2577
|
+
)
|
|
2578
|
+
raise errors.BadRequest(response_data, http_res)
|
|
2579
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
2580
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
2581
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2582
|
+
request=req, response=http_res
|
|
2583
|
+
)
|
|
2584
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
2585
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
2586
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
2587
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2588
|
+
request=req, response=http_res
|
|
2589
|
+
)
|
|
2590
|
+
raise errors.Forbidden(response_data, http_res)
|
|
2591
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
2592
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
2593
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2594
|
+
request=req, response=http_res
|
|
2595
|
+
)
|
|
2596
|
+
raise errors.NotFound(response_data, http_res)
|
|
2597
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
2598
|
+
response_data = unmarshal_json_response(
|
|
2599
|
+
errors.InternalServerErrorUnion, http_res
|
|
2600
|
+
)
|
|
2601
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2602
|
+
request=req, response=http_res
|
|
2603
|
+
)
|
|
2604
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
2605
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
2606
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
2607
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2608
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
2609
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
2610
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2611
|
+
|
|
2612
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
2613
|
+
|
|
2614
|
+
async def get_revenue_breakdown_async(
|
|
2615
|
+
self,
|
|
2616
|
+
*,
|
|
2617
|
+
symbol: Optional[str] = None,
|
|
2618
|
+
cik: Optional[str] = None,
|
|
2619
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
2620
|
+
server_url: Optional[str] = None,
|
|
2621
|
+
timeout_ms: Optional[int] = None,
|
|
2622
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
2623
|
+
) -> models.GetRevenueBreakdownResponse:
|
|
2624
|
+
r"""Get Revenue Breakdown
|
|
2625
|
+
|
|
2626
|
+
Retrieve revenue segmentation by product, geography, or business unit. Provide at least one of `symbol` or `cik`.
|
|
2627
|
+
|
|
2628
|
+
At least one of symbol or cik is required; both are accepted.
|
|
2629
|
+
|
|
2630
|
+
If set, this operation will use `client_id` from the global security.
|
|
2631
|
+
|
|
2632
|
+
:param symbol: Stock ticker symbol to research, such as AAPL. Required when `cik` is omitted.
|
|
2633
|
+
:param cik: SEC CIK. Optional when `symbol` is provided.
|
|
2634
|
+
:param retries: Override the default retry configuration for this method
|
|
2635
|
+
:param server_url: Override the default server URL for this method
|
|
2636
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
2637
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
2638
|
+
"""
|
|
2639
|
+
base_url = None
|
|
2640
|
+
url_variables = None
|
|
2641
|
+
if timeout_ms is None:
|
|
2642
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
2643
|
+
|
|
2644
|
+
if timeout_ms is None:
|
|
2645
|
+
timeout_ms = 30000
|
|
2646
|
+
|
|
2647
|
+
if server_url is not None:
|
|
2648
|
+
base_url = server_url
|
|
2649
|
+
else:
|
|
2650
|
+
base_url = self._get_url(base_url, url_variables)
|
|
2651
|
+
|
|
2652
|
+
request = models.GetRevenueBreakdownRequest(
|
|
2653
|
+
symbol=symbol,
|
|
2654
|
+
cik=cik,
|
|
2655
|
+
)
|
|
2656
|
+
|
|
2657
|
+
req = self._build_request_async(
|
|
2658
|
+
method="GET",
|
|
2659
|
+
path="/v1/financials/revenue-breakdown",
|
|
2660
|
+
base_url=base_url,
|
|
2661
|
+
url_variables=url_variables,
|
|
2662
|
+
request=request,
|
|
2663
|
+
request_body_required=False,
|
|
2664
|
+
request_has_path_params=False,
|
|
2665
|
+
request_has_query_params=True,
|
|
2666
|
+
user_agent_header="user-agent",
|
|
2667
|
+
accept_header_value="application/json",
|
|
2668
|
+
http_headers=http_headers,
|
|
2669
|
+
security=self.sdk_configuration.security,
|
|
2670
|
+
allow_empty_value=None,
|
|
2671
|
+
allowed_fields=["client_id"],
|
|
2672
|
+
timeout_ms=timeout_ms,
|
|
2673
|
+
)
|
|
2674
|
+
|
|
2675
|
+
if retries == UNSET:
|
|
2676
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
2677
|
+
retries = self.sdk_configuration.retry_config
|
|
2678
|
+
else:
|
|
2679
|
+
retries = utils.RetryConfig(
|
|
2680
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
2681
|
+
)
|
|
2682
|
+
|
|
2683
|
+
retry_config = None
|
|
2684
|
+
if isinstance(retries, utils.RetryConfig):
|
|
2685
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
2686
|
+
|
|
2687
|
+
http_res = await self.do_request_async(
|
|
2688
|
+
hook_ctx=HookContext(
|
|
2689
|
+
config=self.sdk_configuration,
|
|
2690
|
+
base_url=base_url or "",
|
|
2691
|
+
operation_id="getRevenueBreakdown",
|
|
2692
|
+
oauth2_scopes=["market:supplemental"],
|
|
2693
|
+
security_source=self.sdk_configuration.security,
|
|
2694
|
+
tags=["Financials"],
|
|
2695
|
+
extensions=None,
|
|
2696
|
+
),
|
|
2697
|
+
request=req,
|
|
2698
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
2699
|
+
retry_config=retry_config,
|
|
2700
|
+
)
|
|
2701
|
+
|
|
2702
|
+
response_data: Any = None
|
|
2703
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
2704
|
+
return models.GetRevenueBreakdownResponse(
|
|
2705
|
+
financials_revenue_breakdown_response=unmarshal_json_response(
|
|
2706
|
+
Optional[models.FinancialsRevenueBreakdownResponse], http_res
|
|
2707
|
+
),
|
|
2708
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
2709
|
+
)
|
|
2710
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
2711
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
2712
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2713
|
+
request=req, response=http_res
|
|
2714
|
+
)
|
|
2715
|
+
raise errors.BadRequest(response_data, http_res)
|
|
2716
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
2717
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
2718
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2719
|
+
request=req, response=http_res
|
|
2720
|
+
)
|
|
2721
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
2722
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
2723
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
2724
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2725
|
+
request=req, response=http_res
|
|
2726
|
+
)
|
|
2727
|
+
raise errors.Forbidden(response_data, http_res)
|
|
2728
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
2729
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
2730
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2731
|
+
request=req, response=http_res
|
|
2732
|
+
)
|
|
2733
|
+
raise errors.NotFound(response_data, http_res)
|
|
2734
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
2735
|
+
response_data = unmarshal_json_response(
|
|
2736
|
+
errors.InternalServerErrorUnion, http_res
|
|
2737
|
+
)
|
|
2738
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2739
|
+
request=req, response=http_res
|
|
2740
|
+
)
|
|
2741
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
2742
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
2743
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2744
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2745
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
2746
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2747
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2748
|
+
|
|
2749
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
2750
|
+
|
|
2751
|
+
def get_short_interest(
|
|
2752
|
+
self,
|
|
2753
|
+
*,
|
|
2754
|
+
ticker: Optional[str] = None,
|
|
2755
|
+
tickers_any_of: Optional[str] = None,
|
|
2756
|
+
ticker_after: Optional[str] = None,
|
|
2757
|
+
ticker_from: Optional[str] = None,
|
|
2758
|
+
ticker_before: Optional[str] = None,
|
|
2759
|
+
ticker_to: Optional[str] = None,
|
|
2760
|
+
days_to_cover: Optional[float] = None,
|
|
2761
|
+
days_to_cover_list: Optional[str] = None,
|
|
2762
|
+
days_to_cover_above: Optional[float] = None,
|
|
2763
|
+
days_to_cover_min: Optional[float] = None,
|
|
2764
|
+
days_to_cover_below: Optional[float] = None,
|
|
2765
|
+
days_to_cover_max: Optional[float] = None,
|
|
2766
|
+
settlement_date: Optional[date] = None,
|
|
2767
|
+
settlement_dates: Optional[str] = None,
|
|
2768
|
+
settlement_date_after: Optional[date] = None,
|
|
2769
|
+
settlement_date_from: Optional[date] = None,
|
|
2770
|
+
settlement_date_before: Optional[date] = None,
|
|
2771
|
+
settlement_date_to: Optional[date] = None,
|
|
2772
|
+
avg_daily_volume: Optional[int] = None,
|
|
2773
|
+
avg_daily_volume_list: Optional[str] = None,
|
|
2774
|
+
avg_daily_volume_above: Optional[int] = None,
|
|
2775
|
+
avg_daily_volume_min: Optional[int] = None,
|
|
2776
|
+
avg_daily_volume_below: Optional[int] = None,
|
|
2777
|
+
avg_daily_volume_max: Optional[int] = None,
|
|
2778
|
+
limit: Optional[int] = None,
|
|
2779
|
+
sort: Optional[str] = None,
|
|
2780
|
+
next: Optional[str] = None,
|
|
2781
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
2782
|
+
server_url: Optional[str] = None,
|
|
2783
|
+
url_override: Optional[str] = None,
|
|
2784
|
+
timeout_ms: Optional[int] = None,
|
|
2785
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
2786
|
+
) -> Optional[models.GetShortInterestResponse]:
|
|
2787
|
+
r"""Get Short Interest Data
|
|
2788
|
+
|
|
2789
|
+
Retrieve short interest statistics including short volume, short ratio, and days to cover for assessing bearish sentiment. `ticker` accepts a single symbol only. Use `tickersAnyOf` for multiple symbols. If `ticker` contains multiple comma-separated values, the API returns 400: \"Multiple tickers are not supported. Please provide a single ticker.\" If both `ticker` and `tickersAnyOf` are set, the API returns 400: \"Cannot specify both ticker and tickersAnyOf. Use ticker for a single symbol or tickersAnyOf for multiple.\"
|
|
2790
|
+
|
|
2791
|
+
If set, this operation will use `client_id` from the global security.
|
|
2792
|
+
|
|
2793
|
+
:param ticker: Single ticker symbol filter. Enter one ticker such as AAPL to narrow results to one company.
|
|
2794
|
+
:param tickers_any_of: Comma-separated list of ticker symbols.
|
|
2795
|
+
:param ticker_after: Ticker pagination lower bound. Returns symbols alphabetically after this ticker, excluding the ticker itself.
|
|
2796
|
+
:param ticker_from: Ticker greater than or equal (inclusive)
|
|
2797
|
+
:param ticker_before: Ticker pagination upper bound. Returns symbols alphabetically before this ticker, excluding the ticker itself.
|
|
2798
|
+
:param ticker_to: Ticker less than or equal (inclusive)
|
|
2799
|
+
:param days_to_cover: Exact days-to-cover filter for short interest. Use it when screening for one short-squeeze risk value.
|
|
2800
|
+
:param days_to_cover_list: Comma-separated list of days to cover
|
|
2801
|
+
:param days_to_cover_above: Days to cover greater than (exclusive)
|
|
2802
|
+
:param days_to_cover_min: Days to cover greater than or equal (inclusive)
|
|
2803
|
+
:param days_to_cover_below: Days to cover less than (exclusive)
|
|
2804
|
+
:param days_to_cover_max: Days to cover less than or equal (inclusive)
|
|
2805
|
+
:param settlement_date: Settlement date in YYYY-MM-DD format. Use it to filter short-interest records by reporting settlement date.
|
|
2806
|
+
:param settlement_dates: Comma-separated list of settlement dates
|
|
2807
|
+
:param settlement_date_after: Settlement-date lower-bound filter. Returns records after this date, excluding the date itself.
|
|
2808
|
+
:param settlement_date_from: Settlement-date start filter. Returns records on or after this date.
|
|
2809
|
+
:param settlement_date_before: Settlement-date upper-bound filter. Returns records before this date, excluding the date itself.
|
|
2810
|
+
:param settlement_date_to: Settlement-date end filter. Returns records on or before this date.
|
|
2811
|
+
:param avg_daily_volume: Exact average-daily-volume filter. Use it when screening for one specific liquidity value.
|
|
2812
|
+
:param avg_daily_volume_list: Comma-separated list of average daily volumes
|
|
2813
|
+
:param avg_daily_volume_above: Average daily volume greater than (exclusive)
|
|
2814
|
+
:param avg_daily_volume_min: Average daily volume greater than or equal (inclusive)
|
|
2815
|
+
:param avg_daily_volume_below: Average daily volume less than (exclusive)
|
|
2816
|
+
:param avg_daily_volume_max: Average daily volume less than or equal (inclusive)
|
|
2817
|
+
:param limit: Maximum number of results to return. Use smaller values for UI pages and larger values for exports within API limits.
|
|
2818
|
+
:param sort: A comma-separated list of sort columns. For each column, append `.asc` or `.desc` to specify direction. Defaults to `ticker.asc` when not specified.
|
|
2819
|
+
:param next: Pagination cursor from the previous response. Omit it on the first request, then send the returned cursor to fetch the next page.
|
|
2820
|
+
:param retries: Override the default retry configuration for this method
|
|
2821
|
+
:param server_url: Override the default server URL for this method
|
|
2822
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
2823
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
2824
|
+
"""
|
|
2825
|
+
base_url = None
|
|
2826
|
+
url_variables = None
|
|
2827
|
+
if timeout_ms is None:
|
|
2828
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
2829
|
+
|
|
2830
|
+
if timeout_ms is None:
|
|
2831
|
+
timeout_ms = 30000
|
|
2832
|
+
|
|
2833
|
+
if server_url is not None:
|
|
2834
|
+
base_url = server_url
|
|
2835
|
+
else:
|
|
2836
|
+
base_url = self._get_url(base_url, url_variables)
|
|
2837
|
+
|
|
2838
|
+
request = models.GetShortInterestRequest(
|
|
2839
|
+
ticker=ticker,
|
|
2840
|
+
tickers_any_of=tickers_any_of,
|
|
2841
|
+
ticker_after=ticker_after,
|
|
2842
|
+
ticker_from=ticker_from,
|
|
2843
|
+
ticker_before=ticker_before,
|
|
2844
|
+
ticker_to=ticker_to,
|
|
2845
|
+
days_to_cover=days_to_cover,
|
|
2846
|
+
days_to_cover_list=days_to_cover_list,
|
|
2847
|
+
days_to_cover_above=days_to_cover_above,
|
|
2848
|
+
days_to_cover_min=days_to_cover_min,
|
|
2849
|
+
days_to_cover_below=days_to_cover_below,
|
|
2850
|
+
days_to_cover_max=days_to_cover_max,
|
|
2851
|
+
settlement_date=settlement_date,
|
|
2852
|
+
settlement_dates=settlement_dates,
|
|
2853
|
+
settlement_date_after=settlement_date_after,
|
|
2854
|
+
settlement_date_from=settlement_date_from,
|
|
2855
|
+
settlement_date_before=settlement_date_before,
|
|
2856
|
+
settlement_date_to=settlement_date_to,
|
|
2857
|
+
avg_daily_volume=avg_daily_volume,
|
|
2858
|
+
avg_daily_volume_list=avg_daily_volume_list,
|
|
2859
|
+
avg_daily_volume_above=avg_daily_volume_above,
|
|
2860
|
+
avg_daily_volume_min=avg_daily_volume_min,
|
|
2861
|
+
avg_daily_volume_below=avg_daily_volume_below,
|
|
2862
|
+
avg_daily_volume_max=avg_daily_volume_max,
|
|
2863
|
+
limit=limit,
|
|
2864
|
+
sort=sort,
|
|
2865
|
+
next=next,
|
|
2866
|
+
)
|
|
2867
|
+
|
|
2868
|
+
req = self._build_request(
|
|
2869
|
+
method="GET",
|
|
2870
|
+
path="/v1/financials/short-interest",
|
|
2871
|
+
base_url=base_url,
|
|
2872
|
+
url_variables=url_variables,
|
|
2873
|
+
url_override=url_override,
|
|
2874
|
+
request=request,
|
|
2875
|
+
request_body_required=False,
|
|
2876
|
+
request_has_path_params=False,
|
|
2877
|
+
request_has_query_params=True,
|
|
2878
|
+
user_agent_header="user-agent",
|
|
2879
|
+
accept_header_value="application/json",
|
|
2880
|
+
http_headers=http_headers,
|
|
2881
|
+
security=self.sdk_configuration.security,
|
|
2882
|
+
allow_empty_value=None,
|
|
2883
|
+
allowed_fields=["client_id"],
|
|
2884
|
+
timeout_ms=timeout_ms,
|
|
2885
|
+
)
|
|
2886
|
+
|
|
2887
|
+
if retries == UNSET:
|
|
2888
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
2889
|
+
retries = self.sdk_configuration.retry_config
|
|
2890
|
+
else:
|
|
2891
|
+
retries = utils.RetryConfig(
|
|
2892
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
2893
|
+
)
|
|
2894
|
+
|
|
2895
|
+
retry_config = None
|
|
2896
|
+
if isinstance(retries, utils.RetryConfig):
|
|
2897
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
2898
|
+
|
|
2899
|
+
http_res = self.do_request(
|
|
2900
|
+
hook_ctx=HookContext(
|
|
2901
|
+
config=self.sdk_configuration,
|
|
2902
|
+
base_url=base_url or "",
|
|
2903
|
+
operation_id="getShortInterest",
|
|
2904
|
+
oauth2_scopes=["market:supplemental"],
|
|
2905
|
+
security_source=self.sdk_configuration.security,
|
|
2906
|
+
tags=["Financials"],
|
|
2907
|
+
extensions=None,
|
|
2908
|
+
),
|
|
2909
|
+
request=req,
|
|
2910
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
2911
|
+
retry_config=retry_config,
|
|
2912
|
+
)
|
|
2913
|
+
|
|
2914
|
+
def next_func() -> Optional[models.GetShortInterestResponse]:
|
|
2915
|
+
body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]])
|
|
2916
|
+
next_url_match = JSONPath("$.nextUrl").parse(body)
|
|
2917
|
+
if len(next_url_match) == 0:
|
|
2918
|
+
return None
|
|
2919
|
+
|
|
2920
|
+
next_url = next_url_match[0]
|
|
2921
|
+
if not next_url:
|
|
2922
|
+
return None
|
|
2923
|
+
|
|
2924
|
+
if next_url[0] == "/":
|
|
2925
|
+
url = self._get_url(base_url, url_variables)
|
|
2926
|
+
next_url = url + next_url
|
|
2927
|
+
|
|
2928
|
+
return self.get_short_interest(
|
|
2929
|
+
ticker=ticker,
|
|
2930
|
+
tickers_any_of=tickers_any_of,
|
|
2931
|
+
ticker_after=ticker_after,
|
|
2932
|
+
ticker_from=ticker_from,
|
|
2933
|
+
ticker_before=ticker_before,
|
|
2934
|
+
ticker_to=ticker_to,
|
|
2935
|
+
days_to_cover=days_to_cover,
|
|
2936
|
+
days_to_cover_list=days_to_cover_list,
|
|
2937
|
+
days_to_cover_above=days_to_cover_above,
|
|
2938
|
+
days_to_cover_min=days_to_cover_min,
|
|
2939
|
+
days_to_cover_below=days_to_cover_below,
|
|
2940
|
+
days_to_cover_max=days_to_cover_max,
|
|
2941
|
+
settlement_date=settlement_date,
|
|
2942
|
+
settlement_dates=settlement_dates,
|
|
2943
|
+
settlement_date_after=settlement_date_after,
|
|
2944
|
+
settlement_date_from=settlement_date_from,
|
|
2945
|
+
settlement_date_before=settlement_date_before,
|
|
2946
|
+
settlement_date_to=settlement_date_to,
|
|
2947
|
+
avg_daily_volume=avg_daily_volume,
|
|
2948
|
+
avg_daily_volume_list=avg_daily_volume_list,
|
|
2949
|
+
avg_daily_volume_above=avg_daily_volume_above,
|
|
2950
|
+
avg_daily_volume_min=avg_daily_volume_min,
|
|
2951
|
+
avg_daily_volume_below=avg_daily_volume_below,
|
|
2952
|
+
avg_daily_volume_max=avg_daily_volume_max,
|
|
2953
|
+
limit=limit,
|
|
2954
|
+
sort=sort,
|
|
2955
|
+
next=next,
|
|
2956
|
+
retries=retries,
|
|
2957
|
+
server_url=server_url,
|
|
2958
|
+
timeout_ms=timeout_ms,
|
|
2959
|
+
http_headers=http_headers,
|
|
2960
|
+
url_override=next_url,
|
|
2961
|
+
)
|
|
2962
|
+
|
|
2963
|
+
response_data: Any = None
|
|
2964
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
2965
|
+
return models.GetShortInterestResponse(
|
|
2966
|
+
short_interest_response=unmarshal_json_response(
|
|
2967
|
+
Optional[models.ShortInterestResponse], http_res
|
|
2968
|
+
),
|
|
2969
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
2970
|
+
next=next_func,
|
|
2971
|
+
)
|
|
2972
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
2973
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
2974
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2975
|
+
request=req, response=http_res
|
|
2976
|
+
)
|
|
2977
|
+
raise errors.BadRequest(response_data, http_res)
|
|
2978
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
2979
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
2980
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2981
|
+
request=req, response=http_res
|
|
2982
|
+
)
|
|
2983
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
2984
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
2985
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
2986
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2987
|
+
request=req, response=http_res
|
|
2988
|
+
)
|
|
2989
|
+
raise errors.Forbidden(response_data, http_res)
|
|
2990
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
2991
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
2992
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2993
|
+
request=req, response=http_res
|
|
2994
|
+
)
|
|
2995
|
+
raise errors.NotFound(response_data, http_res)
|
|
2996
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
2997
|
+
response_data = unmarshal_json_response(
|
|
2998
|
+
errors.InternalServerErrorUnion, http_res
|
|
2999
|
+
)
|
|
3000
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3001
|
+
request=req, response=http_res
|
|
3002
|
+
)
|
|
3003
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
3004
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
3005
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
3006
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
3007
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
3008
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
3009
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
3010
|
+
|
|
3011
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
3012
|
+
|
|
3013
|
+
async def get_short_interest_async(
|
|
3014
|
+
self,
|
|
3015
|
+
*,
|
|
3016
|
+
ticker: Optional[str] = None,
|
|
3017
|
+
tickers_any_of: Optional[str] = None,
|
|
3018
|
+
ticker_after: Optional[str] = None,
|
|
3019
|
+
ticker_from: Optional[str] = None,
|
|
3020
|
+
ticker_before: Optional[str] = None,
|
|
3021
|
+
ticker_to: Optional[str] = None,
|
|
3022
|
+
days_to_cover: Optional[float] = None,
|
|
3023
|
+
days_to_cover_list: Optional[str] = None,
|
|
3024
|
+
days_to_cover_above: Optional[float] = None,
|
|
3025
|
+
days_to_cover_min: Optional[float] = None,
|
|
3026
|
+
days_to_cover_below: Optional[float] = None,
|
|
3027
|
+
days_to_cover_max: Optional[float] = None,
|
|
3028
|
+
settlement_date: Optional[date] = None,
|
|
3029
|
+
settlement_dates: Optional[str] = None,
|
|
3030
|
+
settlement_date_after: Optional[date] = None,
|
|
3031
|
+
settlement_date_from: Optional[date] = None,
|
|
3032
|
+
settlement_date_before: Optional[date] = None,
|
|
3033
|
+
settlement_date_to: Optional[date] = None,
|
|
3034
|
+
avg_daily_volume: Optional[int] = None,
|
|
3035
|
+
avg_daily_volume_list: Optional[str] = None,
|
|
3036
|
+
avg_daily_volume_above: Optional[int] = None,
|
|
3037
|
+
avg_daily_volume_min: Optional[int] = None,
|
|
3038
|
+
avg_daily_volume_below: Optional[int] = None,
|
|
3039
|
+
avg_daily_volume_max: Optional[int] = None,
|
|
3040
|
+
limit: Optional[int] = None,
|
|
3041
|
+
sort: Optional[str] = None,
|
|
3042
|
+
next: Optional[str] = None,
|
|
3043
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
3044
|
+
server_url: Optional[str] = None,
|
|
3045
|
+
url_override: Optional[str] = None,
|
|
3046
|
+
timeout_ms: Optional[int] = None,
|
|
3047
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
3048
|
+
) -> Optional[models.GetShortInterestResponse]:
|
|
3049
|
+
r"""Get Short Interest Data
|
|
3050
|
+
|
|
3051
|
+
Retrieve short interest statistics including short volume, short ratio, and days to cover for assessing bearish sentiment. `ticker` accepts a single symbol only. Use `tickersAnyOf` for multiple symbols. If `ticker` contains multiple comma-separated values, the API returns 400: \"Multiple tickers are not supported. Please provide a single ticker.\" If both `ticker` and `tickersAnyOf` are set, the API returns 400: \"Cannot specify both ticker and tickersAnyOf. Use ticker for a single symbol or tickersAnyOf for multiple.\"
|
|
3052
|
+
|
|
3053
|
+
If set, this operation will use `client_id` from the global security.
|
|
3054
|
+
|
|
3055
|
+
:param ticker: Single ticker symbol filter. Enter one ticker such as AAPL to narrow results to one company.
|
|
3056
|
+
:param tickers_any_of: Comma-separated list of ticker symbols.
|
|
3057
|
+
:param ticker_after: Ticker pagination lower bound. Returns symbols alphabetically after this ticker, excluding the ticker itself.
|
|
3058
|
+
:param ticker_from: Ticker greater than or equal (inclusive)
|
|
3059
|
+
:param ticker_before: Ticker pagination upper bound. Returns symbols alphabetically before this ticker, excluding the ticker itself.
|
|
3060
|
+
:param ticker_to: Ticker less than or equal (inclusive)
|
|
3061
|
+
:param days_to_cover: Exact days-to-cover filter for short interest. Use it when screening for one short-squeeze risk value.
|
|
3062
|
+
:param days_to_cover_list: Comma-separated list of days to cover
|
|
3063
|
+
:param days_to_cover_above: Days to cover greater than (exclusive)
|
|
3064
|
+
:param days_to_cover_min: Days to cover greater than or equal (inclusive)
|
|
3065
|
+
:param days_to_cover_below: Days to cover less than (exclusive)
|
|
3066
|
+
:param days_to_cover_max: Days to cover less than or equal (inclusive)
|
|
3067
|
+
:param settlement_date: Settlement date in YYYY-MM-DD format. Use it to filter short-interest records by reporting settlement date.
|
|
3068
|
+
:param settlement_dates: Comma-separated list of settlement dates
|
|
3069
|
+
:param settlement_date_after: Settlement-date lower-bound filter. Returns records after this date, excluding the date itself.
|
|
3070
|
+
:param settlement_date_from: Settlement-date start filter. Returns records on or after this date.
|
|
3071
|
+
:param settlement_date_before: Settlement-date upper-bound filter. Returns records before this date, excluding the date itself.
|
|
3072
|
+
:param settlement_date_to: Settlement-date end filter. Returns records on or before this date.
|
|
3073
|
+
:param avg_daily_volume: Exact average-daily-volume filter. Use it when screening for one specific liquidity value.
|
|
3074
|
+
:param avg_daily_volume_list: Comma-separated list of average daily volumes
|
|
3075
|
+
:param avg_daily_volume_above: Average daily volume greater than (exclusive)
|
|
3076
|
+
:param avg_daily_volume_min: Average daily volume greater than or equal (inclusive)
|
|
3077
|
+
:param avg_daily_volume_below: Average daily volume less than (exclusive)
|
|
3078
|
+
:param avg_daily_volume_max: Average daily volume less than or equal (inclusive)
|
|
3079
|
+
:param limit: Maximum number of results to return. Use smaller values for UI pages and larger values for exports within API limits.
|
|
3080
|
+
:param sort: A comma-separated list of sort columns. For each column, append `.asc` or `.desc` to specify direction. Defaults to `ticker.asc` when not specified.
|
|
3081
|
+
:param next: Pagination cursor from the previous response. Omit it on the first request, then send the returned cursor to fetch the next page.
|
|
3082
|
+
:param retries: Override the default retry configuration for this method
|
|
3083
|
+
:param server_url: Override the default server URL for this method
|
|
3084
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
3085
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
3086
|
+
"""
|
|
3087
|
+
base_url = None
|
|
3088
|
+
url_variables = None
|
|
3089
|
+
if timeout_ms is None:
|
|
3090
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
3091
|
+
|
|
3092
|
+
if timeout_ms is None:
|
|
3093
|
+
timeout_ms = 30000
|
|
3094
|
+
|
|
3095
|
+
if server_url is not None:
|
|
3096
|
+
base_url = server_url
|
|
3097
|
+
else:
|
|
3098
|
+
base_url = self._get_url(base_url, url_variables)
|
|
3099
|
+
|
|
3100
|
+
request = models.GetShortInterestRequest(
|
|
3101
|
+
ticker=ticker,
|
|
3102
|
+
tickers_any_of=tickers_any_of,
|
|
3103
|
+
ticker_after=ticker_after,
|
|
3104
|
+
ticker_from=ticker_from,
|
|
3105
|
+
ticker_before=ticker_before,
|
|
3106
|
+
ticker_to=ticker_to,
|
|
3107
|
+
days_to_cover=days_to_cover,
|
|
3108
|
+
days_to_cover_list=days_to_cover_list,
|
|
3109
|
+
days_to_cover_above=days_to_cover_above,
|
|
3110
|
+
days_to_cover_min=days_to_cover_min,
|
|
3111
|
+
days_to_cover_below=days_to_cover_below,
|
|
3112
|
+
days_to_cover_max=days_to_cover_max,
|
|
3113
|
+
settlement_date=settlement_date,
|
|
3114
|
+
settlement_dates=settlement_dates,
|
|
3115
|
+
settlement_date_after=settlement_date_after,
|
|
3116
|
+
settlement_date_from=settlement_date_from,
|
|
3117
|
+
settlement_date_before=settlement_date_before,
|
|
3118
|
+
settlement_date_to=settlement_date_to,
|
|
3119
|
+
avg_daily_volume=avg_daily_volume,
|
|
3120
|
+
avg_daily_volume_list=avg_daily_volume_list,
|
|
3121
|
+
avg_daily_volume_above=avg_daily_volume_above,
|
|
3122
|
+
avg_daily_volume_min=avg_daily_volume_min,
|
|
3123
|
+
avg_daily_volume_below=avg_daily_volume_below,
|
|
3124
|
+
avg_daily_volume_max=avg_daily_volume_max,
|
|
3125
|
+
limit=limit,
|
|
3126
|
+
sort=sort,
|
|
3127
|
+
next=next,
|
|
3128
|
+
)
|
|
3129
|
+
|
|
3130
|
+
req = self._build_request_async(
|
|
3131
|
+
method="GET",
|
|
3132
|
+
path="/v1/financials/short-interest",
|
|
3133
|
+
base_url=base_url,
|
|
3134
|
+
url_variables=url_variables,
|
|
3135
|
+
url_override=url_override,
|
|
3136
|
+
request=request,
|
|
3137
|
+
request_body_required=False,
|
|
3138
|
+
request_has_path_params=False,
|
|
3139
|
+
request_has_query_params=True,
|
|
3140
|
+
user_agent_header="user-agent",
|
|
3141
|
+
accept_header_value="application/json",
|
|
3142
|
+
http_headers=http_headers,
|
|
3143
|
+
security=self.sdk_configuration.security,
|
|
3144
|
+
allow_empty_value=None,
|
|
3145
|
+
allowed_fields=["client_id"],
|
|
3146
|
+
timeout_ms=timeout_ms,
|
|
3147
|
+
)
|
|
3148
|
+
|
|
3149
|
+
if retries == UNSET:
|
|
3150
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
3151
|
+
retries = self.sdk_configuration.retry_config
|
|
3152
|
+
else:
|
|
3153
|
+
retries = utils.RetryConfig(
|
|
3154
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
3155
|
+
)
|
|
3156
|
+
|
|
3157
|
+
retry_config = None
|
|
3158
|
+
if isinstance(retries, utils.RetryConfig):
|
|
3159
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
3160
|
+
|
|
3161
|
+
http_res = await self.do_request_async(
|
|
3162
|
+
hook_ctx=HookContext(
|
|
3163
|
+
config=self.sdk_configuration,
|
|
3164
|
+
base_url=base_url or "",
|
|
3165
|
+
operation_id="getShortInterest",
|
|
3166
|
+
oauth2_scopes=["market:supplemental"],
|
|
3167
|
+
security_source=self.sdk_configuration.security,
|
|
3168
|
+
tags=["Financials"],
|
|
3169
|
+
extensions=None,
|
|
3170
|
+
),
|
|
3171
|
+
request=req,
|
|
3172
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
3173
|
+
retry_config=retry_config,
|
|
3174
|
+
)
|
|
3175
|
+
|
|
3176
|
+
def next_func() -> Optional[models.GetShortInterestResponse]:
|
|
3177
|
+
body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]])
|
|
3178
|
+
next_url_match = JSONPath("$.nextUrl").parse(body)
|
|
3179
|
+
if len(next_url_match) == 0:
|
|
3180
|
+
return None
|
|
3181
|
+
|
|
3182
|
+
next_url = next_url_match[0]
|
|
3183
|
+
if not next_url:
|
|
3184
|
+
return None
|
|
3185
|
+
|
|
3186
|
+
if next_url[0] == "/":
|
|
3187
|
+
url = self._get_url(base_url, url_variables)
|
|
3188
|
+
next_url = url + next_url
|
|
3189
|
+
|
|
3190
|
+
return self.get_short_interest(
|
|
3191
|
+
ticker=ticker,
|
|
3192
|
+
tickers_any_of=tickers_any_of,
|
|
3193
|
+
ticker_after=ticker_after,
|
|
3194
|
+
ticker_from=ticker_from,
|
|
3195
|
+
ticker_before=ticker_before,
|
|
3196
|
+
ticker_to=ticker_to,
|
|
3197
|
+
days_to_cover=days_to_cover,
|
|
3198
|
+
days_to_cover_list=days_to_cover_list,
|
|
3199
|
+
days_to_cover_above=days_to_cover_above,
|
|
3200
|
+
days_to_cover_min=days_to_cover_min,
|
|
3201
|
+
days_to_cover_below=days_to_cover_below,
|
|
3202
|
+
days_to_cover_max=days_to_cover_max,
|
|
3203
|
+
settlement_date=settlement_date,
|
|
3204
|
+
settlement_dates=settlement_dates,
|
|
3205
|
+
settlement_date_after=settlement_date_after,
|
|
3206
|
+
settlement_date_from=settlement_date_from,
|
|
3207
|
+
settlement_date_before=settlement_date_before,
|
|
3208
|
+
settlement_date_to=settlement_date_to,
|
|
3209
|
+
avg_daily_volume=avg_daily_volume,
|
|
3210
|
+
avg_daily_volume_list=avg_daily_volume_list,
|
|
3211
|
+
avg_daily_volume_above=avg_daily_volume_above,
|
|
3212
|
+
avg_daily_volume_min=avg_daily_volume_min,
|
|
3213
|
+
avg_daily_volume_below=avg_daily_volume_below,
|
|
3214
|
+
avg_daily_volume_max=avg_daily_volume_max,
|
|
3215
|
+
limit=limit,
|
|
3216
|
+
sort=sort,
|
|
3217
|
+
next=next,
|
|
3218
|
+
retries=retries,
|
|
3219
|
+
server_url=server_url,
|
|
3220
|
+
timeout_ms=timeout_ms,
|
|
3221
|
+
http_headers=http_headers,
|
|
3222
|
+
url_override=next_url,
|
|
3223
|
+
)
|
|
3224
|
+
|
|
3225
|
+
response_data: Any = None
|
|
3226
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
3227
|
+
return models.GetShortInterestResponse(
|
|
3228
|
+
short_interest_response=unmarshal_json_response(
|
|
3229
|
+
Optional[models.ShortInterestResponse], http_res
|
|
3230
|
+
),
|
|
3231
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
3232
|
+
next=next_func,
|
|
3233
|
+
)
|
|
3234
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
3235
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
3236
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3237
|
+
request=req, response=http_res
|
|
3238
|
+
)
|
|
3239
|
+
raise errors.BadRequest(response_data, http_res)
|
|
3240
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
3241
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
3242
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3243
|
+
request=req, response=http_res
|
|
3244
|
+
)
|
|
3245
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
3246
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
3247
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
3248
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3249
|
+
request=req, response=http_res
|
|
3250
|
+
)
|
|
3251
|
+
raise errors.Forbidden(response_data, http_res)
|
|
3252
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
3253
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
3254
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3255
|
+
request=req, response=http_res
|
|
3256
|
+
)
|
|
3257
|
+
raise errors.NotFound(response_data, http_res)
|
|
3258
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
3259
|
+
response_data = unmarshal_json_response(
|
|
3260
|
+
errors.InternalServerErrorUnion, http_res
|
|
3261
|
+
)
|
|
3262
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3263
|
+
request=req, response=http_res
|
|
3264
|
+
)
|
|
3265
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
3266
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
3267
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
3268
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
3269
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
3270
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
3271
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
3272
|
+
|
|
3273
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
3274
|
+
|
|
3275
|
+
def get_short_volume(
|
|
3276
|
+
self,
|
|
3277
|
+
*,
|
|
3278
|
+
ticker: Optional[str] = None,
|
|
3279
|
+
tickers_any_of: Optional[str] = None,
|
|
3280
|
+
ticker_after: Optional[str] = None,
|
|
3281
|
+
ticker_from: Optional[str] = None,
|
|
3282
|
+
ticker_before: Optional[str] = None,
|
|
3283
|
+
ticker_to: Optional[str] = None,
|
|
3284
|
+
date_: Optional[date] = None,
|
|
3285
|
+
dates: Optional[str] = None,
|
|
3286
|
+
date_after: Optional[date] = None,
|
|
3287
|
+
date_from: Optional[date] = None,
|
|
3288
|
+
date_before: Optional[date] = None,
|
|
3289
|
+
date_to: Optional[date] = None,
|
|
3290
|
+
short_volume_ratio: Optional[float] = None,
|
|
3291
|
+
short_volume_ratio_list: Optional[str] = None,
|
|
3292
|
+
short_volume_ratio_above: Optional[float] = None,
|
|
3293
|
+
short_volume_ratio_min: Optional[float] = None,
|
|
3294
|
+
short_volume_ratio_below: Optional[float] = None,
|
|
3295
|
+
short_volume_ratio_max: Optional[float] = None,
|
|
3296
|
+
total_volume: Optional[int] = None,
|
|
3297
|
+
total_volume_list: Optional[str] = None,
|
|
3298
|
+
total_volume_above: Optional[int] = None,
|
|
3299
|
+
total_volume_min: Optional[int] = None,
|
|
3300
|
+
total_volume_below: Optional[int] = None,
|
|
3301
|
+
total_volume_max: Optional[int] = None,
|
|
3302
|
+
limit: Optional[int] = None,
|
|
3303
|
+
sort: Optional[str] = None,
|
|
3304
|
+
next: Optional[str] = None,
|
|
3305
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
3306
|
+
server_url: Optional[str] = None,
|
|
3307
|
+
url_override: Optional[str] = None,
|
|
3308
|
+
timeout_ms: Optional[int] = None,
|
|
3309
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
3310
|
+
) -> Optional[models.GetShortVolumeResponse]:
|
|
3311
|
+
r"""Get Short Volume Data
|
|
3312
|
+
|
|
3313
|
+
Retrieve daily short volume data showing the number of shares sold short and overall short selling activity. `ticker` accepts a single symbol only. Use `tickersAnyOf` for multiple symbols. If `ticker` contains multiple comma-separated values, the API returns 400: \"Multiple tickers are not supported. Please provide a single ticker.\" If both `ticker` and `tickersAnyOf` are set, the API returns 400: \"Cannot specify both ticker and tickersAnyOf. Use ticker for a single symbol or tickersAnyOf for multiple.\"
|
|
3314
|
+
|
|
3315
|
+
If set, this operation will use `client_id` from the global security.
|
|
3316
|
+
|
|
3317
|
+
:param ticker: Single ticker symbol filter. Enter one ticker such as AAPL to narrow results to one company.
|
|
3318
|
+
:param tickers_any_of: Comma-separated list of ticker symbols.
|
|
3319
|
+
:param ticker_after: Ticker pagination lower bound. Returns symbols alphabetically after this ticker, excluding the ticker itself.
|
|
3320
|
+
:param ticker_from: Ticker greater than or equal (inclusive)
|
|
3321
|
+
:param ticker_before: Ticker pagination upper bound. Returns symbols alphabetically before this ticker, excluding the ticker itself.
|
|
3322
|
+
:param ticker_to: Ticker less than or equal (inclusive)
|
|
3323
|
+
:param date_: Exact date in YYYY-MM-DD format. Use this when you want one specific calendar day.
|
|
3324
|
+
:param dates: Comma-separated list of dates in YYYY-MM-DD format. Use this when you want several specific dates in one request.
|
|
3325
|
+
:param date_after: After-date filter. Returns records after this date, excluding the date itself.
|
|
3326
|
+
:param date_from: Start-date filter. Returns records on or after this date.
|
|
3327
|
+
:param date_before: Before-date filter. Returns records before this date, excluding the date itself.
|
|
3328
|
+
:param date_to: End-date filter. Returns records on or before this date.
|
|
3329
|
+
:param short_volume_ratio: Exact short-volume ratio filter. Use it when you need records matching one specific ratio value.
|
|
3330
|
+
:param short_volume_ratio_list: Comma-separated list of short volume ratios
|
|
3331
|
+
:param short_volume_ratio_above: Short volume ratio greater than (exclusive)
|
|
3332
|
+
:param short_volume_ratio_min: Short volume ratio greater than or equal (inclusive)
|
|
3333
|
+
:param short_volume_ratio_below: Short volume ratio less than (exclusive)
|
|
3334
|
+
:param short_volume_ratio_max: Short volume ratio less than or equal (inclusive)
|
|
3335
|
+
:param total_volume: Exact total-volume filter. Use it when you need records matching one specific volume value.
|
|
3336
|
+
:param total_volume_list: Comma-separated list of total volumes
|
|
3337
|
+
:param total_volume_above: Total volume greater than (exclusive)
|
|
3338
|
+
:param total_volume_min: Total volume greater than or equal (inclusive)
|
|
3339
|
+
:param total_volume_below: Total-volume upper-bound filter. Returns records below this value, excluding the value itself.
|
|
3340
|
+
:param total_volume_max: Total volume less than or equal (inclusive)
|
|
3341
|
+
:param limit: Maximum number of results to return. Use smaller values for UI pages and larger values for exports within API limits.
|
|
3342
|
+
:param sort: A comma-separated list of sort columns. For each column, append `.asc` or `.desc` to specify direction. Defaults to `ticker.asc` when not specified.
|
|
3343
|
+
:param next: Pagination cursor from the previous response. Omit it on the first request, then send the returned cursor to fetch the next page.
|
|
3344
|
+
:param retries: Override the default retry configuration for this method
|
|
3345
|
+
:param server_url: Override the default server URL for this method
|
|
3346
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
3347
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
3348
|
+
"""
|
|
3349
|
+
base_url = None
|
|
3350
|
+
url_variables = None
|
|
3351
|
+
if timeout_ms is None:
|
|
3352
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
3353
|
+
|
|
3354
|
+
if timeout_ms is None:
|
|
3355
|
+
timeout_ms = 30000
|
|
3356
|
+
|
|
3357
|
+
if server_url is not None:
|
|
3358
|
+
base_url = server_url
|
|
3359
|
+
else:
|
|
3360
|
+
base_url = self._get_url(base_url, url_variables)
|
|
3361
|
+
|
|
3362
|
+
request = models.GetShortVolumeRequest(
|
|
3363
|
+
ticker=ticker,
|
|
3364
|
+
tickers_any_of=tickers_any_of,
|
|
3365
|
+
ticker_after=ticker_after,
|
|
3366
|
+
ticker_from=ticker_from,
|
|
3367
|
+
ticker_before=ticker_before,
|
|
3368
|
+
ticker_to=ticker_to,
|
|
3369
|
+
date_=date_,
|
|
3370
|
+
dates=dates,
|
|
3371
|
+
date_after=date_after,
|
|
3372
|
+
date_from=date_from,
|
|
3373
|
+
date_before=date_before,
|
|
3374
|
+
date_to=date_to,
|
|
3375
|
+
short_volume_ratio=short_volume_ratio,
|
|
3376
|
+
short_volume_ratio_list=short_volume_ratio_list,
|
|
3377
|
+
short_volume_ratio_above=short_volume_ratio_above,
|
|
3378
|
+
short_volume_ratio_min=short_volume_ratio_min,
|
|
3379
|
+
short_volume_ratio_below=short_volume_ratio_below,
|
|
3380
|
+
short_volume_ratio_max=short_volume_ratio_max,
|
|
3381
|
+
total_volume=total_volume,
|
|
3382
|
+
total_volume_list=total_volume_list,
|
|
3383
|
+
total_volume_above=total_volume_above,
|
|
3384
|
+
total_volume_min=total_volume_min,
|
|
3385
|
+
total_volume_below=total_volume_below,
|
|
3386
|
+
total_volume_max=total_volume_max,
|
|
3387
|
+
limit=limit,
|
|
3388
|
+
sort=sort,
|
|
3389
|
+
next=next,
|
|
3390
|
+
)
|
|
3391
|
+
|
|
3392
|
+
req = self._build_request(
|
|
3393
|
+
method="GET",
|
|
3394
|
+
path="/v1/financials/short-volume",
|
|
3395
|
+
base_url=base_url,
|
|
3396
|
+
url_variables=url_variables,
|
|
3397
|
+
url_override=url_override,
|
|
3398
|
+
request=request,
|
|
3399
|
+
request_body_required=False,
|
|
3400
|
+
request_has_path_params=False,
|
|
3401
|
+
request_has_query_params=True,
|
|
3402
|
+
user_agent_header="user-agent",
|
|
3403
|
+
accept_header_value="application/json",
|
|
3404
|
+
http_headers=http_headers,
|
|
3405
|
+
security=self.sdk_configuration.security,
|
|
3406
|
+
allow_empty_value=None,
|
|
3407
|
+
allowed_fields=["client_id"],
|
|
3408
|
+
timeout_ms=timeout_ms,
|
|
3409
|
+
)
|
|
3410
|
+
|
|
3411
|
+
if retries == UNSET:
|
|
3412
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
3413
|
+
retries = self.sdk_configuration.retry_config
|
|
3414
|
+
else:
|
|
3415
|
+
retries = utils.RetryConfig(
|
|
3416
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
3417
|
+
)
|
|
3418
|
+
|
|
3419
|
+
retry_config = None
|
|
3420
|
+
if isinstance(retries, utils.RetryConfig):
|
|
3421
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
3422
|
+
|
|
3423
|
+
http_res = self.do_request(
|
|
3424
|
+
hook_ctx=HookContext(
|
|
3425
|
+
config=self.sdk_configuration,
|
|
3426
|
+
base_url=base_url or "",
|
|
3427
|
+
operation_id="getShortVolume",
|
|
3428
|
+
oauth2_scopes=["market:supplemental"],
|
|
3429
|
+
security_source=self.sdk_configuration.security,
|
|
3430
|
+
tags=["Financials"],
|
|
3431
|
+
extensions=None,
|
|
3432
|
+
),
|
|
3433
|
+
request=req,
|
|
3434
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
3435
|
+
retry_config=retry_config,
|
|
3436
|
+
)
|
|
3437
|
+
|
|
3438
|
+
def next_func() -> Optional[models.GetShortVolumeResponse]:
|
|
3439
|
+
body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]])
|
|
3440
|
+
next_url_match = JSONPath("$.nextUrl").parse(body)
|
|
3441
|
+
if len(next_url_match) == 0:
|
|
3442
|
+
return None
|
|
3443
|
+
|
|
3444
|
+
next_url = next_url_match[0]
|
|
3445
|
+
if not next_url:
|
|
3446
|
+
return None
|
|
3447
|
+
|
|
3448
|
+
if next_url[0] == "/":
|
|
3449
|
+
url = self._get_url(base_url, url_variables)
|
|
3450
|
+
next_url = url + next_url
|
|
3451
|
+
|
|
3452
|
+
return self.get_short_volume(
|
|
3453
|
+
ticker=ticker,
|
|
3454
|
+
tickers_any_of=tickers_any_of,
|
|
3455
|
+
ticker_after=ticker_after,
|
|
3456
|
+
ticker_from=ticker_from,
|
|
3457
|
+
ticker_before=ticker_before,
|
|
3458
|
+
ticker_to=ticker_to,
|
|
3459
|
+
date_=date_,
|
|
3460
|
+
dates=dates,
|
|
3461
|
+
date_after=date_after,
|
|
3462
|
+
date_from=date_from,
|
|
3463
|
+
date_before=date_before,
|
|
3464
|
+
date_to=date_to,
|
|
3465
|
+
short_volume_ratio=short_volume_ratio,
|
|
3466
|
+
short_volume_ratio_list=short_volume_ratio_list,
|
|
3467
|
+
short_volume_ratio_above=short_volume_ratio_above,
|
|
3468
|
+
short_volume_ratio_min=short_volume_ratio_min,
|
|
3469
|
+
short_volume_ratio_below=short_volume_ratio_below,
|
|
3470
|
+
short_volume_ratio_max=short_volume_ratio_max,
|
|
3471
|
+
total_volume=total_volume,
|
|
3472
|
+
total_volume_list=total_volume_list,
|
|
3473
|
+
total_volume_above=total_volume_above,
|
|
3474
|
+
total_volume_min=total_volume_min,
|
|
3475
|
+
total_volume_below=total_volume_below,
|
|
3476
|
+
total_volume_max=total_volume_max,
|
|
3477
|
+
limit=limit,
|
|
3478
|
+
sort=sort,
|
|
3479
|
+
next=next,
|
|
3480
|
+
retries=retries,
|
|
3481
|
+
server_url=server_url,
|
|
3482
|
+
timeout_ms=timeout_ms,
|
|
3483
|
+
http_headers=http_headers,
|
|
3484
|
+
url_override=next_url,
|
|
3485
|
+
)
|
|
3486
|
+
|
|
3487
|
+
response_data: Any = None
|
|
3488
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
3489
|
+
return models.GetShortVolumeResponse(
|
|
3490
|
+
short_volume_response=unmarshal_json_response(
|
|
3491
|
+
Optional[models.ShortVolumeResponse], http_res
|
|
3492
|
+
),
|
|
3493
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
3494
|
+
next=next_func,
|
|
3495
|
+
)
|
|
3496
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
3497
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
3498
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3499
|
+
request=req, response=http_res
|
|
3500
|
+
)
|
|
3501
|
+
raise errors.BadRequest(response_data, http_res)
|
|
3502
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
3503
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
3504
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3505
|
+
request=req, response=http_res
|
|
3506
|
+
)
|
|
3507
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
3508
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
3509
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
3510
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3511
|
+
request=req, response=http_res
|
|
3512
|
+
)
|
|
3513
|
+
raise errors.Forbidden(response_data, http_res)
|
|
3514
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
3515
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
3516
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3517
|
+
request=req, response=http_res
|
|
3518
|
+
)
|
|
3519
|
+
raise errors.NotFound(response_data, http_res)
|
|
3520
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
3521
|
+
response_data = unmarshal_json_response(
|
|
3522
|
+
errors.InternalServerErrorUnion, http_res
|
|
3523
|
+
)
|
|
3524
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3525
|
+
request=req, response=http_res
|
|
3526
|
+
)
|
|
3527
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
3528
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
3529
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
3530
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
3531
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
3532
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
3533
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
3534
|
+
|
|
3535
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
3536
|
+
|
|
3537
|
+
async def get_short_volume_async(
|
|
3538
|
+
self,
|
|
3539
|
+
*,
|
|
3540
|
+
ticker: Optional[str] = None,
|
|
3541
|
+
tickers_any_of: Optional[str] = None,
|
|
3542
|
+
ticker_after: Optional[str] = None,
|
|
3543
|
+
ticker_from: Optional[str] = None,
|
|
3544
|
+
ticker_before: Optional[str] = None,
|
|
3545
|
+
ticker_to: Optional[str] = None,
|
|
3546
|
+
date_: Optional[date] = None,
|
|
3547
|
+
dates: Optional[str] = None,
|
|
3548
|
+
date_after: Optional[date] = None,
|
|
3549
|
+
date_from: Optional[date] = None,
|
|
3550
|
+
date_before: Optional[date] = None,
|
|
3551
|
+
date_to: Optional[date] = None,
|
|
3552
|
+
short_volume_ratio: Optional[float] = None,
|
|
3553
|
+
short_volume_ratio_list: Optional[str] = None,
|
|
3554
|
+
short_volume_ratio_above: Optional[float] = None,
|
|
3555
|
+
short_volume_ratio_min: Optional[float] = None,
|
|
3556
|
+
short_volume_ratio_below: Optional[float] = None,
|
|
3557
|
+
short_volume_ratio_max: Optional[float] = None,
|
|
3558
|
+
total_volume: Optional[int] = None,
|
|
3559
|
+
total_volume_list: Optional[str] = None,
|
|
3560
|
+
total_volume_above: Optional[int] = None,
|
|
3561
|
+
total_volume_min: Optional[int] = None,
|
|
3562
|
+
total_volume_below: Optional[int] = None,
|
|
3563
|
+
total_volume_max: Optional[int] = None,
|
|
3564
|
+
limit: Optional[int] = None,
|
|
3565
|
+
sort: Optional[str] = None,
|
|
3566
|
+
next: Optional[str] = None,
|
|
3567
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
3568
|
+
server_url: Optional[str] = None,
|
|
3569
|
+
url_override: Optional[str] = None,
|
|
3570
|
+
timeout_ms: Optional[int] = None,
|
|
3571
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
3572
|
+
) -> Optional[models.GetShortVolumeResponse]:
|
|
3573
|
+
r"""Get Short Volume Data
|
|
3574
|
+
|
|
3575
|
+
Retrieve daily short volume data showing the number of shares sold short and overall short selling activity. `ticker` accepts a single symbol only. Use `tickersAnyOf` for multiple symbols. If `ticker` contains multiple comma-separated values, the API returns 400: \"Multiple tickers are not supported. Please provide a single ticker.\" If both `ticker` and `tickersAnyOf` are set, the API returns 400: \"Cannot specify both ticker and tickersAnyOf. Use ticker for a single symbol or tickersAnyOf for multiple.\"
|
|
3576
|
+
|
|
3577
|
+
If set, this operation will use `client_id` from the global security.
|
|
3578
|
+
|
|
3579
|
+
:param ticker: Single ticker symbol filter. Enter one ticker such as AAPL to narrow results to one company.
|
|
3580
|
+
:param tickers_any_of: Comma-separated list of ticker symbols.
|
|
3581
|
+
:param ticker_after: Ticker pagination lower bound. Returns symbols alphabetically after this ticker, excluding the ticker itself.
|
|
3582
|
+
:param ticker_from: Ticker greater than or equal (inclusive)
|
|
3583
|
+
:param ticker_before: Ticker pagination upper bound. Returns symbols alphabetically before this ticker, excluding the ticker itself.
|
|
3584
|
+
:param ticker_to: Ticker less than or equal (inclusive)
|
|
3585
|
+
:param date_: Exact date in YYYY-MM-DD format. Use this when you want one specific calendar day.
|
|
3586
|
+
:param dates: Comma-separated list of dates in YYYY-MM-DD format. Use this when you want several specific dates in one request.
|
|
3587
|
+
:param date_after: After-date filter. Returns records after this date, excluding the date itself.
|
|
3588
|
+
:param date_from: Start-date filter. Returns records on or after this date.
|
|
3589
|
+
:param date_before: Before-date filter. Returns records before this date, excluding the date itself.
|
|
3590
|
+
:param date_to: End-date filter. Returns records on or before this date.
|
|
3591
|
+
:param short_volume_ratio: Exact short-volume ratio filter. Use it when you need records matching one specific ratio value.
|
|
3592
|
+
:param short_volume_ratio_list: Comma-separated list of short volume ratios
|
|
3593
|
+
:param short_volume_ratio_above: Short volume ratio greater than (exclusive)
|
|
3594
|
+
:param short_volume_ratio_min: Short volume ratio greater than or equal (inclusive)
|
|
3595
|
+
:param short_volume_ratio_below: Short volume ratio less than (exclusive)
|
|
3596
|
+
:param short_volume_ratio_max: Short volume ratio less than or equal (inclusive)
|
|
3597
|
+
:param total_volume: Exact total-volume filter. Use it when you need records matching one specific volume value.
|
|
3598
|
+
:param total_volume_list: Comma-separated list of total volumes
|
|
3599
|
+
:param total_volume_above: Total volume greater than (exclusive)
|
|
3600
|
+
:param total_volume_min: Total volume greater than or equal (inclusive)
|
|
3601
|
+
:param total_volume_below: Total-volume upper-bound filter. Returns records below this value, excluding the value itself.
|
|
3602
|
+
:param total_volume_max: Total volume less than or equal (inclusive)
|
|
3603
|
+
:param limit: Maximum number of results to return. Use smaller values for UI pages and larger values for exports within API limits.
|
|
3604
|
+
:param sort: A comma-separated list of sort columns. For each column, append `.asc` or `.desc` to specify direction. Defaults to `ticker.asc` when not specified.
|
|
3605
|
+
:param next: Pagination cursor from the previous response. Omit it on the first request, then send the returned cursor to fetch the next page.
|
|
3606
|
+
:param retries: Override the default retry configuration for this method
|
|
3607
|
+
:param server_url: Override the default server URL for this method
|
|
3608
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
3609
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
3610
|
+
"""
|
|
3611
|
+
base_url = None
|
|
3612
|
+
url_variables = None
|
|
3613
|
+
if timeout_ms is None:
|
|
3614
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
3615
|
+
|
|
3616
|
+
if timeout_ms is None:
|
|
3617
|
+
timeout_ms = 30000
|
|
3618
|
+
|
|
3619
|
+
if server_url is not None:
|
|
3620
|
+
base_url = server_url
|
|
3621
|
+
else:
|
|
3622
|
+
base_url = self._get_url(base_url, url_variables)
|
|
3623
|
+
|
|
3624
|
+
request = models.GetShortVolumeRequest(
|
|
3625
|
+
ticker=ticker,
|
|
3626
|
+
tickers_any_of=tickers_any_of,
|
|
3627
|
+
ticker_after=ticker_after,
|
|
3628
|
+
ticker_from=ticker_from,
|
|
3629
|
+
ticker_before=ticker_before,
|
|
3630
|
+
ticker_to=ticker_to,
|
|
3631
|
+
date_=date_,
|
|
3632
|
+
dates=dates,
|
|
3633
|
+
date_after=date_after,
|
|
3634
|
+
date_from=date_from,
|
|
3635
|
+
date_before=date_before,
|
|
3636
|
+
date_to=date_to,
|
|
3637
|
+
short_volume_ratio=short_volume_ratio,
|
|
3638
|
+
short_volume_ratio_list=short_volume_ratio_list,
|
|
3639
|
+
short_volume_ratio_above=short_volume_ratio_above,
|
|
3640
|
+
short_volume_ratio_min=short_volume_ratio_min,
|
|
3641
|
+
short_volume_ratio_below=short_volume_ratio_below,
|
|
3642
|
+
short_volume_ratio_max=short_volume_ratio_max,
|
|
3643
|
+
total_volume=total_volume,
|
|
3644
|
+
total_volume_list=total_volume_list,
|
|
3645
|
+
total_volume_above=total_volume_above,
|
|
3646
|
+
total_volume_min=total_volume_min,
|
|
3647
|
+
total_volume_below=total_volume_below,
|
|
3648
|
+
total_volume_max=total_volume_max,
|
|
3649
|
+
limit=limit,
|
|
3650
|
+
sort=sort,
|
|
3651
|
+
next=next,
|
|
3652
|
+
)
|
|
3653
|
+
|
|
3654
|
+
req = self._build_request_async(
|
|
3655
|
+
method="GET",
|
|
3656
|
+
path="/v1/financials/short-volume",
|
|
3657
|
+
base_url=base_url,
|
|
3658
|
+
url_variables=url_variables,
|
|
3659
|
+
url_override=url_override,
|
|
3660
|
+
request=request,
|
|
3661
|
+
request_body_required=False,
|
|
3662
|
+
request_has_path_params=False,
|
|
3663
|
+
request_has_query_params=True,
|
|
3664
|
+
user_agent_header="user-agent",
|
|
3665
|
+
accept_header_value="application/json",
|
|
3666
|
+
http_headers=http_headers,
|
|
3667
|
+
security=self.sdk_configuration.security,
|
|
3668
|
+
allow_empty_value=None,
|
|
3669
|
+
allowed_fields=["client_id"],
|
|
3670
|
+
timeout_ms=timeout_ms,
|
|
3671
|
+
)
|
|
3672
|
+
|
|
3673
|
+
if retries == UNSET:
|
|
3674
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
3675
|
+
retries = self.sdk_configuration.retry_config
|
|
3676
|
+
else:
|
|
3677
|
+
retries = utils.RetryConfig(
|
|
3678
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
3679
|
+
)
|
|
3680
|
+
|
|
3681
|
+
retry_config = None
|
|
3682
|
+
if isinstance(retries, utils.RetryConfig):
|
|
3683
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
3684
|
+
|
|
3685
|
+
http_res = await self.do_request_async(
|
|
3686
|
+
hook_ctx=HookContext(
|
|
3687
|
+
config=self.sdk_configuration,
|
|
3688
|
+
base_url=base_url or "",
|
|
3689
|
+
operation_id="getShortVolume",
|
|
3690
|
+
oauth2_scopes=["market:supplemental"],
|
|
3691
|
+
security_source=self.sdk_configuration.security,
|
|
3692
|
+
tags=["Financials"],
|
|
3693
|
+
extensions=None,
|
|
3694
|
+
),
|
|
3695
|
+
request=req,
|
|
3696
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
3697
|
+
retry_config=retry_config,
|
|
3698
|
+
)
|
|
3699
|
+
|
|
3700
|
+
def next_func() -> Optional[models.GetShortVolumeResponse]:
|
|
3701
|
+
body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]])
|
|
3702
|
+
next_url_match = JSONPath("$.nextUrl").parse(body)
|
|
3703
|
+
if len(next_url_match) == 0:
|
|
3704
|
+
return None
|
|
3705
|
+
|
|
3706
|
+
next_url = next_url_match[0]
|
|
3707
|
+
if not next_url:
|
|
3708
|
+
return None
|
|
3709
|
+
|
|
3710
|
+
if next_url[0] == "/":
|
|
3711
|
+
url = self._get_url(base_url, url_variables)
|
|
3712
|
+
next_url = url + next_url
|
|
3713
|
+
|
|
3714
|
+
return self.get_short_volume(
|
|
3715
|
+
ticker=ticker,
|
|
3716
|
+
tickers_any_of=tickers_any_of,
|
|
3717
|
+
ticker_after=ticker_after,
|
|
3718
|
+
ticker_from=ticker_from,
|
|
3719
|
+
ticker_before=ticker_before,
|
|
3720
|
+
ticker_to=ticker_to,
|
|
3721
|
+
date_=date_,
|
|
3722
|
+
dates=dates,
|
|
3723
|
+
date_after=date_after,
|
|
3724
|
+
date_from=date_from,
|
|
3725
|
+
date_before=date_before,
|
|
3726
|
+
date_to=date_to,
|
|
3727
|
+
short_volume_ratio=short_volume_ratio,
|
|
3728
|
+
short_volume_ratio_list=short_volume_ratio_list,
|
|
3729
|
+
short_volume_ratio_above=short_volume_ratio_above,
|
|
3730
|
+
short_volume_ratio_min=short_volume_ratio_min,
|
|
3731
|
+
short_volume_ratio_below=short_volume_ratio_below,
|
|
3732
|
+
short_volume_ratio_max=short_volume_ratio_max,
|
|
3733
|
+
total_volume=total_volume,
|
|
3734
|
+
total_volume_list=total_volume_list,
|
|
3735
|
+
total_volume_above=total_volume_above,
|
|
3736
|
+
total_volume_min=total_volume_min,
|
|
3737
|
+
total_volume_below=total_volume_below,
|
|
3738
|
+
total_volume_max=total_volume_max,
|
|
3739
|
+
limit=limit,
|
|
3740
|
+
sort=sort,
|
|
3741
|
+
next=next,
|
|
3742
|
+
retries=retries,
|
|
3743
|
+
server_url=server_url,
|
|
3744
|
+
timeout_ms=timeout_ms,
|
|
3745
|
+
http_headers=http_headers,
|
|
3746
|
+
url_override=next_url,
|
|
3747
|
+
)
|
|
3748
|
+
|
|
3749
|
+
response_data: Any = None
|
|
3750
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
3751
|
+
return models.GetShortVolumeResponse(
|
|
3752
|
+
short_volume_response=unmarshal_json_response(
|
|
3753
|
+
Optional[models.ShortVolumeResponse], http_res
|
|
3754
|
+
),
|
|
3755
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
3756
|
+
next=next_func,
|
|
3757
|
+
)
|
|
3758
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
3759
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
3760
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3761
|
+
request=req, response=http_res
|
|
3762
|
+
)
|
|
3763
|
+
raise errors.BadRequest(response_data, http_res)
|
|
3764
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
3765
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
3766
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3767
|
+
request=req, response=http_res
|
|
3768
|
+
)
|
|
3769
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
3770
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
3771
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
3772
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3773
|
+
request=req, response=http_res
|
|
3774
|
+
)
|
|
3775
|
+
raise errors.Forbidden(response_data, http_res)
|
|
3776
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
3777
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
3778
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3779
|
+
request=req, response=http_res
|
|
3780
|
+
)
|
|
3781
|
+
raise errors.NotFound(response_data, http_res)
|
|
3782
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
3783
|
+
response_data = unmarshal_json_response(
|
|
3784
|
+
errors.InternalServerErrorUnion, http_res
|
|
3785
|
+
)
|
|
3786
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3787
|
+
request=req, response=http_res
|
|
3788
|
+
)
|
|
3789
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
3790
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
3791
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
3792
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
3793
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
3794
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
3795
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
3796
|
+
|
|
3797
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
3798
|
+
|
|
3799
|
+
def get_financial_statements(
|
|
3800
|
+
self,
|
|
3801
|
+
*,
|
|
3802
|
+
symbol: str,
|
|
3803
|
+
statement: models.FinancialStatementType,
|
|
3804
|
+
freq: models.ReportingFrequency,
|
|
3805
|
+
preliminary: Optional[bool] = None,
|
|
3806
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
3807
|
+
server_url: Optional[str] = None,
|
|
3808
|
+
timeout_ms: Optional[int] = None,
|
|
3809
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
3810
|
+
) -> models.GetFinancialStatementsResponse:
|
|
3811
|
+
r"""Get Financial Statements
|
|
3812
|
+
|
|
3813
|
+
Retrieve standardized financial statements (income, balance sheet, cash flow). **symbol**, **statement**, and **freq** are required.
|
|
3814
|
+
|
|
3815
|
+
If set, this operation will use `client_id` from the global security.
|
|
3816
|
+
|
|
3817
|
+
:param symbol: Stock symbol, such as AAPL. Use it to choose the company you want to research.
|
|
3818
|
+
:param statement: Financial statement type to return. Choose the statement category your analysis needs.
|
|
3819
|
+
:param freq: Reporting frequency to return. Use annual or quarterly based on your analysis view.
|
|
3820
|
+
:param preliminary: Include preliminary data (optional boolean).
|
|
3821
|
+
:param retries: Override the default retry configuration for this method
|
|
3822
|
+
:param server_url: Override the default server URL for this method
|
|
3823
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
3824
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
3825
|
+
"""
|
|
3826
|
+
base_url = None
|
|
3827
|
+
url_variables = None
|
|
3828
|
+
if timeout_ms is None:
|
|
3829
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
3830
|
+
|
|
3831
|
+
if timeout_ms is None:
|
|
3832
|
+
timeout_ms = 30000
|
|
3833
|
+
|
|
3834
|
+
if server_url is not None:
|
|
3835
|
+
base_url = server_url
|
|
3836
|
+
else:
|
|
3837
|
+
base_url = self._get_url(base_url, url_variables)
|
|
3838
|
+
|
|
3839
|
+
request = models.GetFinancialStatementsRequest(
|
|
3840
|
+
symbol=symbol,
|
|
3841
|
+
statement=statement,
|
|
3842
|
+
freq=freq,
|
|
3843
|
+
preliminary=preliminary,
|
|
3844
|
+
)
|
|
3845
|
+
|
|
3846
|
+
req = self._build_request(
|
|
3847
|
+
method="GET",
|
|
3848
|
+
path="/v1/financials/statements",
|
|
3849
|
+
base_url=base_url,
|
|
3850
|
+
url_variables=url_variables,
|
|
3851
|
+
request=request,
|
|
3852
|
+
request_body_required=False,
|
|
3853
|
+
request_has_path_params=False,
|
|
3854
|
+
request_has_query_params=True,
|
|
3855
|
+
user_agent_header="user-agent",
|
|
3856
|
+
accept_header_value="application/json",
|
|
3857
|
+
http_headers=http_headers,
|
|
3858
|
+
security=self.sdk_configuration.security,
|
|
3859
|
+
allow_empty_value=None,
|
|
3860
|
+
allowed_fields=["client_id"],
|
|
3861
|
+
timeout_ms=timeout_ms,
|
|
3862
|
+
)
|
|
3863
|
+
|
|
3864
|
+
if retries == UNSET:
|
|
3865
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
3866
|
+
retries = self.sdk_configuration.retry_config
|
|
3867
|
+
else:
|
|
3868
|
+
retries = utils.RetryConfig(
|
|
3869
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
3870
|
+
)
|
|
3871
|
+
|
|
3872
|
+
retry_config = None
|
|
3873
|
+
if isinstance(retries, utils.RetryConfig):
|
|
3874
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
3875
|
+
|
|
3876
|
+
http_res = self.do_request(
|
|
3877
|
+
hook_ctx=HookContext(
|
|
3878
|
+
config=self.sdk_configuration,
|
|
3879
|
+
base_url=base_url or "",
|
|
3880
|
+
operation_id="getFinancialStatements",
|
|
3881
|
+
oauth2_scopes=["market:supplemental"],
|
|
3882
|
+
security_source=self.sdk_configuration.security,
|
|
3883
|
+
tags=["Financials"],
|
|
3884
|
+
extensions=None,
|
|
3885
|
+
),
|
|
3886
|
+
request=req,
|
|
3887
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
3888
|
+
retry_config=retry_config,
|
|
3889
|
+
)
|
|
3890
|
+
|
|
3891
|
+
response_data: Any = None
|
|
3892
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
3893
|
+
return models.GetFinancialStatementsResponse(
|
|
3894
|
+
financials_statements_response=unmarshal_json_response(
|
|
3895
|
+
Optional[models.FinancialsStatementsResponse], http_res
|
|
3896
|
+
),
|
|
3897
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
3898
|
+
)
|
|
3899
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
3900
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
3901
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3902
|
+
request=req, response=http_res
|
|
3903
|
+
)
|
|
3904
|
+
raise errors.BadRequest(response_data, http_res)
|
|
3905
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
3906
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
3907
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3908
|
+
request=req, response=http_res
|
|
3909
|
+
)
|
|
3910
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
3911
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
3912
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
3913
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3914
|
+
request=req, response=http_res
|
|
3915
|
+
)
|
|
3916
|
+
raise errors.Forbidden(response_data, http_res)
|
|
3917
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
3918
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
3919
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3920
|
+
request=req, response=http_res
|
|
3921
|
+
)
|
|
3922
|
+
raise errors.NotFound(response_data, http_res)
|
|
3923
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
3924
|
+
response_data = unmarshal_json_response(
|
|
3925
|
+
errors.InternalServerErrorUnion, http_res
|
|
3926
|
+
)
|
|
3927
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3928
|
+
request=req, response=http_res
|
|
3929
|
+
)
|
|
3930
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
3931
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
3932
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
3933
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
3934
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
3935
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
3936
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
3937
|
+
|
|
3938
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
3939
|
+
|
|
3940
|
+
async def get_financial_statements_async(
|
|
3941
|
+
self,
|
|
3942
|
+
*,
|
|
3943
|
+
symbol: str,
|
|
3944
|
+
statement: models.FinancialStatementType,
|
|
3945
|
+
freq: models.ReportingFrequency,
|
|
3946
|
+
preliminary: Optional[bool] = None,
|
|
3947
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
3948
|
+
server_url: Optional[str] = None,
|
|
3949
|
+
timeout_ms: Optional[int] = None,
|
|
3950
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
3951
|
+
) -> models.GetFinancialStatementsResponse:
|
|
3952
|
+
r"""Get Financial Statements
|
|
3953
|
+
|
|
3954
|
+
Retrieve standardized financial statements (income, balance sheet, cash flow). **symbol**, **statement**, and **freq** are required.
|
|
3955
|
+
|
|
3956
|
+
If set, this operation will use `client_id` from the global security.
|
|
3957
|
+
|
|
3958
|
+
:param symbol: Stock symbol, such as AAPL. Use it to choose the company you want to research.
|
|
3959
|
+
:param statement: Financial statement type to return. Choose the statement category your analysis needs.
|
|
3960
|
+
:param freq: Reporting frequency to return. Use annual or quarterly based on your analysis view.
|
|
3961
|
+
:param preliminary: Include preliminary data (optional boolean).
|
|
3962
|
+
:param retries: Override the default retry configuration for this method
|
|
3963
|
+
:param server_url: Override the default server URL for this method
|
|
3964
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
3965
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
3966
|
+
"""
|
|
3967
|
+
base_url = None
|
|
3968
|
+
url_variables = None
|
|
3969
|
+
if timeout_ms is None:
|
|
3970
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
3971
|
+
|
|
3972
|
+
if timeout_ms is None:
|
|
3973
|
+
timeout_ms = 30000
|
|
3974
|
+
|
|
3975
|
+
if server_url is not None:
|
|
3976
|
+
base_url = server_url
|
|
3977
|
+
else:
|
|
3978
|
+
base_url = self._get_url(base_url, url_variables)
|
|
3979
|
+
|
|
3980
|
+
request = models.GetFinancialStatementsRequest(
|
|
3981
|
+
symbol=symbol,
|
|
3982
|
+
statement=statement,
|
|
3983
|
+
freq=freq,
|
|
3984
|
+
preliminary=preliminary,
|
|
3985
|
+
)
|
|
3986
|
+
|
|
3987
|
+
req = self._build_request_async(
|
|
3988
|
+
method="GET",
|
|
3989
|
+
path="/v1/financials/statements",
|
|
3990
|
+
base_url=base_url,
|
|
3991
|
+
url_variables=url_variables,
|
|
3992
|
+
request=request,
|
|
3993
|
+
request_body_required=False,
|
|
3994
|
+
request_has_path_params=False,
|
|
3995
|
+
request_has_query_params=True,
|
|
3996
|
+
user_agent_header="user-agent",
|
|
3997
|
+
accept_header_value="application/json",
|
|
3998
|
+
http_headers=http_headers,
|
|
3999
|
+
security=self.sdk_configuration.security,
|
|
4000
|
+
allow_empty_value=None,
|
|
4001
|
+
allowed_fields=["client_id"],
|
|
4002
|
+
timeout_ms=timeout_ms,
|
|
4003
|
+
)
|
|
4004
|
+
|
|
4005
|
+
if retries == UNSET:
|
|
4006
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
4007
|
+
retries = self.sdk_configuration.retry_config
|
|
4008
|
+
else:
|
|
4009
|
+
retries = utils.RetryConfig(
|
|
4010
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
4011
|
+
)
|
|
4012
|
+
|
|
4013
|
+
retry_config = None
|
|
4014
|
+
if isinstance(retries, utils.RetryConfig):
|
|
4015
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
4016
|
+
|
|
4017
|
+
http_res = await self.do_request_async(
|
|
4018
|
+
hook_ctx=HookContext(
|
|
4019
|
+
config=self.sdk_configuration,
|
|
4020
|
+
base_url=base_url or "",
|
|
4021
|
+
operation_id="getFinancialStatements",
|
|
4022
|
+
oauth2_scopes=["market:supplemental"],
|
|
4023
|
+
security_source=self.sdk_configuration.security,
|
|
4024
|
+
tags=["Financials"],
|
|
4025
|
+
extensions=None,
|
|
4026
|
+
),
|
|
4027
|
+
request=req,
|
|
4028
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
4029
|
+
retry_config=retry_config,
|
|
4030
|
+
)
|
|
4031
|
+
|
|
4032
|
+
response_data: Any = None
|
|
4033
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
4034
|
+
return models.GetFinancialStatementsResponse(
|
|
4035
|
+
financials_statements_response=unmarshal_json_response(
|
|
4036
|
+
Optional[models.FinancialsStatementsResponse], http_res
|
|
4037
|
+
),
|
|
4038
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
4039
|
+
)
|
|
4040
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
4041
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
4042
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
4043
|
+
request=req, response=http_res
|
|
4044
|
+
)
|
|
4045
|
+
raise errors.BadRequest(response_data, http_res)
|
|
4046
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
4047
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
4048
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
4049
|
+
request=req, response=http_res
|
|
4050
|
+
)
|
|
4051
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
4052
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
4053
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
4054
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
4055
|
+
request=req, response=http_res
|
|
4056
|
+
)
|
|
4057
|
+
raise errors.Forbidden(response_data, http_res)
|
|
4058
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
4059
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
4060
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
4061
|
+
request=req, response=http_res
|
|
4062
|
+
)
|
|
4063
|
+
raise errors.NotFound(response_data, http_res)
|
|
4064
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
4065
|
+
response_data = unmarshal_json_response(
|
|
4066
|
+
errors.InternalServerErrorUnion, http_res
|
|
4067
|
+
)
|
|
4068
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
4069
|
+
request=req, response=http_res
|
|
4070
|
+
)
|
|
4071
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
4072
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
4073
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
4074
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
4075
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
4076
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
4077
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
4078
|
+
|
|
4079
|
+
raise errors.APIError("Unexpected response received", http_res)
|