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

with helpers.py #50

Open
tankisstank opened this issue Nov 9, 2023 · 0 comments
Open

with helpers.py #50

tankisstank opened this issue Nov 9, 2023 · 0 comments

Comments

@tankisstank
Copy link

There are one issue with the function get_ticker_list_stats(ticker_list), if the given ticker list is too long, you will have an error which told you to reduce the length, so I split it to 50 each, I think 100 is still ok. And remember with financialmodelingprep free tier, you only have limited number of request.

def get_ticker_list_stats(ticker_list):
    #print(ticker_list)
    chunks = split_list(ticker_list, 50)
    df = pd.DataFrame()
    for chunk in chunks:
       #AdDS4dPu2zBhQJV9pwTVEDMWFjFaNdxf
        try:
            r = requests.get(f"https://financialmodelingprep.com/api/v3/quote/{','.join(chunk)}?"
                         f"apikey={config_keys['FMP_KEY']}").json()
            #print(r)
            df = pd.concat([df,pd.DataFrame(r)])
        except:
            print()
    return df

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

1 participant