All Collections
Custom Functions
CS.QUERY - Pull any data available on the Cryptosheets platform into your worksheets with formulas
CS.QUERY - Pull any data available on the Cryptosheets platform into your worksheets with formulas

Learn how to use Cryptosheets custom functions (aka formulas) to create powerful worksheets, models and more

C
Written by Chris Ware
Updated over a week ago

Overview

The =CS.QUERY formula is a Cryptosheets core function meaning it can be used broadly to return a diverse set of providers, endpoints and data.

In its simplest form, the CS.QUERY function says =CS.QUERY(what data source you want to use, what specific dataset from that source, list of specific parameters to filter the dataset)

Use Case Scenarios

Use =CS.QUERY() when you need maximum flexibility across all available providers including the ability to call any of their specific endpoints or datasets. This function is also generally the easiest to start using when you're learning how to use the Cryptosheets platform.

Table of Contents

  1. Syntax & Function Arguments

  2. Examples

  3. Additional Resources

________________________________________________________________

1 ) CS.QUERY - Syntax

Function arguments

Arguments:
=CS.QUERY("provider", "endpoint", {"parameter1", "parameter1value"; "parameter2", "parameter2value"; "arguments","argumentValues"})
 

Values:
=CS.QUERY("CryptUnit", "earnings-auto")


Function argument descriptions

  • provider: Data provider, ex. Cryptunit (required)

  • endpoint: Data endpoint of provider, ex. 'earnings-auto' (required)

  • parameters: List of path and query parameters (optional)

  • arguments: Universal argument parameters (optional) configurable for use with any provider or endpoint combination

NOTE:
Arguments like additional parameters that are wrapped in curly brackets {like this} may be required and/or optional, all other arguments should generally be considered optional


HINT: if you ever get stuck on the syntax for a specific function formula, you can use the side panel console to build the entire formula for you!

PARAMETERS - Absolute vs. Relative

Absolute Parameter Values
Formulas using absolute values (instead of cell references) for arguments with multiple parameters must be referenced inside an array using {"curly_brackets"} 

...and will look like this:

=CS.QUERY("Paradigm","clusters", {"clusterGroup","Scenario Benchmarks"})


Relative Parameter Values

Formulas using referenced values for arguments with multiple parameters must be referenced inside an array using a defined range and will look like this:

=CS.QUERY("Paradigm","clusters", A3:B4)

(*Note - {"curly_brackets"} are NOT required when using referenced values) 


Relative Provider, Endpoint & Parameter Values

Formulas using referenced values for arguments with multiple parameters must be referenced inside an array using a defined range and will look like this:

=CS.QUERY(B1,B2,A3:B4) 

(*Note - {"curly_brackets"} are NOT required when using referenced values)

Click here to search for data providers and endpoints
________________________________________________________________

2 ) Examples

TIP: Try copying + pasting the example formulas directly into your worksheet

Example 1:
 =CS.QUERY("CryptUnit", "earnings-auto")
 

Example 2
​ 
=CS.QUERY("CryptUnit", "coins-list") 

Example 3
 =CS.QUERY("Bitmex", "Funding")

Example 4
 =CS.QUERY("CryptUnit", "coins-list")
 


Example 5
 =CS.QUERY("Paradigm", "TA Historical",{"symbol","btc";"limit","10"}))


Try the example below by following these steps:

  1. Copy and past the formula (above) in the exact same place inside a new sheet (E2)

  2. Rebuild the formula using only relative references (B13:C20)

  3. Dynamically adjust the relative references for the 'fields' argument (C19) to return only the symbol , sma50  and sma200  for BTC

Step 1...

Step 2...

Step 3...


TIP: Use =CS.PARAMETERS("Provider","endpoint")  anytime to quickly retrieve a list of the required parameters, their format and syntax


Example 6:

Try using the Query Builder template to automatically populate the entire formula structure and proper syntax, including example parameters and descriptions

________________________________________________________________

3) Resources

Troubleshooting

  1. Check your syntax for =CS.QUERY() carefully, different functions for the same data may have slightly different required syntax

  2. Check the required arguments for =CS.QUERY() vs the optional arguments

  3. Check your data & API quotas and limits

  4. Check your formulas carefully

  5. Check your relative references (=CS.QUERY("CryptUnit", "earnings-auto") vs. =CS.QUERY("A1", "B1"))

  6. Use Excel's error checking tools

  7. Find additional troubleshooting resources and tips here

Other Something else? – Click here for full list of Excel error explanation

Additional Resources

For Microsoft Excel


________________________________________________________________
Tags: formulas, functions, udf, parameters, query, cs.query, tutorial, guide, excel, googlesheets, crypto


Did this answer your question?