diff --git a/flipside-api/getting-started.md b/flipside-api/getting-started.md index 365b167..9a7e916 100644 --- a/flipside-api/getting-started.md +++ b/flipside-api/getting-started.md @@ -32,6 +32,12 @@ _or_ npm install @flipside/sdk ``` {% endtab %} + +{% tab title="R SDK" %} +``` +install.packages("shroomDK") # from CRAN +``` +{% endtab %} {% endtabs %} ### 3. 🏃‍♀️Execute your First Query @@ -78,6 +84,31 @@ GROUP BY 1 // Send the `Query` to Flipside's query engine and await the results const queryResultSet = await flipside.query.run({sql: sql}); +{% endtab %} + +{% tab title="R SDK" %} +
library(shroomDK)
+
+api_key = readLines("api_key.txt") # always gitignore your API keys!
+
+query <- { 
+"
+SELECT 
+  date_trunc('hour', block_timestamp) as hour,
+  count(distinct tx_hash) as tx_count
+FROM ethereum.core.fact_transactions 
+WHERE block_timestamp >= GETDATE() - interval'7 days'
+GROUP BY 1
+"
+ }
+
+pull_data <- auto_paginate_query(
+query = query,
+api_key = api_key
+)
+
+ + {% endtab %} {% endtabs %}