Skip to content

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

Description

@whittlem

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions