ChainArgos
API
API
  • 🔌api-demos
  • Basic google-sheet-pivot-table-based gueries
    • 🦮API walkthrough
    • 🎬Basic ETL demo
    • 🎰Compute statistics on YGG flows
  • More complex Looker API queries
    • Looker API introduction
    • Downloading a look to pandas
    • Ethereum address inflows
    • Running a look via API
    • Running a look with several filters via API
  • Research
    • How empty are Heco blocks these days?
    • Tether minting vs BTC price
    • Wallet evaluation
Powered by GitBook
On this page
  1. Basic google-sheet-pivot-table-based gueries

Basic ETL demo

PreviousAPI walkthroughNextCompute statistics on YGG flows

Last updated 1 year ago

This is a simple demo that extracts the largest senders of USDC on Base.

A Google Sheet pulls data from the back end. And this code extracts data from there.

The sheet is configured to update hourly, look at the last 90 calendar days and only return wallets with a total flow over US$ 1 million. Those parameters are all visible within the sheet.

The code is brief:

🎬
here
https://github.com/ChainArgos/api-demos/blob/main/google-sheets/basic_pandas/basic_pandas.py
import pandas as pd

# the document ID and which sheet
DOC_ID = '1ZCqciEB89y5TF1j6BrthgMGUTc62CVa0vMp97dJKCPY'
DOC_SHEET = 'Table'

# turn this in to a URL that dumps a csv file
SHEET_URI = 'https://docs.google.com/spreadsheets/d/' + DOC_ID + '/gviz/tq?tqx=out:csv&sheet=' + DOC_SHEET

df = pd.read_csv(SHEET_URI, low_memory=False).fillna(0)

columns = df.columns
for i in df.index:
    this_tag = str(df.loc[i, "Sum of Transfer Amounts Labels"])[0:50]
    print("flow out of addresses tagged as " + this_tag + " totalled " + str(df.loc[i, "Symbol USDC"]))