Back to blog

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:

  1. Go to Financial Modeling Prep
  2. Sign up for a free account
  3. Go to your dashboard
  4. Copy your API key

Step 2: Connect your Notion workspace

Now we'll connect Otera to your Notion workspace:

  1. Log into your Otera dashboard
  2. Click Create Request
  3. Select Connect to Notion
  4. Authorize Otera to access your Notion workspace
  5. Choose the database where you want to store your stock data
  6. 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 NameExample ValueProperty TypeNotes
SymbolAAPLTitleStock ticker symbol
NameAppleTextCompany name
Purchase price150.00NumberYour buy price
Price(auto-filled)NumberCurrent stock price
Change(auto-filled)FormulaUse 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.

Notion database

Step 4: Configure the stock API request

Click Set request options to configure the request:

  1. Use the Method GET
  2. Update the URL to https://financialmodelingprep.com/api/v3/quote/AAPL,META,GOOG?apikey=YOUR_API_KEY
  3. 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

Configure request

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

Map database fields

Step 6: Set output options

Since this request should update existing stock records, here are the output options we need:

  1. For Request type, choose Run once
  2. For Output mode, choose Overwrite
  3. For Update based on matching unique fields, choose symbol as a source field and Symbol as a Notion field
  4. Click Next

Output options

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.

Generated stock data

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:

  1. Click Set recurring schedule
  2. Toggle Schedule this request
  3. Update your scheduling options
  4. Click Schedule request

Set a schedule

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.

Ready to get the most out of Notion?