I’m trying to find recent splits, what am I doing wrong?
from alpaca.trading.client import TradingClient
from alpaca.trading.requests import GetCorporateAnnouncementsRequest
from alpaca.trading.enums import CorporateActionDateType, CorporateActionType
trading_client = TradingClient(key, sec, paper=False)
trading_client.get_corporate_announcements(
GetCorporateAnnouncementsRequest(
since=datetime(2024, 5, 13).date(),
until=datetime(2024, 5, 14).date(),
ca_types=[CorporateActionType.SPLIT]
)
)
Returns the following:
---------------------------------------------------------------------------
ValidationError Traceback (most recent call last)
Cell In[97], line 10
6 from alpaca.trading.enums import CorporateActionDateType, CorporateActionType
8 trading_client = TradingClient(key, sec, paper=False)
---> 10 trading_client.get_corporate_announcements(
11 GetCorporateAnnouncementsRequest(
12 since=datetime(2024, 5, 13).date(),
13 until=datetime(2024, 5, 14).date(),
14 ca_types=[CorporateActionType.SPLIT]
15 )
16 )
File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\alpaca\trading\client.py:640, in TradingClient.get_corporate_announcements(self, filter)
637 if self._use_raw_data:
638 return response
--> 640 return parse_obj_as(List[CorporateActionAnnouncement], response)
File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\pydantic\tools.py:38, in pydantic.tools.parse_obj_as()
File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\pydantic\main.py:342, in pydantic.main.BaseModel.__init__()
ValidationError: 2 validation errors for ParsingModel[List[alpaca.trading.models.CorporateActionAnnouncement]]
__root__ -> 3 -> target_symbol
field required (type=value_error.missing)
__root__ -> 3 -> target_original_cusip
field required (type=value_error.missing)