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

1m historical data is being limited to 120 minutes and is giving the wrong error message #51

Open
whittlem opened this issue Apr 10, 2024 · 0 comments

Comments

@whittlem
Copy link
Collaborator

Hi,

The limit on the 1m historical data is too short. It's currently limited to 120 minutes. It should be a lot larger than this. I would say very least 1 day (1440 minutes) as default. A week would probably be a sensible max (10080).

This is my test code:

from eodhd import APIClient
import config as cfg

api = APIClient(cfg.API_KEY)


def get_ohlc_data():
    df = api.get_historical_data("BTC-USD.CC", "1m", results=120)
    return df


if __name__ == "__main__":
    df = get_ohlc_data()

    df["close"] = pd.to_numeric(df["close"], errors="coerce")
    df.dropna(subset=["close"], inplace=True)
    df["close"].fillna(value=df["close"].mean(), inplace=True)

    print(df)

If I leave out the "results" parameter or set it to anything higher than 120, I get this:

[21:11:39] {'errors': {'to': ['Max period length is 120 days'], 'from': ['Max period length is 120 days']}}     

It also talks about "days" which is incorrect.

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