Skip to content

Commit 1c75361

Browse files
authored
include date param in get_ticker_details (#321)
1 parent 8c54311 commit 1c75361

File tree

3 files changed

+44
-1
lines changed

3 files changed

+44
-1
lines changed

polygon/rest/reference.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def get_ticker_details(
137137

138138
return self._get(
139139
path=url,
140-
params=params,
140+
params=self._get_params(self.get_ticker_details, locals()),
141141
deserializer=TickerDetails.from_dict,
142142
raw=raw,
143143
result_key="results",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"results": {
3+
"ticker": "AAPL",
4+
"name": "Apple Inc.",
5+
"market": "stocks",
6+
"locale": "us",
7+
"primary_exchange": "XNAS",
8+
"type": "CS",
9+
"active": true,
10+
"currency_name": "usd",
11+
"cik": "0000320193",
12+
"composite_figi": "BBG000B9XRY4",
13+
"share_class_figi": "BBG001S5N8V8",
14+
"market_cap": 1916103105630,
15+
"phone_number": "(408) 996-1010",
16+
"address": {
17+
"address1": "ONE APPLE PARK WAY",
18+
"city": "CUPERTINO",
19+
"state": "CA",
20+
"postal_code": "95014"
21+
},
22+
"description": "Apple designs a wide variety of consumer electronic devices, including smartphones (iPhone), tablets (iPad), PCs (Mac), smartwatches (Apple Watch), AirPods, and TV boxes (Apple TV), among others. The iPhone makes up the majority of Apple's total revenue. In addition, Apple offers its customers a variety of services such as Apple Music, iCloud, Apple Care, Apple TV+, Apple Arcade, Apple Card, and Apple Pay, among others. Apple's products run internally developed software and semiconductors, and the firm is well known for its integration of hardware, software and services. Apple's products are distributed online as well as through company-owned stores and third-party retailers. The company generates roughly 40% of its revenue from the Americas, with the remainder earned internationally.",
23+
"sic_code": "3571",
24+
"sic_description": "ELECTRONIC COMPUTERS",
25+
"ticker_root": "AAPL",
26+
"homepage_url": "https://www.apple.com",
27+
"total_employees": 154000,
28+
"list_date": "1980-12-12",
29+
"branding": {
30+
"logo_url": "https://api.polygon.io/v1/reference/company-branding/d3d3LmFwcGxlLmNvbQ/images/2022-05-01_logo.svg",
31+
"icon_url": "https://api.polygon.io/v1/reference/company-branding/d3d3LmFwcGxlLmNvbQ/images/2022-05-01_icon.png"
32+
},
33+
"share_class_shares_outstanding": 16319440000,
34+
"weighted_shares_outstanding": 16185181000
35+
},
36+
"status": "OK",
37+
"request_id": "ce8688b5f3a571351376ebd77acd146e"
38+
}

test_rest/test_tickers.py

+5
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ def test_get_ticker_details(self):
128128
)
129129
self.assertEqual(details, expected)
130130

131+
expected.market_cap = 1916103105630
132+
details = self.c.get_ticker_details("AAPL", date="2020-10-01")
133+
134+
self.assertEqual(details, expected)
135+
131136
def test_list_ticker_news(self):
132137
news = [t for t in self.c.list_ticker_news("NFLX")]
133138
expected = [

0 commit comments

Comments
 (0)