PRICE

=CS.PRICE

In its simplest form, the PRICE function says

=CS.PRICE(what base asset, what quoted asset, at what date or time, from what exchange, which type of price)

image

image

image

Use Case Scenarios

When you need to quickly pull in the latest price for specific assets pairs or the historical price at specific times


PRICE - Syntax

Function arguments

Arguments: =CS.PRICE("base","quote","time", "exchange", "returnType")

Example Values: =CS.PRICE("BTC","USD","1/1/2020","COINBASE","BID")

Function argument descriptions

image

image

  • base: The cryptocurrency symbol of interest. [string] required
  • quote: Cryptocurrency symbol to convert into [string] required
  • time: Time at which exchange rate is calculated. (Optional, if not supplied then current rate is returned) [string] optional
  • exchange: Exchange to retrieve rate from. (Optional, if not supplied then current vwap rate is returned) [string] optional
  • returnType: Return value of rate. (Optional but required when exchange is specified. If not supplied, the mid price is returned. Possible values include mid, ask, bid.) [string] optional

PARAMETERS - Absolute vs. Relative

Absolute Parameter Values

Formulas using absolute values for arguments with multiple parameters must be referenced inside an array using {"curly_brackets"} and will look like this:

=CS.PRICE("BTC","USD","1/1/2020")

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 (*Note - {"curly_brackets"} are NOT required when using referenced values):

=CS.PRICE("A1","A2","A3")

image

image

Click here to search for supported assets & exchanges


PRICE - Examples

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

Example 1:

=CS.PRICE("BTC","USD")

image

Example 2:

=CS.PRICE("ETH","USD","2019-01-01")

image

Example 3:

=CS.PRICE("BTC","USD","2011-01-01")

image

Example 4:

=CS.PRICE("BTC","USD","2011-01-01","COINBASE","BID")

image

Example 5:

Using combinations to build a simple template

Troubleshooting

  1. Check your formula syntax for carefully, different functions for the same data may have slightly different required syntax

  2. Check the required arguments for your function vs the optional arguments

  3. Check your data & API quotas and limits

  4. Check your formulas carefully

  5. Check your relative references

  6. Use Excels error checking tools

  7. Check Excels help sections

  8. Error Response Codes Reference

    • #N/A OK – Everything worked as expected
    • #BUSY Heavy query and/or unauthorized – Your User/Password API Keys are incorrect
    • #LIMIT Forbidden – You are not subscribed to the data feed requested
    • Other Something else? Reach out to us directly

Additional Resources

For Microsoft Excel

For Googlesheets