Closed justinpolygon closed 2 weeks ago
Update client with related companies support. This PR updates the spec, adds a get_ticker_details function, a RelatedCompany model class, and a working example. This also fixes https://github.com/polygon-io/client-python/issues/682 for the spec changes.
get_ticker_details
RelatedCompany
from polygon import RESTClient # docs # https://polygon.io/docs/stocks/get_v1_related-companies__ticker client = RESTClient() # POLYGON_API_KEY environment variable is used related_companies = client.get_related_companies("AAPL") print(related_companies)
$ python examples/rest/stocks-related_companies.py [ RelatedCompany(ticker="MSFT"), RelatedCompany(ticker="GOOGL"), RelatedCompany(ticker="AMZN"), RelatedCompany(ticker="GOOG"), RelatedCompany(ticker="TSLA"), RelatedCompany(ticker="NVDA"), RelatedCompany(ticker="META"), RelatedCompany(ticker="NFLX"), RelatedCompany(ticker="DIS"), RelatedCompany(ticker="BRK.B"), ]
Update client with related companies support. This PR updates the spec, adds a
get_ticker_details
function, aRelatedCompany
model class, and a working example. This also fixes https://github.com/polygon-io/client-python/issues/682 for the spec changes.