Skip to content

Commit

Permalink
add support for institutional symbol ownership API (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivelin authored Jan 31, 2024
1 parent 88d814e commit 70ac47c
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion fmpsdk/institutional_fund.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import requests

from .settings import DEFAULT_LIMIT, SEC_RSS_FEEDS_FILENAME, BASE_URL_v3
from .url_methods import __return_json_v3
from .url_methods import __return_json_v3, __return_json_v4


def institutional_holders(
Expand Down Expand Up @@ -180,3 +180,28 @@ def cusip(apikey: str, cik_id: str) -> typing.Optional[typing.List[typing.Dict]]
path = f"cusip/{cik_id}"
query_vars = {"apikey": apikey}
return __return_json_v3(path=path, query_vars=query_vars)


def institutional_symbol_ownership(
apikey: str,
symbol: str,
limit: int,
includeCurrentQuarter: bool = False,
) -> typing.Optional[typing.List[typing.Dict]]:
"""
Query FMP /institutional-ownership/symbol-ownership API.
:param apikey: Your API key.
:param symbol: Company ticker.
:param limit: up to how many quarterly reports to return.
:param includeCurrentQuarter: Whether to include any available data in the current quarter.
:return: A list of dictionaries.
"""
path = f"institutional-ownership/symbol-ownership"
query_vars = {
"symbol": symbol,
"apikey": apikey,
"includeCurrentQuarter": includeCurrentQuarter,
"limit": limit,
}
return __return_json_v4(path=path, query_vars=query_vars)

0 comments on commit 70ac47c

Please sign in to comment.