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

No Key for relevant data from response object #5

Open
dougbutner opened this issue Oct 17, 2021 · 0 comments
Open

No Key for relevant data from response object #5

dougbutner opened this issue Oct 17, 2021 · 0 comments

Comments

@dougbutner
Copy link

dougbutner commented Oct 17, 2021

The API returns an unkeyed value for the actual data requested, one of which is the array that usually comes with a key like "data" or something. Because of the lack of this key, it's slightly more difficult to get the results needed.

Using topholders endpoint

Here's a workaround for anyone it helps

let resLen = Object.keys(response).length;
response = response[Object.keys(response)[--resLen]];

It would help to have this key, though adding it now may break everyone's code.

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