Required Keys for Crypto Tax Calculator (CTC)
To import your Robinhood transactions into CTC using the API, you also need to add your Robinhood private key to your CTC account as a 'Secret'.
The field in CTC | Key | How to get it |
API Key | API key | Generated in your Robinhood account. |
Secret | Private key | Generated by running the Robinhood script on your device. |
This guide walks you through the process step by step, referencing the official Robinhood documentation.
Generating Your Robinhood Public and Private Keys
Both keys are required for the API to function properly. By completing these five steps, you'll have both keys ready to use.
Key | Function | Description |
Public Key | Creating an API credential. | This key is used to generate an API key on Robinhood. Enter it into your Robinhood account to activate your private key and enable API functionality. |
Private Key | Authenticating requests. | Add this key to the Secret field in your CTC account under the Robinhood import. |
Follow the instructions below to generate these keys. No technical expertise is required—simply follow along, and you’ll have everything set up in just a few minutes!
Step 1: Open Terminal on Your Computer
On your device, search for "Terminal" and open it.
MacOS: Press
Command + Space
and type "Terminal."Windows: Open Command Prompt or Windows PowerShell as Administrator.
Linux: Search for Terminal in your applications menu.
Step 2: Install the Necessary Tools
For Mac or Linux Users
For Mac or Linux Users
Install Homebrew (if not already installed)
Homebrew is a package manager for macOS that makes installing software easier. To install it, open Terminal and run:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Follow the on-screen instructions to complete the installation.
You might need to enter your password to install it.
Verify Installation
Check if Homebrew is correctly installed by running:
brew --version
If you see a version number, Homebrew is set up correctly.
Skip to 4. if it's set up.
[If not found] Add Homebrew to Your PATH
If Homebrew is installed but not recognized, it may not be in your shell’s PATH. The installation location depends on your Mac’s processor:
Intel Macs:
/usr/local/bin
Apple Silicon Macs:
/opt/homebrew/bin
To fix this, update your
~/.zshrc
file:For Apple Silicon Macs:
export PATH="/opt/homebrew/bin:$PATH"
For Intel Macs:
export PATH="/usr/local/bin:$PATH"
After editing, save the file and apply changes by running:
source ~/.zshrc
Copy and paste the following command into your Terminal and press Enter:
brew install node
What does this do? It installs Node.js, a tool you’ll need for the next steps.
This process might take a few minutes, so please be patient!
Once the above job is done, copy and paste the following commands in the Terminal and press Enter:
npm install tweetnacl base64-js
For Windows Users
For Windows Users
Run the following command to install Node.js:
winget install OpenJS.NodeJS
Wait for the installation to complete.
Verify the installation by checking the Node.js version:
node -v
This should display the installed version, e.g.,
v23.7.0
.Install the required dependencies:
npm install tweetnacl base64-js
Create a new script file:
echo. > run.js
Step 3: Create the Robinhood Script
Run this command to start creating the script:
nano run.js
Copy and paste the Robinhood script below into the file.
const nacl = require('tweetnacl')
const base64 = require('base64-js')
// Generate an Ed25519 keypair
const keyPair = nacl.sign.keyPair()
// Convert keys to base64 strings
const private_key_base64 = base64.fromByteArray(keyPair.secretKey)
const public_key_base64 = base64.fromByteArray(keyPair.publicKey)
// Print keys in the base64 format
console.log("Private Key (Base64):")
console.log(private_key_base64)
console.log("Public Key (Base64):")
console.log(public_key_base64)Save and exit by:
Pressing
Ctrl + X
to save the file.Typing Y to confirm changes.
Pressing Enter to save.
Step 4: Run the Script
You should be back in the main Terminal screen. Copy and paste the following command to run the script you just created:
node run.js
Step 5: Get Your Public and Private Keys
Once the script runs, your public key and private key will be displayed in the Terminal.
Keep them secure and store them in a safe location!
Private Key (Base64):Private Key (Base64)
[your private key]
Public Key (Base64):Public Key (Base64):
[your public key]
Import Your Robinhood Transactions into CTC
Note: Your public key is not required in CTC. It is used in your Robinhood account to activate your private key and enable API functionality. Please follow the instructions carefully, step by step.
After generating your Robinhood key pair, follow the steps on the CTC import page for Robinhood to use the keys and import your transactions.
FAQ
Q: Where do I enter my Robinhood public key in CTC?
You don't need to enter your Robinhood public key in CTC. It is only used in your Robinhood account to activate your private key and enable API functionality. For detailed steps, check this section and the CTC import page for Robinhood.
Need Help?
If you run into any issues or have questions, we're here to assist! Reach out via the in-app chat in the bottom-right corner or email us at [email protected].