Bitquery GraphQL API Python Package (bitquery-python)

bitquery-python

A simple package to query GraphQL using Bitquery

Installation

pip install bitquery-python

Obtaining API Key

You will need to create an account on the GraphQL IDE to be able to obtain an API key.

Running queries

Here is an example code to run a query

from bitquery import bitquery

API_KEY = "YOUR API KEY"

query = """
query{
  bitcoin{
    blocks{
      count
    }
   }
}
"""

result = bitquery.run_query(API_KEY, query)
print(result)

Links:

2 Likes