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
finance_dev/market.py
ADDED
|
@@ -0,0 +1,1825 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
# @generated-id: 9ca9dae25671
|
|
3
|
+
|
|
4
|
+
from .basesdk import BaseSDK
|
|
5
|
+
from finance_dev import errors, models, utils
|
|
6
|
+
from finance_dev._hooks import HookContext
|
|
7
|
+
from finance_dev.types import OptionalNullable, UNSET
|
|
8
|
+
from finance_dev.utils.unmarshal_json_response import unmarshal_json_response
|
|
9
|
+
from typing import Any, Iterable, List, Mapping, Optional
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class Market(BaseSDK):
|
|
13
|
+
def get_etb_list(
|
|
14
|
+
self,
|
|
15
|
+
*,
|
|
16
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
17
|
+
server_url: Optional[str] = None,
|
|
18
|
+
timeout_ms: Optional[int] = None,
|
|
19
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
20
|
+
) -> models.GetEtbListResponse:
|
|
21
|
+
r"""Get Easy-to-Borrow List
|
|
22
|
+
|
|
23
|
+
Returns every symbol on today's easy-to-borrow (ETB) list: the complete set of US equities that can be sold short without first locating shares. A symbol on the list is easy to borrow and can be shorted normally; a symbol absent from it is hard to borrow (HTB) and cannot be shorted without a locate. Absence is a positive answer, not missing data. The list is replaced once per trading day before the market opens and does not change intraday. It is not account-scoped — borrowability is a property of the symbol, so every caller gets the same answer. The response can reach a few hundred KB because the borrowable universe runs to thousands of symbols; fetch it once per trading day and check membership locally, or use POST /v1/etb/search when you only care about a handful of symbols.
|
|
24
|
+
|
|
25
|
+
If set, this operation will use `client_id` from the global security.
|
|
26
|
+
|
|
27
|
+
:param retries: Override the default retry configuration for this method
|
|
28
|
+
:param server_url: Override the default server URL for this method
|
|
29
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
30
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
31
|
+
"""
|
|
32
|
+
base_url = None
|
|
33
|
+
url_variables = None
|
|
34
|
+
if timeout_ms is None:
|
|
35
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
36
|
+
|
|
37
|
+
if timeout_ms is None:
|
|
38
|
+
timeout_ms = 30000
|
|
39
|
+
|
|
40
|
+
if server_url is not None:
|
|
41
|
+
base_url = server_url
|
|
42
|
+
else:
|
|
43
|
+
base_url = self._get_url(base_url, url_variables)
|
|
44
|
+
req = self._build_request(
|
|
45
|
+
method="GET",
|
|
46
|
+
path="/v1/etb",
|
|
47
|
+
base_url=base_url,
|
|
48
|
+
url_variables=url_variables,
|
|
49
|
+
request=None,
|
|
50
|
+
request_body_required=False,
|
|
51
|
+
request_has_path_params=False,
|
|
52
|
+
request_has_query_params=True,
|
|
53
|
+
user_agent_header="user-agent",
|
|
54
|
+
accept_header_value="application/json",
|
|
55
|
+
http_headers=http_headers,
|
|
56
|
+
security=self.sdk_configuration.security,
|
|
57
|
+
allow_empty_value=None,
|
|
58
|
+
allowed_fields=["client_id"],
|
|
59
|
+
timeout_ms=timeout_ms,
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
if retries == UNSET:
|
|
63
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
64
|
+
retries = self.sdk_configuration.retry_config
|
|
65
|
+
else:
|
|
66
|
+
retries = utils.RetryConfig(
|
|
67
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
retry_config = None
|
|
71
|
+
if isinstance(retries, utils.RetryConfig):
|
|
72
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
73
|
+
|
|
74
|
+
http_res = self.do_request(
|
|
75
|
+
hook_ctx=HookContext(
|
|
76
|
+
config=self.sdk_configuration,
|
|
77
|
+
base_url=base_url or "",
|
|
78
|
+
operation_id="getEtbList",
|
|
79
|
+
oauth2_scopes=["market:information"],
|
|
80
|
+
security_source=self.sdk_configuration.security,
|
|
81
|
+
tags=["Market Data"],
|
|
82
|
+
extensions=None,
|
|
83
|
+
),
|
|
84
|
+
request=req,
|
|
85
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
86
|
+
retry_config=retry_config,
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
response_data: Any = None
|
|
90
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
91
|
+
return models.GetEtbListResponse(
|
|
92
|
+
etb_list_response=unmarshal_json_response(
|
|
93
|
+
Optional[models.EtbListResponse], http_res
|
|
94
|
+
),
|
|
95
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
96
|
+
)
|
|
97
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
98
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
99
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
100
|
+
request=req, response=http_res
|
|
101
|
+
)
|
|
102
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
103
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
104
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
105
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
106
|
+
request=req, response=http_res
|
|
107
|
+
)
|
|
108
|
+
raise errors.Forbidden(response_data, http_res)
|
|
109
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
110
|
+
response_data = unmarshal_json_response(
|
|
111
|
+
errors.InternalServerErrorUnion, http_res
|
|
112
|
+
)
|
|
113
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
114
|
+
request=req, response=http_res
|
|
115
|
+
)
|
|
116
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
117
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
118
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
119
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
120
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
121
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
122
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
123
|
+
|
|
124
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
125
|
+
|
|
126
|
+
async def get_etb_list_async(
|
|
127
|
+
self,
|
|
128
|
+
*,
|
|
129
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
130
|
+
server_url: Optional[str] = None,
|
|
131
|
+
timeout_ms: Optional[int] = None,
|
|
132
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
133
|
+
) -> models.GetEtbListResponse:
|
|
134
|
+
r"""Get Easy-to-Borrow List
|
|
135
|
+
|
|
136
|
+
Returns every symbol on today's easy-to-borrow (ETB) list: the complete set of US equities that can be sold short without first locating shares. A symbol on the list is easy to borrow and can be shorted normally; a symbol absent from it is hard to borrow (HTB) and cannot be shorted without a locate. Absence is a positive answer, not missing data. The list is replaced once per trading day before the market opens and does not change intraday. It is not account-scoped — borrowability is a property of the symbol, so every caller gets the same answer. The response can reach a few hundred KB because the borrowable universe runs to thousands of symbols; fetch it once per trading day and check membership locally, or use POST /v1/etb/search when you only care about a handful of symbols.
|
|
137
|
+
|
|
138
|
+
If set, this operation will use `client_id` from the global security.
|
|
139
|
+
|
|
140
|
+
:param retries: Override the default retry configuration for this method
|
|
141
|
+
:param server_url: Override the default server URL for this method
|
|
142
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
143
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
144
|
+
"""
|
|
145
|
+
base_url = None
|
|
146
|
+
url_variables = None
|
|
147
|
+
if timeout_ms is None:
|
|
148
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
149
|
+
|
|
150
|
+
if timeout_ms is None:
|
|
151
|
+
timeout_ms = 30000
|
|
152
|
+
|
|
153
|
+
if server_url is not None:
|
|
154
|
+
base_url = server_url
|
|
155
|
+
else:
|
|
156
|
+
base_url = self._get_url(base_url, url_variables)
|
|
157
|
+
req = self._build_request_async(
|
|
158
|
+
method="GET",
|
|
159
|
+
path="/v1/etb",
|
|
160
|
+
base_url=base_url,
|
|
161
|
+
url_variables=url_variables,
|
|
162
|
+
request=None,
|
|
163
|
+
request_body_required=False,
|
|
164
|
+
request_has_path_params=False,
|
|
165
|
+
request_has_query_params=True,
|
|
166
|
+
user_agent_header="user-agent",
|
|
167
|
+
accept_header_value="application/json",
|
|
168
|
+
http_headers=http_headers,
|
|
169
|
+
security=self.sdk_configuration.security,
|
|
170
|
+
allow_empty_value=None,
|
|
171
|
+
allowed_fields=["client_id"],
|
|
172
|
+
timeout_ms=timeout_ms,
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
if retries == UNSET:
|
|
176
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
177
|
+
retries = self.sdk_configuration.retry_config
|
|
178
|
+
else:
|
|
179
|
+
retries = utils.RetryConfig(
|
|
180
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
181
|
+
)
|
|
182
|
+
|
|
183
|
+
retry_config = None
|
|
184
|
+
if isinstance(retries, utils.RetryConfig):
|
|
185
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
186
|
+
|
|
187
|
+
http_res = await self.do_request_async(
|
|
188
|
+
hook_ctx=HookContext(
|
|
189
|
+
config=self.sdk_configuration,
|
|
190
|
+
base_url=base_url or "",
|
|
191
|
+
operation_id="getEtbList",
|
|
192
|
+
oauth2_scopes=["market:information"],
|
|
193
|
+
security_source=self.sdk_configuration.security,
|
|
194
|
+
tags=["Market Data"],
|
|
195
|
+
extensions=None,
|
|
196
|
+
),
|
|
197
|
+
request=req,
|
|
198
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
199
|
+
retry_config=retry_config,
|
|
200
|
+
)
|
|
201
|
+
|
|
202
|
+
response_data: Any = None
|
|
203
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
204
|
+
return models.GetEtbListResponse(
|
|
205
|
+
etb_list_response=unmarshal_json_response(
|
|
206
|
+
Optional[models.EtbListResponse], http_res
|
|
207
|
+
),
|
|
208
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
209
|
+
)
|
|
210
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
211
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
212
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
213
|
+
request=req, response=http_res
|
|
214
|
+
)
|
|
215
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
216
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
217
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
218
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
219
|
+
request=req, response=http_res
|
|
220
|
+
)
|
|
221
|
+
raise errors.Forbidden(response_data, http_res)
|
|
222
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
223
|
+
response_data = unmarshal_json_response(
|
|
224
|
+
errors.InternalServerErrorUnion, http_res
|
|
225
|
+
)
|
|
226
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
227
|
+
request=req, response=http_res
|
|
228
|
+
)
|
|
229
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
230
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
231
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
232
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
233
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
234
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
235
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
236
|
+
|
|
237
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
238
|
+
|
|
239
|
+
def search_etb_symbols(
|
|
240
|
+
self,
|
|
241
|
+
*,
|
|
242
|
+
symbols: Iterable[str],
|
|
243
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
244
|
+
server_url: Optional[str] = None,
|
|
245
|
+
timeout_ms: Optional[int] = None,
|
|
246
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
247
|
+
) -> models.SearchEtbSymbolsResponse:
|
|
248
|
+
r"""Search Easy-to-Borrow Symbols
|
|
249
|
+
|
|
250
|
+
Answers borrowability for a batch of symbols. Use this instead of fetching the whole list when you only care about a handful — for example, deciding whether to show a short-sell option on a ticker page. This is a POST rather than a GET because a symbol list has no practical URL-length limit. Symbols are uppercased and trimmed before the lookup and duplicates collapse, so `count` can be lower than the number of symbols you sent; always read answers out of `results` by uppercase key rather than matching them against your request array by index. Reads the same underlying set as GET /v1/etb, so the two endpoints can never disagree.
|
|
251
|
+
|
|
252
|
+
If set, this operation will use `client_id` from the global security.
|
|
253
|
+
|
|
254
|
+
:param symbols: Symbols to check. Case-insensitive and whitespace-trimmed, so `aapl`, ` AAPL `, and `AAPL` are the same symbol and return one entry. A request of only blank strings is rejected with 400 MISSING_SYMBOLS rather than answered with an empty result.
|
|
255
|
+
:param retries: Override the default retry configuration for this method
|
|
256
|
+
:param server_url: Override the default server URL for this method
|
|
257
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
258
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
259
|
+
"""
|
|
260
|
+
base_url = None
|
|
261
|
+
url_variables = None
|
|
262
|
+
if timeout_ms is None:
|
|
263
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
264
|
+
|
|
265
|
+
if timeout_ms is None:
|
|
266
|
+
timeout_ms = 30000
|
|
267
|
+
|
|
268
|
+
if server_url is not None:
|
|
269
|
+
base_url = server_url
|
|
270
|
+
else:
|
|
271
|
+
base_url = self._get_url(base_url, url_variables)
|
|
272
|
+
|
|
273
|
+
request = models.EtbSearchRequest(
|
|
274
|
+
symbols=utils.unmarshal(symbols, List[str]),
|
|
275
|
+
)
|
|
276
|
+
|
|
277
|
+
req = self._build_request(
|
|
278
|
+
method="POST",
|
|
279
|
+
path="/v1/etb/search",
|
|
280
|
+
base_url=base_url,
|
|
281
|
+
url_variables=url_variables,
|
|
282
|
+
request=request,
|
|
283
|
+
request_body_required=True,
|
|
284
|
+
request_has_path_params=False,
|
|
285
|
+
request_has_query_params=True,
|
|
286
|
+
user_agent_header="user-agent",
|
|
287
|
+
accept_header_value="application/json",
|
|
288
|
+
http_headers=http_headers,
|
|
289
|
+
security=self.sdk_configuration.security,
|
|
290
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
291
|
+
request, False, False, "json", models.EtbSearchRequest
|
|
292
|
+
),
|
|
293
|
+
allow_empty_value=None,
|
|
294
|
+
allowed_fields=["client_id"],
|
|
295
|
+
timeout_ms=timeout_ms,
|
|
296
|
+
)
|
|
297
|
+
|
|
298
|
+
if retries == UNSET:
|
|
299
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
300
|
+
retries = self.sdk_configuration.retry_config
|
|
301
|
+
else:
|
|
302
|
+
retries = utils.RetryConfig(
|
|
303
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
304
|
+
)
|
|
305
|
+
|
|
306
|
+
retry_config = None
|
|
307
|
+
if isinstance(retries, utils.RetryConfig):
|
|
308
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
309
|
+
|
|
310
|
+
http_res = self.do_request(
|
|
311
|
+
hook_ctx=HookContext(
|
|
312
|
+
config=self.sdk_configuration,
|
|
313
|
+
base_url=base_url or "",
|
|
314
|
+
operation_id="searchEtbSymbols",
|
|
315
|
+
oauth2_scopes=["market:information"],
|
|
316
|
+
security_source=self.sdk_configuration.security,
|
|
317
|
+
tags=["Market Data"],
|
|
318
|
+
extensions=None,
|
|
319
|
+
),
|
|
320
|
+
request=req,
|
|
321
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
322
|
+
retry_config=retry_config,
|
|
323
|
+
)
|
|
324
|
+
|
|
325
|
+
response_data: Any = None
|
|
326
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
327
|
+
return models.SearchEtbSymbolsResponse(
|
|
328
|
+
etb_search_response=unmarshal_json_response(
|
|
329
|
+
Optional[models.EtbSearchResponse], http_res
|
|
330
|
+
),
|
|
331
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
332
|
+
)
|
|
333
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
334
|
+
response_data = unmarshal_json_response(
|
|
335
|
+
errors.AuthenticationErrorEnvelopeData, http_res
|
|
336
|
+
)
|
|
337
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
338
|
+
request=req, response=http_res
|
|
339
|
+
)
|
|
340
|
+
raise errors.AuthenticationErrorEnvelope(response_data, http_res)
|
|
341
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
342
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
343
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
344
|
+
request=req, response=http_res
|
|
345
|
+
)
|
|
346
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
347
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
348
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
349
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
350
|
+
request=req, response=http_res
|
|
351
|
+
)
|
|
352
|
+
raise errors.Forbidden(response_data, http_res)
|
|
353
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
354
|
+
response_data = unmarshal_json_response(
|
|
355
|
+
errors.InternalServerErrorUnion, http_res
|
|
356
|
+
)
|
|
357
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
358
|
+
request=req, response=http_res
|
|
359
|
+
)
|
|
360
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
361
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
362
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
363
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
364
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
365
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
366
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
367
|
+
|
|
368
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
369
|
+
|
|
370
|
+
async def search_etb_symbols_async(
|
|
371
|
+
self,
|
|
372
|
+
*,
|
|
373
|
+
symbols: Iterable[str],
|
|
374
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
375
|
+
server_url: Optional[str] = None,
|
|
376
|
+
timeout_ms: Optional[int] = None,
|
|
377
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
378
|
+
) -> models.SearchEtbSymbolsResponse:
|
|
379
|
+
r"""Search Easy-to-Borrow Symbols
|
|
380
|
+
|
|
381
|
+
Answers borrowability for a batch of symbols. Use this instead of fetching the whole list when you only care about a handful — for example, deciding whether to show a short-sell option on a ticker page. This is a POST rather than a GET because a symbol list has no practical URL-length limit. Symbols are uppercased and trimmed before the lookup and duplicates collapse, so `count` can be lower than the number of symbols you sent; always read answers out of `results` by uppercase key rather than matching them against your request array by index. Reads the same underlying set as GET /v1/etb, so the two endpoints can never disagree.
|
|
382
|
+
|
|
383
|
+
If set, this operation will use `client_id` from the global security.
|
|
384
|
+
|
|
385
|
+
:param symbols: Symbols to check. Case-insensitive and whitespace-trimmed, so `aapl`, ` AAPL `, and `AAPL` are the same symbol and return one entry. A request of only blank strings is rejected with 400 MISSING_SYMBOLS rather than answered with an empty result.
|
|
386
|
+
:param retries: Override the default retry configuration for this method
|
|
387
|
+
:param server_url: Override the default server URL for this method
|
|
388
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
389
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
390
|
+
"""
|
|
391
|
+
base_url = None
|
|
392
|
+
url_variables = None
|
|
393
|
+
if timeout_ms is None:
|
|
394
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
395
|
+
|
|
396
|
+
if timeout_ms is None:
|
|
397
|
+
timeout_ms = 30000
|
|
398
|
+
|
|
399
|
+
if server_url is not None:
|
|
400
|
+
base_url = server_url
|
|
401
|
+
else:
|
|
402
|
+
base_url = self._get_url(base_url, url_variables)
|
|
403
|
+
|
|
404
|
+
request = models.EtbSearchRequest(
|
|
405
|
+
symbols=utils.unmarshal(symbols, List[str]),
|
|
406
|
+
)
|
|
407
|
+
|
|
408
|
+
req = self._build_request_async(
|
|
409
|
+
method="POST",
|
|
410
|
+
path="/v1/etb/search",
|
|
411
|
+
base_url=base_url,
|
|
412
|
+
url_variables=url_variables,
|
|
413
|
+
request=request,
|
|
414
|
+
request_body_required=True,
|
|
415
|
+
request_has_path_params=False,
|
|
416
|
+
request_has_query_params=True,
|
|
417
|
+
user_agent_header="user-agent",
|
|
418
|
+
accept_header_value="application/json",
|
|
419
|
+
http_headers=http_headers,
|
|
420
|
+
security=self.sdk_configuration.security,
|
|
421
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
422
|
+
request, False, False, "json", models.EtbSearchRequest
|
|
423
|
+
),
|
|
424
|
+
allow_empty_value=None,
|
|
425
|
+
allowed_fields=["client_id"],
|
|
426
|
+
timeout_ms=timeout_ms,
|
|
427
|
+
)
|
|
428
|
+
|
|
429
|
+
if retries == UNSET:
|
|
430
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
431
|
+
retries = self.sdk_configuration.retry_config
|
|
432
|
+
else:
|
|
433
|
+
retries = utils.RetryConfig(
|
|
434
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
435
|
+
)
|
|
436
|
+
|
|
437
|
+
retry_config = None
|
|
438
|
+
if isinstance(retries, utils.RetryConfig):
|
|
439
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
440
|
+
|
|
441
|
+
http_res = await self.do_request_async(
|
|
442
|
+
hook_ctx=HookContext(
|
|
443
|
+
config=self.sdk_configuration,
|
|
444
|
+
base_url=base_url or "",
|
|
445
|
+
operation_id="searchEtbSymbols",
|
|
446
|
+
oauth2_scopes=["market:information"],
|
|
447
|
+
security_source=self.sdk_configuration.security,
|
|
448
|
+
tags=["Market Data"],
|
|
449
|
+
extensions=None,
|
|
450
|
+
),
|
|
451
|
+
request=req,
|
|
452
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
453
|
+
retry_config=retry_config,
|
|
454
|
+
)
|
|
455
|
+
|
|
456
|
+
response_data: Any = None
|
|
457
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
458
|
+
return models.SearchEtbSymbolsResponse(
|
|
459
|
+
etb_search_response=unmarshal_json_response(
|
|
460
|
+
Optional[models.EtbSearchResponse], http_res
|
|
461
|
+
),
|
|
462
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
463
|
+
)
|
|
464
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
465
|
+
response_data = unmarshal_json_response(
|
|
466
|
+
errors.AuthenticationErrorEnvelopeData, http_res
|
|
467
|
+
)
|
|
468
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
469
|
+
request=req, response=http_res
|
|
470
|
+
)
|
|
471
|
+
raise errors.AuthenticationErrorEnvelope(response_data, http_res)
|
|
472
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
473
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
474
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
475
|
+
request=req, response=http_res
|
|
476
|
+
)
|
|
477
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
478
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
479
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
480
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
481
|
+
request=req, response=http_res
|
|
482
|
+
)
|
|
483
|
+
raise errors.Forbidden(response_data, http_res)
|
|
484
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
485
|
+
response_data = unmarshal_json_response(
|
|
486
|
+
errors.InternalServerErrorUnion, http_res
|
|
487
|
+
)
|
|
488
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
489
|
+
request=req, response=http_res
|
|
490
|
+
)
|
|
491
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
492
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
493
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
494
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
495
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
496
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
497
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
498
|
+
|
|
499
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
500
|
+
|
|
501
|
+
def get_market_holidays(
|
|
502
|
+
self,
|
|
503
|
+
*,
|
|
504
|
+
exchange: models.ExchangeCode = models.ExchangeCode.US,
|
|
505
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
506
|
+
server_url: Optional[str] = None,
|
|
507
|
+
timeout_ms: Optional[int] = None,
|
|
508
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
509
|
+
) -> models.GetMarketHolidaysResponse:
|
|
510
|
+
r"""Get Market Holidays
|
|
511
|
+
|
|
512
|
+
Retrieve market holiday schedules showing dates when exchanges are closed for official holidays and early close days.
|
|
513
|
+
|
|
514
|
+
If set, this operation will use `client_id` from the global security.
|
|
515
|
+
|
|
516
|
+
:param exchange: exchange code (case-insensitive). Select from the Try it dropdown or use any value from the supported exchange list in the API reference page.
|
|
517
|
+
:param retries: Override the default retry configuration for this method
|
|
518
|
+
:param server_url: Override the default server URL for this method
|
|
519
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
520
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
521
|
+
"""
|
|
522
|
+
base_url = None
|
|
523
|
+
url_variables = None
|
|
524
|
+
if timeout_ms is None:
|
|
525
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
526
|
+
|
|
527
|
+
if timeout_ms is None:
|
|
528
|
+
timeout_ms = 30000
|
|
529
|
+
|
|
530
|
+
if server_url is not None:
|
|
531
|
+
base_url = server_url
|
|
532
|
+
else:
|
|
533
|
+
base_url = self._get_url(base_url, url_variables)
|
|
534
|
+
|
|
535
|
+
request = models.GetMarketHolidaysRequest(
|
|
536
|
+
exchange=exchange,
|
|
537
|
+
)
|
|
538
|
+
|
|
539
|
+
req = self._build_request(
|
|
540
|
+
method="GET",
|
|
541
|
+
path="/v1/market/holiday",
|
|
542
|
+
base_url=base_url,
|
|
543
|
+
url_variables=url_variables,
|
|
544
|
+
request=request,
|
|
545
|
+
request_body_required=False,
|
|
546
|
+
request_has_path_params=False,
|
|
547
|
+
request_has_query_params=True,
|
|
548
|
+
user_agent_header="user-agent",
|
|
549
|
+
accept_header_value="application/json",
|
|
550
|
+
http_headers=http_headers,
|
|
551
|
+
security=self.sdk_configuration.security,
|
|
552
|
+
allow_empty_value=None,
|
|
553
|
+
allowed_fields=["client_id"],
|
|
554
|
+
timeout_ms=timeout_ms,
|
|
555
|
+
)
|
|
556
|
+
|
|
557
|
+
if retries == UNSET:
|
|
558
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
559
|
+
retries = self.sdk_configuration.retry_config
|
|
560
|
+
else:
|
|
561
|
+
retries = utils.RetryConfig(
|
|
562
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
563
|
+
)
|
|
564
|
+
|
|
565
|
+
retry_config = None
|
|
566
|
+
if isinstance(retries, utils.RetryConfig):
|
|
567
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
568
|
+
|
|
569
|
+
http_res = self.do_request(
|
|
570
|
+
hook_ctx=HookContext(
|
|
571
|
+
config=self.sdk_configuration,
|
|
572
|
+
base_url=base_url or "",
|
|
573
|
+
operation_id="getMarketHolidays",
|
|
574
|
+
oauth2_scopes=["market:supplemental"],
|
|
575
|
+
security_source=self.sdk_configuration.security,
|
|
576
|
+
tags=["Market"],
|
|
577
|
+
extensions=None,
|
|
578
|
+
),
|
|
579
|
+
request=req,
|
|
580
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
581
|
+
retry_config=retry_config,
|
|
582
|
+
)
|
|
583
|
+
|
|
584
|
+
response_data: Any = None
|
|
585
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
586
|
+
return models.GetMarketHolidaysResponse(
|
|
587
|
+
market_holiday_response=unmarshal_json_response(
|
|
588
|
+
Optional[models.MarketHolidayResponse], http_res
|
|
589
|
+
),
|
|
590
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
591
|
+
)
|
|
592
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
593
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
594
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
595
|
+
request=req, response=http_res
|
|
596
|
+
)
|
|
597
|
+
raise errors.BadRequest(response_data, http_res)
|
|
598
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
599
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
600
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
601
|
+
request=req, response=http_res
|
|
602
|
+
)
|
|
603
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
604
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
605
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
606
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
607
|
+
request=req, response=http_res
|
|
608
|
+
)
|
|
609
|
+
raise errors.Forbidden(response_data, http_res)
|
|
610
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
611
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
612
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
613
|
+
request=req, response=http_res
|
|
614
|
+
)
|
|
615
|
+
raise errors.NotFound(response_data, http_res)
|
|
616
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
617
|
+
response_data = unmarshal_json_response(
|
|
618
|
+
errors.InternalServerErrorUnion, http_res
|
|
619
|
+
)
|
|
620
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
621
|
+
request=req, response=http_res
|
|
622
|
+
)
|
|
623
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
624
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
625
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
626
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
627
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
628
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
629
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
630
|
+
|
|
631
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
632
|
+
|
|
633
|
+
async def get_market_holidays_async(
|
|
634
|
+
self,
|
|
635
|
+
*,
|
|
636
|
+
exchange: models.ExchangeCode = models.ExchangeCode.US,
|
|
637
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
638
|
+
server_url: Optional[str] = None,
|
|
639
|
+
timeout_ms: Optional[int] = None,
|
|
640
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
641
|
+
) -> models.GetMarketHolidaysResponse:
|
|
642
|
+
r"""Get Market Holidays
|
|
643
|
+
|
|
644
|
+
Retrieve market holiday schedules showing dates when exchanges are closed for official holidays and early close days.
|
|
645
|
+
|
|
646
|
+
If set, this operation will use `client_id` from the global security.
|
|
647
|
+
|
|
648
|
+
:param exchange: exchange code (case-insensitive). Select from the Try it dropdown or use any value from the supported exchange list in the API reference page.
|
|
649
|
+
:param retries: Override the default retry configuration for this method
|
|
650
|
+
:param server_url: Override the default server URL for this method
|
|
651
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
652
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
653
|
+
"""
|
|
654
|
+
base_url = None
|
|
655
|
+
url_variables = None
|
|
656
|
+
if timeout_ms is None:
|
|
657
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
658
|
+
|
|
659
|
+
if timeout_ms is None:
|
|
660
|
+
timeout_ms = 30000
|
|
661
|
+
|
|
662
|
+
if server_url is not None:
|
|
663
|
+
base_url = server_url
|
|
664
|
+
else:
|
|
665
|
+
base_url = self._get_url(base_url, url_variables)
|
|
666
|
+
|
|
667
|
+
request = models.GetMarketHolidaysRequest(
|
|
668
|
+
exchange=exchange,
|
|
669
|
+
)
|
|
670
|
+
|
|
671
|
+
req = self._build_request_async(
|
|
672
|
+
method="GET",
|
|
673
|
+
path="/v1/market/holiday",
|
|
674
|
+
base_url=base_url,
|
|
675
|
+
url_variables=url_variables,
|
|
676
|
+
request=request,
|
|
677
|
+
request_body_required=False,
|
|
678
|
+
request_has_path_params=False,
|
|
679
|
+
request_has_query_params=True,
|
|
680
|
+
user_agent_header="user-agent",
|
|
681
|
+
accept_header_value="application/json",
|
|
682
|
+
http_headers=http_headers,
|
|
683
|
+
security=self.sdk_configuration.security,
|
|
684
|
+
allow_empty_value=None,
|
|
685
|
+
allowed_fields=["client_id"],
|
|
686
|
+
timeout_ms=timeout_ms,
|
|
687
|
+
)
|
|
688
|
+
|
|
689
|
+
if retries == UNSET:
|
|
690
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
691
|
+
retries = self.sdk_configuration.retry_config
|
|
692
|
+
else:
|
|
693
|
+
retries = utils.RetryConfig(
|
|
694
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
695
|
+
)
|
|
696
|
+
|
|
697
|
+
retry_config = None
|
|
698
|
+
if isinstance(retries, utils.RetryConfig):
|
|
699
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
700
|
+
|
|
701
|
+
http_res = await self.do_request_async(
|
|
702
|
+
hook_ctx=HookContext(
|
|
703
|
+
config=self.sdk_configuration,
|
|
704
|
+
base_url=base_url or "",
|
|
705
|
+
operation_id="getMarketHolidays",
|
|
706
|
+
oauth2_scopes=["market:supplemental"],
|
|
707
|
+
security_source=self.sdk_configuration.security,
|
|
708
|
+
tags=["Market"],
|
|
709
|
+
extensions=None,
|
|
710
|
+
),
|
|
711
|
+
request=req,
|
|
712
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
713
|
+
retry_config=retry_config,
|
|
714
|
+
)
|
|
715
|
+
|
|
716
|
+
response_data: Any = None
|
|
717
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
718
|
+
return models.GetMarketHolidaysResponse(
|
|
719
|
+
market_holiday_response=unmarshal_json_response(
|
|
720
|
+
Optional[models.MarketHolidayResponse], http_res
|
|
721
|
+
),
|
|
722
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
723
|
+
)
|
|
724
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
725
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
726
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
727
|
+
request=req, response=http_res
|
|
728
|
+
)
|
|
729
|
+
raise errors.BadRequest(response_data, http_res)
|
|
730
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
731
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
732
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
733
|
+
request=req, response=http_res
|
|
734
|
+
)
|
|
735
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
736
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
737
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
738
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
739
|
+
request=req, response=http_res
|
|
740
|
+
)
|
|
741
|
+
raise errors.Forbidden(response_data, http_res)
|
|
742
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
743
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
744
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
745
|
+
request=req, response=http_res
|
|
746
|
+
)
|
|
747
|
+
raise errors.NotFound(response_data, http_res)
|
|
748
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
749
|
+
response_data = unmarshal_json_response(
|
|
750
|
+
errors.InternalServerErrorUnion, http_res
|
|
751
|
+
)
|
|
752
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
753
|
+
request=req, response=http_res
|
|
754
|
+
)
|
|
755
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
756
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
757
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
758
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
759
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
760
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
761
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
762
|
+
|
|
763
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
764
|
+
|
|
765
|
+
def get_market_status(
|
|
766
|
+
self,
|
|
767
|
+
*,
|
|
768
|
+
exchange: models.ExchangeCode = models.ExchangeCode.US,
|
|
769
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
770
|
+
server_url: Optional[str] = None,
|
|
771
|
+
timeout_ms: Optional[int] = None,
|
|
772
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
773
|
+
) -> models.GetMarketStatusResponse:
|
|
774
|
+
r"""Get Market Status
|
|
775
|
+
|
|
776
|
+
Retrieve current market status indicating whether exchanges are open, closed, or in pre-market/after-hours trading sessions. Returns 400 when `exchange` is not a supported Finnhub exchange code; the error message lists the supported codes.
|
|
777
|
+
|
|
778
|
+
If set, this operation will use `client_id` from the global security.
|
|
779
|
+
|
|
780
|
+
:param exchange: exchange code (case-insensitive). Select from the Try it dropdown or use any value from the supported exchange list in the API reference page.
|
|
781
|
+
:param retries: Override the default retry configuration for this method
|
|
782
|
+
:param server_url: Override the default server URL for this method
|
|
783
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
784
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
785
|
+
"""
|
|
786
|
+
base_url = None
|
|
787
|
+
url_variables = None
|
|
788
|
+
if timeout_ms is None:
|
|
789
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
790
|
+
|
|
791
|
+
if timeout_ms is None:
|
|
792
|
+
timeout_ms = 30000
|
|
793
|
+
|
|
794
|
+
if server_url is not None:
|
|
795
|
+
base_url = server_url
|
|
796
|
+
else:
|
|
797
|
+
base_url = self._get_url(base_url, url_variables)
|
|
798
|
+
|
|
799
|
+
request = models.GetMarketStatusRequest(
|
|
800
|
+
exchange=exchange,
|
|
801
|
+
)
|
|
802
|
+
|
|
803
|
+
req = self._build_request(
|
|
804
|
+
method="GET",
|
|
805
|
+
path="/v1/market/status",
|
|
806
|
+
base_url=base_url,
|
|
807
|
+
url_variables=url_variables,
|
|
808
|
+
request=request,
|
|
809
|
+
request_body_required=False,
|
|
810
|
+
request_has_path_params=False,
|
|
811
|
+
request_has_query_params=True,
|
|
812
|
+
user_agent_header="user-agent",
|
|
813
|
+
accept_header_value="application/json",
|
|
814
|
+
http_headers=http_headers,
|
|
815
|
+
security=self.sdk_configuration.security,
|
|
816
|
+
allow_empty_value=None,
|
|
817
|
+
allowed_fields=["client_id"],
|
|
818
|
+
timeout_ms=timeout_ms,
|
|
819
|
+
)
|
|
820
|
+
|
|
821
|
+
if retries == UNSET:
|
|
822
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
823
|
+
retries = self.sdk_configuration.retry_config
|
|
824
|
+
else:
|
|
825
|
+
retries = utils.RetryConfig(
|
|
826
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
827
|
+
)
|
|
828
|
+
|
|
829
|
+
retry_config = None
|
|
830
|
+
if isinstance(retries, utils.RetryConfig):
|
|
831
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
832
|
+
|
|
833
|
+
http_res = self.do_request(
|
|
834
|
+
hook_ctx=HookContext(
|
|
835
|
+
config=self.sdk_configuration,
|
|
836
|
+
base_url=base_url or "",
|
|
837
|
+
operation_id="getMarketStatus",
|
|
838
|
+
oauth2_scopes=["market:supplemental"],
|
|
839
|
+
security_source=self.sdk_configuration.security,
|
|
840
|
+
tags=["Market"],
|
|
841
|
+
extensions=None,
|
|
842
|
+
),
|
|
843
|
+
request=req,
|
|
844
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
845
|
+
retry_config=retry_config,
|
|
846
|
+
)
|
|
847
|
+
|
|
848
|
+
response_data: Any = None
|
|
849
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
850
|
+
return models.GetMarketStatusResponse(
|
|
851
|
+
market_status=unmarshal_json_response(
|
|
852
|
+
Optional[models.MarketStatus], http_res
|
|
853
|
+
),
|
|
854
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
855
|
+
)
|
|
856
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
857
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
858
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
859
|
+
request=req, response=http_res
|
|
860
|
+
)
|
|
861
|
+
raise errors.BadRequest(response_data, http_res)
|
|
862
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
863
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
864
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
865
|
+
request=req, response=http_res
|
|
866
|
+
)
|
|
867
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
868
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
869
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
870
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
871
|
+
request=req, response=http_res
|
|
872
|
+
)
|
|
873
|
+
raise errors.Forbidden(response_data, http_res)
|
|
874
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
875
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
876
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
877
|
+
request=req, response=http_res
|
|
878
|
+
)
|
|
879
|
+
raise errors.NotFound(response_data, http_res)
|
|
880
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
881
|
+
response_data = unmarshal_json_response(
|
|
882
|
+
errors.InternalServerErrorUnion, http_res
|
|
883
|
+
)
|
|
884
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
885
|
+
request=req, response=http_res
|
|
886
|
+
)
|
|
887
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
888
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
889
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
890
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
891
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
892
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
893
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
894
|
+
|
|
895
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
896
|
+
|
|
897
|
+
async def get_market_status_async(
|
|
898
|
+
self,
|
|
899
|
+
*,
|
|
900
|
+
exchange: models.ExchangeCode = models.ExchangeCode.US,
|
|
901
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
902
|
+
server_url: Optional[str] = None,
|
|
903
|
+
timeout_ms: Optional[int] = None,
|
|
904
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
905
|
+
) -> models.GetMarketStatusResponse:
|
|
906
|
+
r"""Get Market Status
|
|
907
|
+
|
|
908
|
+
Retrieve current market status indicating whether exchanges are open, closed, or in pre-market/after-hours trading sessions. Returns 400 when `exchange` is not a supported Finnhub exchange code; the error message lists the supported codes.
|
|
909
|
+
|
|
910
|
+
If set, this operation will use `client_id` from the global security.
|
|
911
|
+
|
|
912
|
+
:param exchange: exchange code (case-insensitive). Select from the Try it dropdown or use any value from the supported exchange list in the API reference page.
|
|
913
|
+
:param retries: Override the default retry configuration for this method
|
|
914
|
+
:param server_url: Override the default server URL for this method
|
|
915
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
916
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
917
|
+
"""
|
|
918
|
+
base_url = None
|
|
919
|
+
url_variables = None
|
|
920
|
+
if timeout_ms is None:
|
|
921
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
922
|
+
|
|
923
|
+
if timeout_ms is None:
|
|
924
|
+
timeout_ms = 30000
|
|
925
|
+
|
|
926
|
+
if server_url is not None:
|
|
927
|
+
base_url = server_url
|
|
928
|
+
else:
|
|
929
|
+
base_url = self._get_url(base_url, url_variables)
|
|
930
|
+
|
|
931
|
+
request = models.GetMarketStatusRequest(
|
|
932
|
+
exchange=exchange,
|
|
933
|
+
)
|
|
934
|
+
|
|
935
|
+
req = self._build_request_async(
|
|
936
|
+
method="GET",
|
|
937
|
+
path="/v1/market/status",
|
|
938
|
+
base_url=base_url,
|
|
939
|
+
url_variables=url_variables,
|
|
940
|
+
request=request,
|
|
941
|
+
request_body_required=False,
|
|
942
|
+
request_has_path_params=False,
|
|
943
|
+
request_has_query_params=True,
|
|
944
|
+
user_agent_header="user-agent",
|
|
945
|
+
accept_header_value="application/json",
|
|
946
|
+
http_headers=http_headers,
|
|
947
|
+
security=self.sdk_configuration.security,
|
|
948
|
+
allow_empty_value=None,
|
|
949
|
+
allowed_fields=["client_id"],
|
|
950
|
+
timeout_ms=timeout_ms,
|
|
951
|
+
)
|
|
952
|
+
|
|
953
|
+
if retries == UNSET:
|
|
954
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
955
|
+
retries = self.sdk_configuration.retry_config
|
|
956
|
+
else:
|
|
957
|
+
retries = utils.RetryConfig(
|
|
958
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
959
|
+
)
|
|
960
|
+
|
|
961
|
+
retry_config = None
|
|
962
|
+
if isinstance(retries, utils.RetryConfig):
|
|
963
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
964
|
+
|
|
965
|
+
http_res = await self.do_request_async(
|
|
966
|
+
hook_ctx=HookContext(
|
|
967
|
+
config=self.sdk_configuration,
|
|
968
|
+
base_url=base_url or "",
|
|
969
|
+
operation_id="getMarketStatus",
|
|
970
|
+
oauth2_scopes=["market:supplemental"],
|
|
971
|
+
security_source=self.sdk_configuration.security,
|
|
972
|
+
tags=["Market"],
|
|
973
|
+
extensions=None,
|
|
974
|
+
),
|
|
975
|
+
request=req,
|
|
976
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
977
|
+
retry_config=retry_config,
|
|
978
|
+
)
|
|
979
|
+
|
|
980
|
+
response_data: Any = None
|
|
981
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
982
|
+
return models.GetMarketStatusResponse(
|
|
983
|
+
market_status=unmarshal_json_response(
|
|
984
|
+
Optional[models.MarketStatus], http_res
|
|
985
|
+
),
|
|
986
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
987
|
+
)
|
|
988
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
989
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
990
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
991
|
+
request=req, response=http_res
|
|
992
|
+
)
|
|
993
|
+
raise errors.BadRequest(response_data, http_res)
|
|
994
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
995
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
996
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
997
|
+
request=req, response=http_res
|
|
998
|
+
)
|
|
999
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1000
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
1001
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
1002
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1003
|
+
request=req, response=http_res
|
|
1004
|
+
)
|
|
1005
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1006
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
1007
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
1008
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1009
|
+
request=req, response=http_res
|
|
1010
|
+
)
|
|
1011
|
+
raise errors.NotFound(response_data, http_res)
|
|
1012
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
1013
|
+
response_data = unmarshal_json_response(
|
|
1014
|
+
errors.InternalServerErrorUnion, http_res
|
|
1015
|
+
)
|
|
1016
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1017
|
+
request=req, response=http_res
|
|
1018
|
+
)
|
|
1019
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1020
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1021
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1022
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1023
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1024
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1025
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1026
|
+
|
|
1027
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1028
|
+
|
|
1029
|
+
def get_equity_details(
|
|
1030
|
+
self,
|
|
1031
|
+
*,
|
|
1032
|
+
symbols: str,
|
|
1033
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1034
|
+
server_url: Optional[str] = None,
|
|
1035
|
+
timeout_ms: Optional[int] = None,
|
|
1036
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1037
|
+
) -> models.GetEquityDetailsResponseResponse:
|
|
1038
|
+
r"""Get equity details
|
|
1039
|
+
|
|
1040
|
+
Batch equity details from an internal cache with an automatic fallback when cached quotes are unavailable. Response includes `data` with per-symbol fields (camelCase: `bidPrice`, `openPrice`, `totalVolume`, etc.); see `EquityDetailsDTO` and `GetEquityDetailsResponse`. At least one symbol is required.
|
|
1041
|
+
|
|
1042
|
+
If set, this operation will use `client_id` from the global security.
|
|
1043
|
+
|
|
1044
|
+
:param symbols: One or more uppercase ticker symbols, separated by commas (e.g. `AAPL,MSFT,GOOGL`). Send at least one. The response order matches the request order.
|
|
1045
|
+
:param retries: Override the default retry configuration for this method
|
|
1046
|
+
:param server_url: Override the default server URL for this method
|
|
1047
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1048
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1049
|
+
"""
|
|
1050
|
+
base_url = None
|
|
1051
|
+
url_variables = None
|
|
1052
|
+
if timeout_ms is None:
|
|
1053
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1054
|
+
|
|
1055
|
+
if timeout_ms is None:
|
|
1056
|
+
timeout_ms = 30000
|
|
1057
|
+
|
|
1058
|
+
if server_url is not None:
|
|
1059
|
+
base_url = server_url
|
|
1060
|
+
else:
|
|
1061
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1062
|
+
|
|
1063
|
+
request = models.GetEquityDetailsRequest(
|
|
1064
|
+
symbols=symbols,
|
|
1065
|
+
)
|
|
1066
|
+
|
|
1067
|
+
req = self._build_request(
|
|
1068
|
+
method="GET",
|
|
1069
|
+
path="/v1/marketdata/equities/details",
|
|
1070
|
+
base_url=base_url,
|
|
1071
|
+
url_variables=url_variables,
|
|
1072
|
+
request=request,
|
|
1073
|
+
request_body_required=False,
|
|
1074
|
+
request_has_path_params=False,
|
|
1075
|
+
request_has_query_params=True,
|
|
1076
|
+
user_agent_header="user-agent",
|
|
1077
|
+
accept_header_value="application/json",
|
|
1078
|
+
http_headers=http_headers,
|
|
1079
|
+
security=self.sdk_configuration.security,
|
|
1080
|
+
allow_empty_value=None,
|
|
1081
|
+
allowed_fields=["client_id"],
|
|
1082
|
+
timeout_ms=timeout_ms,
|
|
1083
|
+
)
|
|
1084
|
+
|
|
1085
|
+
if retries == UNSET:
|
|
1086
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1087
|
+
retries = self.sdk_configuration.retry_config
|
|
1088
|
+
else:
|
|
1089
|
+
retries = utils.RetryConfig(
|
|
1090
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
1091
|
+
)
|
|
1092
|
+
|
|
1093
|
+
retry_config = None
|
|
1094
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1095
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1096
|
+
|
|
1097
|
+
http_res = self.do_request(
|
|
1098
|
+
hook_ctx=HookContext(
|
|
1099
|
+
config=self.sdk_configuration,
|
|
1100
|
+
base_url=base_url or "",
|
|
1101
|
+
operation_id="getEquityDetails",
|
|
1102
|
+
oauth2_scopes=["market:information"],
|
|
1103
|
+
security_source=self.sdk_configuration.security,
|
|
1104
|
+
tags=["Market Data"],
|
|
1105
|
+
extensions=None,
|
|
1106
|
+
),
|
|
1107
|
+
request=req,
|
|
1108
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
1109
|
+
retry_config=retry_config,
|
|
1110
|
+
)
|
|
1111
|
+
|
|
1112
|
+
response_data: Any = None
|
|
1113
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1114
|
+
return models.GetEquityDetailsResponseResponse(
|
|
1115
|
+
get_equity_details_response=unmarshal_json_response(
|
|
1116
|
+
Optional[models.GetEquityDetailsResponse], http_res
|
|
1117
|
+
),
|
|
1118
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
1119
|
+
)
|
|
1120
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
1121
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
1122
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1123
|
+
request=req, response=http_res
|
|
1124
|
+
)
|
|
1125
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1126
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
1127
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
1128
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1129
|
+
request=req, response=http_res
|
|
1130
|
+
)
|
|
1131
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1132
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
1133
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
1134
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1135
|
+
request=req, response=http_res
|
|
1136
|
+
)
|
|
1137
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1138
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
1139
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
1140
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1141
|
+
request=req, response=http_res
|
|
1142
|
+
)
|
|
1143
|
+
raise errors.NotFound(response_data, http_res)
|
|
1144
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
1145
|
+
response_data = unmarshal_json_response(
|
|
1146
|
+
errors.InternalServerErrorUnion, http_res
|
|
1147
|
+
)
|
|
1148
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1149
|
+
request=req, response=http_res
|
|
1150
|
+
)
|
|
1151
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1152
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1153
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1154
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1155
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1156
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1157
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1158
|
+
|
|
1159
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1160
|
+
|
|
1161
|
+
async def get_equity_details_async(
|
|
1162
|
+
self,
|
|
1163
|
+
*,
|
|
1164
|
+
symbols: str,
|
|
1165
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1166
|
+
server_url: Optional[str] = None,
|
|
1167
|
+
timeout_ms: Optional[int] = None,
|
|
1168
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1169
|
+
) -> models.GetEquityDetailsResponseResponse:
|
|
1170
|
+
r"""Get equity details
|
|
1171
|
+
|
|
1172
|
+
Batch equity details from an internal cache with an automatic fallback when cached quotes are unavailable. Response includes `data` with per-symbol fields (camelCase: `bidPrice`, `openPrice`, `totalVolume`, etc.); see `EquityDetailsDTO` and `GetEquityDetailsResponse`. At least one symbol is required.
|
|
1173
|
+
|
|
1174
|
+
If set, this operation will use `client_id` from the global security.
|
|
1175
|
+
|
|
1176
|
+
:param symbols: One or more uppercase ticker symbols, separated by commas (e.g. `AAPL,MSFT,GOOGL`). Send at least one. The response order matches the request order.
|
|
1177
|
+
:param retries: Override the default retry configuration for this method
|
|
1178
|
+
:param server_url: Override the default server URL for this method
|
|
1179
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1180
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1181
|
+
"""
|
|
1182
|
+
base_url = None
|
|
1183
|
+
url_variables = None
|
|
1184
|
+
if timeout_ms is None:
|
|
1185
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1186
|
+
|
|
1187
|
+
if timeout_ms is None:
|
|
1188
|
+
timeout_ms = 30000
|
|
1189
|
+
|
|
1190
|
+
if server_url is not None:
|
|
1191
|
+
base_url = server_url
|
|
1192
|
+
else:
|
|
1193
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1194
|
+
|
|
1195
|
+
request = models.GetEquityDetailsRequest(
|
|
1196
|
+
symbols=symbols,
|
|
1197
|
+
)
|
|
1198
|
+
|
|
1199
|
+
req = self._build_request_async(
|
|
1200
|
+
method="GET",
|
|
1201
|
+
path="/v1/marketdata/equities/details",
|
|
1202
|
+
base_url=base_url,
|
|
1203
|
+
url_variables=url_variables,
|
|
1204
|
+
request=request,
|
|
1205
|
+
request_body_required=False,
|
|
1206
|
+
request_has_path_params=False,
|
|
1207
|
+
request_has_query_params=True,
|
|
1208
|
+
user_agent_header="user-agent",
|
|
1209
|
+
accept_header_value="application/json",
|
|
1210
|
+
http_headers=http_headers,
|
|
1211
|
+
security=self.sdk_configuration.security,
|
|
1212
|
+
allow_empty_value=None,
|
|
1213
|
+
allowed_fields=["client_id"],
|
|
1214
|
+
timeout_ms=timeout_ms,
|
|
1215
|
+
)
|
|
1216
|
+
|
|
1217
|
+
if retries == UNSET:
|
|
1218
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1219
|
+
retries = self.sdk_configuration.retry_config
|
|
1220
|
+
else:
|
|
1221
|
+
retries = utils.RetryConfig(
|
|
1222
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
1223
|
+
)
|
|
1224
|
+
|
|
1225
|
+
retry_config = None
|
|
1226
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1227
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1228
|
+
|
|
1229
|
+
http_res = await self.do_request_async(
|
|
1230
|
+
hook_ctx=HookContext(
|
|
1231
|
+
config=self.sdk_configuration,
|
|
1232
|
+
base_url=base_url or "",
|
|
1233
|
+
operation_id="getEquityDetails",
|
|
1234
|
+
oauth2_scopes=["market:information"],
|
|
1235
|
+
security_source=self.sdk_configuration.security,
|
|
1236
|
+
tags=["Market Data"],
|
|
1237
|
+
extensions=None,
|
|
1238
|
+
),
|
|
1239
|
+
request=req,
|
|
1240
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
1241
|
+
retry_config=retry_config,
|
|
1242
|
+
)
|
|
1243
|
+
|
|
1244
|
+
response_data: Any = None
|
|
1245
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1246
|
+
return models.GetEquityDetailsResponseResponse(
|
|
1247
|
+
get_equity_details_response=unmarshal_json_response(
|
|
1248
|
+
Optional[models.GetEquityDetailsResponse], http_res
|
|
1249
|
+
),
|
|
1250
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
1251
|
+
)
|
|
1252
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
1253
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
1254
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1255
|
+
request=req, response=http_res
|
|
1256
|
+
)
|
|
1257
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1258
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
1259
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
1260
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1261
|
+
request=req, response=http_res
|
|
1262
|
+
)
|
|
1263
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1264
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
1265
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
1266
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1267
|
+
request=req, response=http_res
|
|
1268
|
+
)
|
|
1269
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1270
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
1271
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
1272
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1273
|
+
request=req, response=http_res
|
|
1274
|
+
)
|
|
1275
|
+
raise errors.NotFound(response_data, http_res)
|
|
1276
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
1277
|
+
response_data = unmarshal_json_response(
|
|
1278
|
+
errors.InternalServerErrorUnion, http_res
|
|
1279
|
+
)
|
|
1280
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1281
|
+
request=req, response=http_res
|
|
1282
|
+
)
|
|
1283
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1284
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1285
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1286
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1287
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1288
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1289
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1290
|
+
|
|
1291
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1292
|
+
|
|
1293
|
+
def get_option_details(
|
|
1294
|
+
self,
|
|
1295
|
+
*,
|
|
1296
|
+
symbols: str,
|
|
1297
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1298
|
+
server_url: Optional[str] = None,
|
|
1299
|
+
timeout_ms: Optional[int] = None,
|
|
1300
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1301
|
+
) -> models.GetOptionDetailsResponseResponse:
|
|
1302
|
+
r"""Get option details
|
|
1303
|
+
|
|
1304
|
+
Batch option contract details for one or more OSI option symbols. Response includes `data` with per-symbol pricing fields (`lastPrice`, `bidPrice`, `askPrice`, `midPrice`, `closePrice`) and an `errors` array for symbols that cannot be returned. At least one symbol is required.
|
|
1305
|
+
|
|
1306
|
+
If set, this operation will use `client_id` from the global security.
|
|
1307
|
+
|
|
1308
|
+
:param symbols: One or more OSI option symbols, separated by commas (e.g. `GOOG270115C00285000`). Send at least one. The response order matches the request order.
|
|
1309
|
+
:param retries: Override the default retry configuration for this method
|
|
1310
|
+
:param server_url: Override the default server URL for this method
|
|
1311
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1312
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1313
|
+
"""
|
|
1314
|
+
base_url = None
|
|
1315
|
+
url_variables = None
|
|
1316
|
+
if timeout_ms is None:
|
|
1317
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1318
|
+
|
|
1319
|
+
if timeout_ms is None:
|
|
1320
|
+
timeout_ms = 30000
|
|
1321
|
+
|
|
1322
|
+
if server_url is not None:
|
|
1323
|
+
base_url = server_url
|
|
1324
|
+
else:
|
|
1325
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1326
|
+
|
|
1327
|
+
request = models.GetOptionDetailsRequest(
|
|
1328
|
+
symbols=symbols,
|
|
1329
|
+
)
|
|
1330
|
+
|
|
1331
|
+
req = self._build_request(
|
|
1332
|
+
method="GET",
|
|
1333
|
+
path="/v1/marketdata/options/details",
|
|
1334
|
+
base_url=base_url,
|
|
1335
|
+
url_variables=url_variables,
|
|
1336
|
+
request=request,
|
|
1337
|
+
request_body_required=False,
|
|
1338
|
+
request_has_path_params=False,
|
|
1339
|
+
request_has_query_params=True,
|
|
1340
|
+
user_agent_header="user-agent",
|
|
1341
|
+
accept_header_value="application/json",
|
|
1342
|
+
http_headers=http_headers,
|
|
1343
|
+
security=self.sdk_configuration.security,
|
|
1344
|
+
allow_empty_value=None,
|
|
1345
|
+
allowed_fields=["client_id"],
|
|
1346
|
+
timeout_ms=timeout_ms,
|
|
1347
|
+
)
|
|
1348
|
+
|
|
1349
|
+
if retries == UNSET:
|
|
1350
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1351
|
+
retries = self.sdk_configuration.retry_config
|
|
1352
|
+
else:
|
|
1353
|
+
retries = utils.RetryConfig(
|
|
1354
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
1355
|
+
)
|
|
1356
|
+
|
|
1357
|
+
retry_config = None
|
|
1358
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1359
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1360
|
+
|
|
1361
|
+
http_res = self.do_request(
|
|
1362
|
+
hook_ctx=HookContext(
|
|
1363
|
+
config=self.sdk_configuration,
|
|
1364
|
+
base_url=base_url or "",
|
|
1365
|
+
operation_id="getOptionDetails",
|
|
1366
|
+
oauth2_scopes=["market:information"],
|
|
1367
|
+
security_source=self.sdk_configuration.security,
|
|
1368
|
+
tags=["Market Data"],
|
|
1369
|
+
extensions=None,
|
|
1370
|
+
),
|
|
1371
|
+
request=req,
|
|
1372
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
1373
|
+
retry_config=retry_config,
|
|
1374
|
+
)
|
|
1375
|
+
|
|
1376
|
+
response_data: Any = None
|
|
1377
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1378
|
+
return models.GetOptionDetailsResponseResponse(
|
|
1379
|
+
get_option_details_response=unmarshal_json_response(
|
|
1380
|
+
Optional[models.GetOptionDetailsResponse], http_res
|
|
1381
|
+
),
|
|
1382
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
1383
|
+
)
|
|
1384
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
1385
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
1386
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1387
|
+
request=req, response=http_res
|
|
1388
|
+
)
|
|
1389
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1390
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
1391
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
1392
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1393
|
+
request=req, response=http_res
|
|
1394
|
+
)
|
|
1395
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1396
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
1397
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
1398
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1399
|
+
request=req, response=http_res
|
|
1400
|
+
)
|
|
1401
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1402
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
1403
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
1404
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1405
|
+
request=req, response=http_res
|
|
1406
|
+
)
|
|
1407
|
+
raise errors.NotFound(response_data, http_res)
|
|
1408
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
1409
|
+
response_data = unmarshal_json_response(
|
|
1410
|
+
errors.InternalServerErrorUnion, http_res
|
|
1411
|
+
)
|
|
1412
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1413
|
+
request=req, response=http_res
|
|
1414
|
+
)
|
|
1415
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1416
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1417
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1418
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1419
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1420
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1421
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1422
|
+
|
|
1423
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1424
|
+
|
|
1425
|
+
async def get_option_details_async(
|
|
1426
|
+
self,
|
|
1427
|
+
*,
|
|
1428
|
+
symbols: str,
|
|
1429
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1430
|
+
server_url: Optional[str] = None,
|
|
1431
|
+
timeout_ms: Optional[int] = None,
|
|
1432
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1433
|
+
) -> models.GetOptionDetailsResponseResponse:
|
|
1434
|
+
r"""Get option details
|
|
1435
|
+
|
|
1436
|
+
Batch option contract details for one or more OSI option symbols. Response includes `data` with per-symbol pricing fields (`lastPrice`, `bidPrice`, `askPrice`, `midPrice`, `closePrice`) and an `errors` array for symbols that cannot be returned. At least one symbol is required.
|
|
1437
|
+
|
|
1438
|
+
If set, this operation will use `client_id` from the global security.
|
|
1439
|
+
|
|
1440
|
+
:param symbols: One or more OSI option symbols, separated by commas (e.g. `GOOG270115C00285000`). Send at least one. The response order matches the request order.
|
|
1441
|
+
:param retries: Override the default retry configuration for this method
|
|
1442
|
+
:param server_url: Override the default server URL for this method
|
|
1443
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1444
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1445
|
+
"""
|
|
1446
|
+
base_url = None
|
|
1447
|
+
url_variables = None
|
|
1448
|
+
if timeout_ms is None:
|
|
1449
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1450
|
+
|
|
1451
|
+
if timeout_ms is None:
|
|
1452
|
+
timeout_ms = 30000
|
|
1453
|
+
|
|
1454
|
+
if server_url is not None:
|
|
1455
|
+
base_url = server_url
|
|
1456
|
+
else:
|
|
1457
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1458
|
+
|
|
1459
|
+
request = models.GetOptionDetailsRequest(
|
|
1460
|
+
symbols=symbols,
|
|
1461
|
+
)
|
|
1462
|
+
|
|
1463
|
+
req = self._build_request_async(
|
|
1464
|
+
method="GET",
|
|
1465
|
+
path="/v1/marketdata/options/details",
|
|
1466
|
+
base_url=base_url,
|
|
1467
|
+
url_variables=url_variables,
|
|
1468
|
+
request=request,
|
|
1469
|
+
request_body_required=False,
|
|
1470
|
+
request_has_path_params=False,
|
|
1471
|
+
request_has_query_params=True,
|
|
1472
|
+
user_agent_header="user-agent",
|
|
1473
|
+
accept_header_value="application/json",
|
|
1474
|
+
http_headers=http_headers,
|
|
1475
|
+
security=self.sdk_configuration.security,
|
|
1476
|
+
allow_empty_value=None,
|
|
1477
|
+
allowed_fields=["client_id"],
|
|
1478
|
+
timeout_ms=timeout_ms,
|
|
1479
|
+
)
|
|
1480
|
+
|
|
1481
|
+
if retries == UNSET:
|
|
1482
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1483
|
+
retries = self.sdk_configuration.retry_config
|
|
1484
|
+
else:
|
|
1485
|
+
retries = utils.RetryConfig(
|
|
1486
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
1487
|
+
)
|
|
1488
|
+
|
|
1489
|
+
retry_config = None
|
|
1490
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1491
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1492
|
+
|
|
1493
|
+
http_res = await self.do_request_async(
|
|
1494
|
+
hook_ctx=HookContext(
|
|
1495
|
+
config=self.sdk_configuration,
|
|
1496
|
+
base_url=base_url or "",
|
|
1497
|
+
operation_id="getOptionDetails",
|
|
1498
|
+
oauth2_scopes=["market:information"],
|
|
1499
|
+
security_source=self.sdk_configuration.security,
|
|
1500
|
+
tags=["Market Data"],
|
|
1501
|
+
extensions=None,
|
|
1502
|
+
),
|
|
1503
|
+
request=req,
|
|
1504
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
1505
|
+
retry_config=retry_config,
|
|
1506
|
+
)
|
|
1507
|
+
|
|
1508
|
+
response_data: Any = None
|
|
1509
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1510
|
+
return models.GetOptionDetailsResponseResponse(
|
|
1511
|
+
get_option_details_response=unmarshal_json_response(
|
|
1512
|
+
Optional[models.GetOptionDetailsResponse], http_res
|
|
1513
|
+
),
|
|
1514
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
1515
|
+
)
|
|
1516
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
1517
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
1518
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1519
|
+
request=req, response=http_res
|
|
1520
|
+
)
|
|
1521
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1522
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
1523
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
1524
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1525
|
+
request=req, response=http_res
|
|
1526
|
+
)
|
|
1527
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1528
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
1529
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
1530
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1531
|
+
request=req, response=http_res
|
|
1532
|
+
)
|
|
1533
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1534
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
1535
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
1536
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1537
|
+
request=req, response=http_res
|
|
1538
|
+
)
|
|
1539
|
+
raise errors.NotFound(response_data, http_res)
|
|
1540
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
1541
|
+
response_data = unmarshal_json_response(
|
|
1542
|
+
errors.InternalServerErrorUnion, http_res
|
|
1543
|
+
)
|
|
1544
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1545
|
+
request=req, response=http_res
|
|
1546
|
+
)
|
|
1547
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1548
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1549
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1550
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1551
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1552
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1553
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1554
|
+
|
|
1555
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1556
|
+
|
|
1557
|
+
def search_market_symbols(
|
|
1558
|
+
self,
|
|
1559
|
+
*,
|
|
1560
|
+
query: str,
|
|
1561
|
+
limit: Optional[int] = 20,
|
|
1562
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1563
|
+
server_url: Optional[str] = None,
|
|
1564
|
+
timeout_ms: Optional[int] = None,
|
|
1565
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1566
|
+
) -> models.SearchMarketSymbolsResponse:
|
|
1567
|
+
r"""Search Symbols
|
|
1568
|
+
|
|
1569
|
+
Search for trading symbols including stocks, indices, options, and futures. **Prefixes:** '.' searches options (e.g. '.AAPL'); '/' searches futures (e.g. '/ES'). Without a prefix, searches stocks and indices together, merges matches, ranks them, and returns at most `limit` results. The '!' character is **not** a special prefix—only '.' and '/' are. Default limit is 20 if omitted (max 100).
|
|
1570
|
+
|
|
1571
|
+
If set, this operation will use `client_id` from the global security.
|
|
1572
|
+
|
|
1573
|
+
:param query: Text the user entered in symbol search. Use `AAPL` for stocks and indices, `.AAPL` for option-chain style searches, and `/ES` for futures. Do not use `!` as a special prefix; it is treated as literal text.
|
|
1574
|
+
:param limit: Maximum number of matches to return. Use a small number for autocomplete and a larger number for full search pages. Default is 20; minimum is 1; maximum is 100.
|
|
1575
|
+
:param retries: Override the default retry configuration for this method
|
|
1576
|
+
:param server_url: Override the default server URL for this method
|
|
1577
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1578
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1579
|
+
"""
|
|
1580
|
+
base_url = None
|
|
1581
|
+
url_variables = None
|
|
1582
|
+
if timeout_ms is None:
|
|
1583
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1584
|
+
|
|
1585
|
+
if timeout_ms is None:
|
|
1586
|
+
timeout_ms = 30000
|
|
1587
|
+
|
|
1588
|
+
if server_url is not None:
|
|
1589
|
+
base_url = server_url
|
|
1590
|
+
else:
|
|
1591
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1592
|
+
|
|
1593
|
+
request = models.SearchMarketSymbolsRequest(
|
|
1594
|
+
query=query,
|
|
1595
|
+
limit=limit,
|
|
1596
|
+
)
|
|
1597
|
+
|
|
1598
|
+
req = self._build_request(
|
|
1599
|
+
method="GET",
|
|
1600
|
+
path="/v1/marketdata/search",
|
|
1601
|
+
base_url=base_url,
|
|
1602
|
+
url_variables=url_variables,
|
|
1603
|
+
request=request,
|
|
1604
|
+
request_body_required=False,
|
|
1605
|
+
request_has_path_params=False,
|
|
1606
|
+
request_has_query_params=True,
|
|
1607
|
+
user_agent_header="user-agent",
|
|
1608
|
+
accept_header_value="application/json",
|
|
1609
|
+
http_headers=http_headers,
|
|
1610
|
+
security=self.sdk_configuration.security,
|
|
1611
|
+
allow_empty_value=None,
|
|
1612
|
+
allowed_fields=["client_id"],
|
|
1613
|
+
timeout_ms=timeout_ms,
|
|
1614
|
+
)
|
|
1615
|
+
|
|
1616
|
+
if retries == UNSET:
|
|
1617
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1618
|
+
retries = self.sdk_configuration.retry_config
|
|
1619
|
+
else:
|
|
1620
|
+
retries = utils.RetryConfig(
|
|
1621
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
1622
|
+
)
|
|
1623
|
+
|
|
1624
|
+
retry_config = None
|
|
1625
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1626
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1627
|
+
|
|
1628
|
+
http_res = self.do_request(
|
|
1629
|
+
hook_ctx=HookContext(
|
|
1630
|
+
config=self.sdk_configuration,
|
|
1631
|
+
base_url=base_url or "",
|
|
1632
|
+
operation_id="searchMarketSymbols",
|
|
1633
|
+
oauth2_scopes=["market:information"],
|
|
1634
|
+
security_source=self.sdk_configuration.security,
|
|
1635
|
+
tags=["Market Data"],
|
|
1636
|
+
extensions=None,
|
|
1637
|
+
),
|
|
1638
|
+
request=req,
|
|
1639
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
1640
|
+
retry_config=retry_config,
|
|
1641
|
+
)
|
|
1642
|
+
|
|
1643
|
+
response_data: Any = None
|
|
1644
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1645
|
+
return models.SearchMarketSymbolsResponse(
|
|
1646
|
+
search_symbol_response=unmarshal_json_response(
|
|
1647
|
+
Optional[List[models.SearchSymbolResponseItem]], http_res
|
|
1648
|
+
),
|
|
1649
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
1650
|
+
)
|
|
1651
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
1652
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
1653
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1654
|
+
request=req, response=http_res
|
|
1655
|
+
)
|
|
1656
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1657
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
1658
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
1659
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1660
|
+
request=req, response=http_res
|
|
1661
|
+
)
|
|
1662
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1663
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
1664
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
1665
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1666
|
+
request=req, response=http_res
|
|
1667
|
+
)
|
|
1668
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1669
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
1670
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
1671
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1672
|
+
request=req, response=http_res
|
|
1673
|
+
)
|
|
1674
|
+
raise errors.NotFound(response_data, http_res)
|
|
1675
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
1676
|
+
response_data = unmarshal_json_response(
|
|
1677
|
+
errors.InternalServerErrorUnion, http_res
|
|
1678
|
+
)
|
|
1679
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1680
|
+
request=req, response=http_res
|
|
1681
|
+
)
|
|
1682
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1683
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1684
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1685
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1686
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1687
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1688
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1689
|
+
|
|
1690
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1691
|
+
|
|
1692
|
+
async def search_market_symbols_async(
|
|
1693
|
+
self,
|
|
1694
|
+
*,
|
|
1695
|
+
query: str,
|
|
1696
|
+
limit: Optional[int] = 20,
|
|
1697
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1698
|
+
server_url: Optional[str] = None,
|
|
1699
|
+
timeout_ms: Optional[int] = None,
|
|
1700
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1701
|
+
) -> models.SearchMarketSymbolsResponse:
|
|
1702
|
+
r"""Search Symbols
|
|
1703
|
+
|
|
1704
|
+
Search for trading symbols including stocks, indices, options, and futures. **Prefixes:** '.' searches options (e.g. '.AAPL'); '/' searches futures (e.g. '/ES'). Without a prefix, searches stocks and indices together, merges matches, ranks them, and returns at most `limit` results. The '!' character is **not** a special prefix—only '.' and '/' are. Default limit is 20 if omitted (max 100).
|
|
1705
|
+
|
|
1706
|
+
If set, this operation will use `client_id` from the global security.
|
|
1707
|
+
|
|
1708
|
+
:param query: Text the user entered in symbol search. Use `AAPL` for stocks and indices, `.AAPL` for option-chain style searches, and `/ES` for futures. Do not use `!` as a special prefix; it is treated as literal text.
|
|
1709
|
+
:param limit: Maximum number of matches to return. Use a small number for autocomplete and a larger number for full search pages. Default is 20; minimum is 1; maximum is 100.
|
|
1710
|
+
:param retries: Override the default retry configuration for this method
|
|
1711
|
+
:param server_url: Override the default server URL for this method
|
|
1712
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1713
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1714
|
+
"""
|
|
1715
|
+
base_url = None
|
|
1716
|
+
url_variables = None
|
|
1717
|
+
if timeout_ms is None:
|
|
1718
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1719
|
+
|
|
1720
|
+
if timeout_ms is None:
|
|
1721
|
+
timeout_ms = 30000
|
|
1722
|
+
|
|
1723
|
+
if server_url is not None:
|
|
1724
|
+
base_url = server_url
|
|
1725
|
+
else:
|
|
1726
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1727
|
+
|
|
1728
|
+
request = models.SearchMarketSymbolsRequest(
|
|
1729
|
+
query=query,
|
|
1730
|
+
limit=limit,
|
|
1731
|
+
)
|
|
1732
|
+
|
|
1733
|
+
req = self._build_request_async(
|
|
1734
|
+
method="GET",
|
|
1735
|
+
path="/v1/marketdata/search",
|
|
1736
|
+
base_url=base_url,
|
|
1737
|
+
url_variables=url_variables,
|
|
1738
|
+
request=request,
|
|
1739
|
+
request_body_required=False,
|
|
1740
|
+
request_has_path_params=False,
|
|
1741
|
+
request_has_query_params=True,
|
|
1742
|
+
user_agent_header="user-agent",
|
|
1743
|
+
accept_header_value="application/json",
|
|
1744
|
+
http_headers=http_headers,
|
|
1745
|
+
security=self.sdk_configuration.security,
|
|
1746
|
+
allow_empty_value=None,
|
|
1747
|
+
allowed_fields=["client_id"],
|
|
1748
|
+
timeout_ms=timeout_ms,
|
|
1749
|
+
)
|
|
1750
|
+
|
|
1751
|
+
if retries == UNSET:
|
|
1752
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1753
|
+
retries = self.sdk_configuration.retry_config
|
|
1754
|
+
else:
|
|
1755
|
+
retries = utils.RetryConfig(
|
|
1756
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
1757
|
+
)
|
|
1758
|
+
|
|
1759
|
+
retry_config = None
|
|
1760
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1761
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1762
|
+
|
|
1763
|
+
http_res = await self.do_request_async(
|
|
1764
|
+
hook_ctx=HookContext(
|
|
1765
|
+
config=self.sdk_configuration,
|
|
1766
|
+
base_url=base_url or "",
|
|
1767
|
+
operation_id="searchMarketSymbols",
|
|
1768
|
+
oauth2_scopes=["market:information"],
|
|
1769
|
+
security_source=self.sdk_configuration.security,
|
|
1770
|
+
tags=["Market Data"],
|
|
1771
|
+
extensions=None,
|
|
1772
|
+
),
|
|
1773
|
+
request=req,
|
|
1774
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
1775
|
+
retry_config=retry_config,
|
|
1776
|
+
)
|
|
1777
|
+
|
|
1778
|
+
response_data: Any = None
|
|
1779
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1780
|
+
return models.SearchMarketSymbolsResponse(
|
|
1781
|
+
search_symbol_response=unmarshal_json_response(
|
|
1782
|
+
Optional[List[models.SearchSymbolResponseItem]], http_res
|
|
1783
|
+
),
|
|
1784
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
1785
|
+
)
|
|
1786
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
1787
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
1788
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1789
|
+
request=req, response=http_res
|
|
1790
|
+
)
|
|
1791
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1792
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
1793
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
1794
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1795
|
+
request=req, response=http_res
|
|
1796
|
+
)
|
|
1797
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1798
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
1799
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
1800
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1801
|
+
request=req, response=http_res
|
|
1802
|
+
)
|
|
1803
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1804
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
1805
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
1806
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1807
|
+
request=req, response=http_res
|
|
1808
|
+
)
|
|
1809
|
+
raise errors.NotFound(response_data, http_res)
|
|
1810
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
1811
|
+
response_data = unmarshal_json_response(
|
|
1812
|
+
errors.InternalServerErrorUnion, http_res
|
|
1813
|
+
)
|
|
1814
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1815
|
+
request=req, response=http_res
|
|
1816
|
+
)
|
|
1817
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1818
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1819
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1820
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1821
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1822
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1823
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1824
|
+
|
|
1825
|
+
raise errors.APIError("Unexpected response received", http_res)
|