Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Historical Rating Function Pointing to Incorrect Endpoint #34

Closed
iguy0 opened this issue Mar 3, 2023 · 4 comments
Closed

Historical Rating Function Pointing to Incorrect Endpoint #34

iguy0 opened this issue Mar 3, 2023 · 4 comments

Comments

@iguy0
Copy link

iguy0 commented Mar 3, 2023

Hello,

Thank you for this great tool, very useful! I believe the historical_rating function in /fmpsdk/company_valuation.py may be pointing to the wrong API endpoint.

Please see below.

def historical_rating(
    apikey: str,
    symbol: str,
    limit: int = DEFAULT_LIMIT,
) -> typing.Optional[typing.List[typing.Dict]]:
    """
    Query FMP /financial-growth/ API.
    :param apikey: Your API key.
    :param symbol: Company ticker.
    :param limit: Number of rows to return.
    :return: A list of dictionaries.
    """
    path = f"financial-growth/{symbol}"
    query_vars = {"apikey": apikey, "limit": limit}
    return __return_json_v3(path=path, query_vars=query_vars)
@daxm
Copy link
Owner

daxm commented Mar 3, 2023

I would agree with you. It appears I copy/pasted to make the "historical_rating" method but didn't change anything. This said, I've looked through the FMP API Docs and I don't see what I should have put here.

I've been remiss on keeping up to date with changes/additions. The FMP API team seems to be regularly adding and changing things. During these changes it appears they must have restructured the API methods layout and categorization. At some point in the past they must of had some sort of "historical rating" endpoint but now I don't see it.

So, do you see what endpoint historical_rating should point to?

As an aside, I'll try to prioritize updating the fmpsdk python package to bring it more in sync with FMP's current API endpoints.

@iguy0
Copy link
Author

iguy0 commented Mar 4, 2023

I took a look and found the correct string. This is working for me:

def historical_rating(
    apikey: str,
    symbol: str,
    limit: int = DEFAULT_LIMIT,
) -> typing.Optional[typing.List[typing.Dict]]:
    """
    Query FMP /historical-rating/ API.

    :param apikey: Your API key.
    :param symbol: Company ticker.
    :param limit: Number of rows to return.
    :return: A list of dictionaries.
    """
    path = f"historical-rating/{symbol}"
    query_vars = {"apikey": apikey, "limit": limit}
    return __return_json_v3(path=path, query_vars=query_vars)

@iguy0
Copy link
Author

iguy0 commented Mar 4, 2023

I appreciate your prompt response earlier =] Like i mentioned, great job with the Lib!

@daxm
Copy link
Owner

daxm commented Mar 12, 2023

Updated and new version released.

@daxm daxm closed this as completed Mar 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants