How to Build an Automatic Stock Price Tracker in Notion
Want to track your favorite stocks directly in your Notion workspace? This tutorial shows you how to connect stock market APIs to your Notion databases.
Why connect stock data to Notion?
Stock data import allows you to fetch real-time market information and automatically save it to your Notion databases. This means that you can automate investment portfolio tracking right from Notion.
Step 1: Get a Financial Modeling Prep API key
First, you'll need a Financial Modeling Prep (FMP) API key to access stock data. You can use any stock API provider, but we like FMP for its accurate financial data and generous free tier (250 requests a day). Here's how to get a free API key:
- Go to Financial Modeling Prep
- Sign up for a free account
- Go to your dashboard
- Copy your API key
Step 2: Connect your Notion workspace
Now we'll connect Otera to your Notion workspace:
- Log into your Otera dashboard
- Click Create Request
- Select Connect to Notion
- Authorize Otera to access your Notion workspace
- Choose the database where you want to store your stock data
- Click Next
Need help with this step? Check out our detailed Notion connection guide.
Step 3: Set up your Notion database
Now let's create a Notion database that will work with stock data. We'll track Apple, Meta, and Google as our example. Create these database properties in your Notion database:
Property Name | Example Value | Property Type | Notes |
---|---|---|---|
Symbol | AAPL | Title | Stock ticker symbol |
Name | Apple | Text | Company name |
Purchase price | 150.00 | Number | Your buy price |
Price | (auto-filled) | Number | Current stock price |
Change | (auto-filled) | Formula | Use the formula: if(prop("Price") > 0, ((prop("Price")-prop("Purchase price"))/100), 0) . This tells Notion to show the change in current price and purchase price in percentage, but show 0% if the price hasn't been filled yet. |
Step 4: Configure the stock API request
Click Set request options to configure the request:
- Use the Method
GET
- Update the URL to
https://financialmodelingprep.com/api/v3/quote/AAPL,META,GOOG?apikey=YOUR_API_KEY
- Click Next
- replace
YOUR_API_KEY
with your actual API key from Step 1 - you can update the URL with any other stock symbols you'd like to track
Step 5: Map database fields
Now we need to tell Otera where to save the stock data. Click Map database fields to map the API response fields to your Notion database properties:
price
→ Price
Step 6: Set output options
Since this request should update existing stock records, here are the output options we need:
- For Request type, choose
Run once
- For Output mode, choose
Overwrite
- For Update based on matching unique fields, choose
symbol
as a source field andSymbol
as a Notion field - Click Next
This ensures each stock gets updated with the latest price without creating duplicate entries.
Step 7: Run the request
- Click Run request.
- Wait for the request to run.
- Check your Notion database. Your stock data should now be imported.
Import stock prices into Notion automatically
With an Otera Pro account, you can set this import to run automatically on an hourly, daily, or weekly schedule:
- Click Set recurring schedule
- Toggle Schedule this request
- Update your scheduling options
- Click Schedule request
Your import will now be handled automatically, giving you up-to-date stock prices without any manual work. With your stock data in Notion, you can even take advantage of powerful built-in features like chart visualizations.