1.After login, api document link has been added to the header bar.
2.The contents of the API document have been supplemented.
Great Job there @blocksdk. I didn't expect you would make the changes that quick. Thumbs up to you.
I was finally able to use your API to receive data through my Python code.
Thanks for the updated Python snippet.
from BlockSDK.blocksdk import BlockSDK
This is what I was missing in my code. I used just 'import BlockSDK' instead of 'from BlockSDK.blocksdk import BlockSDK'.
My code is working now and I get the required output as below.
{'height': 661850, 'time': 1608273047, 'bestblockhash': '0000000000000000000e019c1f0f6532fbcd1e0c6f5226caba946ec734383692', 'prev_hash': '0000000000000000000908b539b25f7c713a990c71e23eef6560363bed7f9c06', 'unconfirmed_count': 121799, 'low_fee_per_kb': 0.0003, 'medium_fee_per_kb': 0.00049, 'high_fee_per_kb': 0.00099, 'HTTP_HEADER': {'Date': 'Fri, 18 Dec 2020 06:37:12 GMT', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Set-Cookie': '__cfduid=d1be9bc6df8a5a7ee9f2dadc119a44f121608273431; expires=Sun, 17-Jan-21 06:37:11 GMT; path=/; domain=.blocksdk.com; HttpOnly; SameSite=Lax; Secure', 'Cache-Control': 'no-cache, private', 'X-RateLimit-Limit': '180', 'X-RateLimit-Remaining': '179', 'CF-Cache-Status': 'DYNAMIC', 'cf-request-id': '07162a23c000001a6a69821000000001', 'Expect-CT': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"', 'Report-To': '{"endpoints":[{"url":"https:\\/\\/a.nel.cloudflare.com\\/report?s=OHQAYiLWuN8Va0cj876WwPVPW3tmQJEKy67nqoNqSTmq7w7Ywpq2WF%2BIwmJHN%2FeT7H5eFXbV6479i05790PAR3PhjLVxaD5PrUoH3bhMh3uyX6xF9ei7%2B2hj6o0M"}],"group":"cf-nel","max_age":604800}', 'NEL': '{"report_to":"cf-nel","max_age":604800}', 'Server': 'cloudflare', 'CF-RAY': '6036dfb2cf461a6a-SIN', 'Content-Encoding': 'gzip', 'statusCode': 200}}
Also, you should consider improvising your documentation.
For example : You said to call API using 2 methods but you didn't mention how to use them.
You should consider placing an example snippet/method on how to use the below 2 methods.
You can provide an API key to a REST API call in one of two ways
Preferred method: X-API-KEY via custom header
Convenient way: api_token via query string parameter
That actually explains a lot. I mean what else is there to explain? If you are someone starting as a new developer, you'd find it confusing because your basics about calling API's or passing headers and such are not that clear. The problem lies in your capability but not in the docs I suppose.
Isn't that's how it should be? Yes I am a beginner developer. The documentation should always be beginner friendly as it is now after the updates so that people like me could find it easy to start with.
Else the developers could create their own custom API and never use services like these at all.
P.S : I was able to create a custom header and fetch data through blocksdk API too.