Track live crypto prices in Notion.
- There are 3 main steps to make this work
- You can track live crypto prices from CoinGecko API (so get the API key for it for a free account)
** Follow these steps to create a notion integration:**
- Click here → https://notion.so/my-integrations/ (once you open this link in your browser, the website may ask you to login to your notion account)
- Make
+ New Integration
button
-
Fill in the
Basic Information:
, you can set the following values:- Type →
Internal
- Associated Workspace → Choose your notion account’s workspace
- Name →
Stock Profits Tracker
- Type →
-
You’ll be on a webpage called
Secrets
Copy & Paste the above 🔑
Notion Integration Secret Key
in my_variable.yml 🔒 file.
- Create a new notion page & click on the three dots
...
in the top right corner of the duplicate notion template - Click on
+ Connections
at the end of the the drop down, - Select (
Stock Profits Tracker
)
- Create a notion database by typing
/database
. - Select
Database - Inline
- Create the following column with names:
a.
Name
→ for coin Name (BTC) b.api id
→ Add the amount you bought the stock units with c.Current Price
→ Get's the current price
💡 The above is only for live price tracking,.
💡 You can add more live columns supported by coinGecko by changing the code.
💡 Feel free to add any other columns on top of this as you like. Like your avg buy price
etc.
- Get database ID.
a. Click on 3 dots
...
of the database you create b. ClickCopy Link To View
. c. Open the copied URL in a new page.
https://www.notion.so/fer6ff3d5fcs3dff1d2134349192cc?v=4rf43545...
|---------Database ID----------|
Copy & Paste the above 🔑
Database ID
in my_variable.yml 🔒 file.
The final part of the integration is about running a python script that will update the real stock prices for all the stock units you have in the database.
-
Clone this GitHub repository
-
Save the secret notion integration token in the
my_variables.yml
fileMY_NOTION_SECRET_TOKEN: paste-your-notion-integration-token-here
-
Install the python requirements and dependency libraries by running the command in your terminal
python3 -m pip3 install -r requirements.txt
-
Finally run this command in your terminal to start the live
Price/Unit
update processpython3 main.py
The following project has been inspired by a US stock portfolio github project by github user tnvMadhav