Skip to content

OHLC returns null #4

Open
Open

Description

@josefansinger

OHLC returns null i.e. NoneType.

gn = GlassnodeClient()
gn.set_api_key(GLASSNODE_API_KEY)
ohlc = gn.get('https://api.glassnode.com/v1/metrics/market/price_usd_ohlc', a='ETH')

Activity

  1. TurtleJelly commented on Feb 1, 2021

    @TurtleJelly

    adding below line to the bottom of glassnode.py, however this is not the optimal way to solve the issue.

    try:
        df = pd.DataFrame(json.loads(r.text))
        df = df.set_index('t')
        df.index = pd.to_datetime(df.index, unit='s')
        df = df.sort_index()
        s = pd.DataFrame()
        for r, c in df.iterrows():
            for k, v in c['o'].items():
                s.loc[r, k] = v
        return s
    
    except Exception as e:
        print(e)
    
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