René's URL Explorer Experiment


Title: api_key param is absent and ParseError reference is missing · Issue #6 · glassnode/glassnode-api-python-client · GitHub

Open Graph Title: api_key param is absent and ParseError reference is missing · Issue #6 · glassnode/glassnode-api-python-client

X Title: api_key param is absent and ParseError reference is missing · Issue #6 · glassnode/glassnode-api-python-client

Description: Your python client lib has problems. First up the api_key param in your example doesn't work: `from glassnode import GlassnodeClient gn = GlassnodeClient(api_key='YOUR-KEY')` Obviously that's insecure but I wanted to give it a first run ...

Open Graph Description: Your python client lib has problems. First up the api_key param in your example doesn't work: `from glassnode import GlassnodeClient gn = GlassnodeClient(api_key='YOUR-KEY')` Obviously that's insec...

X Description: Your python client lib has problems. First up the api_key param in your example doesn't work: `from glassnode import GlassnodeClient gn = GlassnodeClient(api_key='YOUR-KEY')` Obviously ...

Opengraph URL: https://github.com/glassnode/glassnode-api-python-client/issues/6

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"api_key param is absent and ParseError reference is missing","articleBody":"Your python client lib has problems. First up the api_key param in your example doesn't work:\r\n\r\n`from glassnode import GlassnodeClient\r\n\r\ngn = GlassnodeClient(api_key='YOUR-KEY')`\r\n\r\nObviously that's insecure but I wanted to give it a first run and got this:\r\n\r\nTypeError: __init__() got an unexpected keyword argument 'api_key'\r\n\r\nLooking at the source I can see why. Anyway, I removed the param as I had set an env variable in PyCharm as well as in OS X:\r\n\r\n```\r\nimport os\r\nfrom glassnode import GlassnodeClient\r\n\r\nGLASSNODE_API_KEY = os.getenv('GLASSNODE_API_KEY')\r\nprint(GLASSNODE_API_KEY)\r\n\r\ngn = GlassnodeClient()\r\n\r\nresponse = gn.get(\r\n    'https://api.glassnode.com/v1/metrics/indicators/net_realized_profit_loss?a=BTC\u0026s=1479573422\u0026u=1614470400',\r\n    a='BTC',\r\n    s='2020-01-01',\r\n    i='24h'\r\n)\r\n\r\nprint(response)\r\n\r\n```\r\n\r\nAfter running it like that I get another error:\r\n\r\n```\r\n401 Client Error: Unauthorized for url: https://api.glassnode.com/v1/metrics/indicators/net_realized_profit_loss?a=BTC\u0026s=1479573422\u0026u=1614470400\u0026a=BTC\u0026i=24h\u0026c=native\u0026s=1577833200\u0026api_key=\r\n\u003chtml\u003e\r\n\u003chead\u003e\u003ctitle\u003e401 Authorization Required\u003c/title\u003e\u003c/head\u003e\r\n\u003cbody\u003e\r\n\u003ccenter\u003e\u003ch1\u003e401 Authorization Required\u003c/h1\u003e\u003c/center\u003e\r\n\u003chr\u003e\u003ccenter\u003enginx/1.15.9\u003c/center\u003e\r\n\u003c/body\u003e\r\n\u003c/html\u003e\r\n\r\nExpecting value: line 1 column 1 (char 0)\r\nNone\r\n```\r\n\r\nSo either it's not picking up the key or something else is going on.\r\n\r\nFinally there seem to be an unresolved ParseError reference in glassnode.py. It's clearly the iso8601 ParseError and I've fixed it by making it verbose by adding the module name ahead of ParseError. I've also removed superfluous imports:\r\n\r\n```\r\nimport json\r\nimport requests\r\nimport iso8601\r\nimport pandas as pd\r\n\r\nclass GlassnodeClient:\r\n\r\n  def __init__(self):\r\n    self._api_key = ''\r\n\r\n  @property\r\n  def api_key(self):\r\n    return self._api_key\r\n\r\n  def set_api_key(self, value):\r\n    self._api_key = value\r\n\r\n  def get(self, url, a='BTC', i='24h', c='native', s=None, u=None):\r\n    p = dict()\r\n    p['a'] = a\r\n    p['i'] = i\r\n    p['c'] = c\r\n\r\n    if s is not None:\r\n      try:\r\n        p['s'] = iso8601.parse_date(s).strftime('%s')\r\n      except iso8601.ParseError:\r\n        p['s'] = s\r\n\r\n    if u is not None:\r\n      try:\r\n        p['u'] = iso8601.parse_date(u).strftime('%s')\r\n      except iso8601.ParseError:\r\n        p['u'] = s\r\n\r\n    p['api_key'] = self.api_key\r\n\r\n    r = requests.get(url, params=p)\r\n\r\n    try:\r\n       r.raise_for_status()\r\n    except Exception as e:\r\n        print(e)\r\n        print(r.text)\r\n\r\n    try:\r\n        df = pd.DataFrame(json.loads(r.text))\r\n        df = df.set_index('t')\r\n        df.index = pd.to_datetime(df.index, unit='s')\r\n        df = df.sort_index()\r\n        s = df.v\r\n        s.name = '_'.join(url.split('/')[-2:])\r\n        return s\r\n    except Exception as e:\r\n        print(e)\r\n```\r\n\r\nI run python 3.9 on OS X.\r\n\r\nAny pointers would be appreciated. ","author":{"url":"https://github.com/mmehrle","@type":"Person","name":"mmehrle"},"datePublished":"2021-02-28T13:43:13.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/6/glassnode-api-python-client/issues/6"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:4ea0ce33-4086-ab1f-7c4c-40299cbec8e2
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9516:9FE98:1D63A4C:2898F7B:6A4ECEFD
html-safe-noncefbb6abc62ed1e1f885925eacd32e6a6e396a2240f283910996501fd6f082b3b4
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NTE2OjlGRTk4OjFENjNBNEM6Mjg5OEY3Qjo2QTRFQ0VGRCIsInZpc2l0b3JfaWQiOiI3NDU4MDAzMDE1MjU5MDQ5NzI1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac70b9ea8f1ea430f0d77e164e6a8d62abe0c3288f1cda863f57a5a8c00b1c78ab
hovercard-subject-tagissue:818209247
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/glassnode/glassnode-api-python-client/6/issue_layout
twitter:imagehttps://opengraph.githubassets.com/91f1a73fd02ea4722324cca5100f37df8b8d5d2c9961958075d63804e9264d7c/glassnode/glassnode-api-python-client/issues/6
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/91f1a73fd02ea4722324cca5100f37df8b8d5d2c9961958075d63804e9264d7c/glassnode/glassnode-api-python-client/issues/6
og:image:altYour python client lib has problems. First up the api_key param in your example doesn't work: `from glassnode import GlassnodeClient gn = GlassnodeClient(api_key='YOUR-KEY')` Obviously that's insec...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemmehrle
hostnamegithub.com
expected-hostnamegithub.com
None41b6ab3ba6d20a71766ac245b5a4a94c6fc672a9cd4da7d44c1b33ab8bf6a21c
turbo-cache-controlno-preview
go-importgithub.com/glassnode/glassnode-api-python-client git https://github.com/glassnode/glassnode-api-python-client.git
octolytics-dimension-user_id40865666
octolytics-dimension-user_loginglassnode
octolytics-dimension-repository_id243736354
octolytics-dimension-repository_nwoglassnode/glassnode-api-python-client
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id243736354
octolytics-dimension-repository_network_root_nwoglassnode/glassnode-api-python-client
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasee6a744804e8e70f97b4d5a18a94dcc63db22f97a
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/glassnode/glassnode-api-python-client/issues/6#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fglassnode%2Fglassnode-api-python-client%2Fissues%2F6
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fglassnode%2Fglassnode-api-python-client%2Fissues%2F6
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=glassnode%2Fglassnode-api-python-client
Reloadhttps://github.com/glassnode/glassnode-api-python-client/issues/6
Reloadhttps://github.com/glassnode/glassnode-api-python-client/issues/6
Reloadhttps://github.com/glassnode/glassnode-api-python-client/issues/6
Please reload this pagehttps://github.com/glassnode/glassnode-api-python-client/issues/6
glassnode https://github.com/glassnode
glassnode-api-python-clienthttps://github.com/glassnode/glassnode-api-python-client
Notifications https://github.com/login?return_to=%2Fglassnode%2Fglassnode-api-python-client
Fork 22 https://github.com/login?return_to=%2Fglassnode%2Fglassnode-api-python-client
Star 58 https://github.com/login?return_to=%2Fglassnode%2Fglassnode-api-python-client
Code https://github.com/glassnode/glassnode-api-python-client
Issues 8 https://github.com/glassnode/glassnode-api-python-client/issues
Pull requests 0 https://github.com/glassnode/glassnode-api-python-client/pulls
Actions https://github.com/glassnode/glassnode-api-python-client/actions
Projects https://github.com/glassnode/glassnode-api-python-client/projects
Security and quality 0 https://github.com/glassnode/glassnode-api-python-client/security
Insights https://github.com/glassnode/glassnode-api-python-client/pulse
Code https://github.com/glassnode/glassnode-api-python-client
Issues https://github.com/glassnode/glassnode-api-python-client/issues
Pull requests https://github.com/glassnode/glassnode-api-python-client/pulls
Actions https://github.com/glassnode/glassnode-api-python-client/actions
Projects https://github.com/glassnode/glassnode-api-python-client/projects
Security and quality https://github.com/glassnode/glassnode-api-python-client/security
Insights https://github.com/glassnode/glassnode-api-python-client/pulse
api_key param is absent and ParseError reference is missinghttps://github.com/glassnode/glassnode-api-python-client/issues/6#top
https://github.com/mmehrle
mmehrlehttps://github.com/mmehrle
on Feb 28, 2021https://github.com/glassnode/glassnode-api-python-client/issues/6#issue-818209247
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.