📂

Getting Started: Database

Currently, the easiest way to use Nansen Query via a commercial database is via Google BigQuery. We're in the process of evaluating additional cloud vendors to facilitate additional access.

Google BigQuery Setup

Before you can access Nansen Query via BigQuery, you will have to take the following steps in order to setup BigQuery. All the information can be found on Google BigQuery Guide.
  • Create a billing account for your Google Cloud Project. Note this is required even when using free tier services within Google Cloud
  • Open the BigQuery Console: https://console.cloud.google.com/bigquery
  • Authenticate with your Google Account and accept the terms of service
  • Create a Google Cloud project. For example, call it "Nansen Query"
  • Once the project has been created, you should land on a blank BigQuery console page
BigQuery Console
  • Next to the Explorer, click on "Add Data", select "Pin a Project", then select "Enter Project Name"
Enter Project Name
  • Enter nansen-query as the project name and click "PIN"
  • If everything worked, you should now see Nansen Query datasets in your Explorer and can begin writing queries against the dataset!
Sample SQL statements using Nansen Query dataset
  • To execute a query, enter a valide SQL statement in the editor. A sample statement can be found below:
SELECT
SUM(CAST(balance / 1e18 AS FLOAT64)) AS eth_balance,
address
FROM `nansen-query.raw_ethereum.balances`
GROUP BY address
ORDER BY eth_balance DESC
LIMIT 50
  • When the query is completed the results will appear in the Query Results section below the Query editor
    BigQuery Query Results Window
  • The results can then be saved locally, to a Google drive folder, or exported to another Google Cloud product
    Exporting Query Results into Sheets, Looker, or Colab Notebook
    Savings Query Results to CSV, Google Drive, or Clipboard