Using BigQuery (SQL)

All data streams on the Beneath platform are stored on BigQuery and are accessible via BigQuery’s web console or via BigQuery’s easy-to-use API.

BigQuery web console

Find BigQuery’s console here: https://bigquery.cloud.google.com/

The BigQuery console is a great playground for querying data with SQL. Here’s are a couple examples for accessing Beneath data:

SELECT * FROM `beneathcrypto.ethereum.blocks`
SELECT extract(date from _time) as day, count(distinct _from) as active_addresses

FROM `beneathcrypto.ethereum.dai_transfers`

Group By 1

Order By 1
BigQuery API

Here’s a basic example using BigQuery’s Python client library. For more information, you can check out Google’s BigQuery documentation for Python here or for other client libraries here.

from google.cloud import bigquery

client = bigquery.Client()

# Perform a query.

QUERY = (

    'SELECT * FROM `beneathcrypto.ethereum.blocks`'

)

query_job = client.query(QUERY)  # API request

rows = query_job.result()  # Waits for query to finish

for row in rows:

    print(row)