Skip to main content

Anyone having a working financial stock price integration up and running?

  • November 24, 2022
  • 8 replies
  • 300 views

Forum|alt.badge.img+7

Hi,
Does anyone have a working integration, where stock prices are automatically (eg timebased refresh) fetched into an airtable sheet, depending on eg ISIN, etc. I just found quite old posts and only one newer video (How to Track Stocks in Airtable - YouTube), but the script link in the video is outdated… So any help with providing a script, etc. would be highly appreciated.

thanks a lot, Chris

This topic has been closed for replies.

8 replies

ScottWorld
Forum|alt.badge.img+35
  • Genius
  • November 25, 2022

Yes, you can very easily integrate Airtable with any stock price API by using Make’s advanced automations & integrations.

For example, here’s one of the hundreds of stock price APIs to choose from on the web: https://eodhd.com

Make doesn’t natively support any stock price APIs, so you would just need to write your own custom API calls by using Make’s HTTP modules.

Any expert Airtable consultant should be able to help you write these API calls, because they’re just standard REST API calls.

If you’ve never used Make before, I’ve assembled a bunch of Make training resources in this thread. For example, here is one of the ways that you could instantly trigger a Make automation from Airtable. And in this video, I show how to work with Airtable arrays in Make.

BTW: Zapier competes against Make, but I would highly recommend staying away from Zapier for the reasons that I outline in this thread. Make is INFINITELY more powerful & customizable than Zapier, yet it is SIGNIFICANTLY CHEAPER than Zapier.

Hope this helps!

If you’d like to hire the best Airtable consultant to help you with this or anything that is Airtable-related, please feel free to contact me through my website: Airtable consultant — ScottWorld


Greg_F
Forum|alt.badge.img+18
  • Brainy
  • November 25, 2022

Hi @Christian_L,

No-code approach
I have built an integration using Make.com and financialmodelingprep.com (their full API docs here Free Stock Market API and Financial Statements API - FMP API). They have a very decent free plan, so you can test out if it works for you. Apart from the price tickers, they also offer access to SEC filing data, so could be quite a good way to source quickly bunch of annual report figures if you are looking at fundamentals.

For the no-code version with Make you can checkout my video below:

Code approach:
If would prefer to use the code, you can use a scheduled automation to run a script e.g. daily. The scripting block in extensions, will not work due to CORS with this API.

Below script works with the free version of FMP, so it needs to request stock symbols one by one. If you go for the paid version, you can combine multiple stock symbols in one request /quote/AAPL,META,GOOG etc.

const table = base.getTable("Stock Quotes");
const result = await table.selectRecordsAsync({fields: ['Symbol']});

const baseUrl= "https://financialmodelingprep.com/api/v3/quote/"
const apiKey=  "Your API key here"


let recordsToUpdate = []

for (let record of result.records){
    const stockSymbol  = record.getCellValue("Symbol")
    const request  = await fetch(baseUrl+stockSymbol+"?apikey="+apiKey)
    const data = await request.json()
    console.log(data)
    /*  will return object in this  shape
    [ {
    "symbol" : "AAPL",
    "name" : "Apple Inc.",
    "price" : 151.07,
    "changesPercentage" : 0.5926,
    "change" : 0.89,
    "dayLow" : 149.34,
    "dayHigh" : 151.81,
    "yearHigh" : 182.94,
    "yearLow" : 129.04,
    "marketCap" : 2403236681503,
    "priceAvg50" : 146.617,
    "priceAvg200" : 154.736,
    "volume" : 55916992,
    "avgVolume" : 90413055,
    "exchange" : "NASDAQ",
    "open" : 149.45,
    "previousClose" : 150.18,
    "eps" : 6.05,
    "pe" : 24.97,
    "earningsAnnouncement" : "2023-01-25T10:59:00.000+0000",
    "sharesOutstanding" : 15908100096,
    "timestamp" : 1669237204
    } ]*/


    //adding  records to  batch  update
    if(data[0]) recordsToUpdate.push({
        id:record.id,
        fields: {
            "Price": data[0].price
        }
    })

}

while (recordsToUpdate.length > 0) {
    await table.updateRecordsAsync(recordsToUpdate.slice(0, 50));
    recordsToUpdate = recordsToUpdate.slice(50);
}

I hope that helps!


Forum|alt.badge.img+7
  • Author
  • Participating Frequently
  • November 26, 2022

Hi @Greg_F and @ScottWorld : thnks a lot for the fast and very detailed inputs! I playes around and finally ended up with combining make.com and yahoo finance API. This provides even more data as I expected, is free and works flawlessly. thnks & all the best!


ScottWorld
Forum|alt.badge.img+35
  • Genius
  • November 26, 2022

Hi @Greg_F and @ScottWorld : thnks a lot for the fast and very detailed inputs! I playes around and finally ended up with combining make.com and yahoo finance API. This provides even more data as I expected, is free and works flawlessly. thnks & all the best!

 

@Christian_L That’s great! I was actually looking for the documentation for the Yahoo Finance API when I wrote you my original reply above, but I couldn’t find it. Can you point me to Yahoo’s documentation on this?

- ScottWorld, Expert Airtable Consultant

 


Forum|alt.badge.img+7
  • Author
  • Participating Frequently
  • November 27, 2022

@Christian_L That’s great! I was actually looking for the documentation for the Yahoo Finance API when I wrote you my original reply above, but I couldn’t find it. Can you point me to Yahoo’s documentation on this?


@ScottWorld I used Yahoo Finance API Guide & Examples. In make.com an http request with the ticker and thats it…


ScottWorld
Forum|alt.badge.img+35
  • Genius
  • November 27, 2022

Thanks, I had found that guide too, but I couldn’t find anything official on Yahoo’s website regarding this.

- ScottWorld, Expert Airtable Consultant 


Forum|alt.badge.img+2
  • New Participant
  • May 28, 2024

Hi @Christian_L,

No-code approach
I have built an integration using Make.com and financialmodelingprep.com (their full API docs here Free Stock Market API and Financial Statements API - FMP API). They have a very decent free plan, so you can test out if it works for you. Apart from the price tickers, they also offer access to SEC filing data, so could be quite a good way to source quickly bunch of annual report figures if you are looking at fundamentals.

For the no-code version with Make you can checkout my video below:

Code approach:
If would prefer to use the code, you can use a scheduled automation to run a script e.g. daily. The scripting block in extensions, will not work due to CORS with this API.

Below script works with the free version of FMP, so it needs to request stock symbols one by one. If you go for the paid version, you can combine multiple stock symbols in one request /quote/AAPL,META,GOOG etc.

const table = base.getTable("Stock Quotes");
const result = await table.selectRecordsAsync({fields: ['Symbol']});

const baseUrl= "https://financialmodelingprep.com/api/v3/quote/"
const apiKey=  "Your API key here"


let recordsToUpdate = []

for (let record of result.records){
    const stockSymbol  = record.getCellValue("Symbol")
    const request  = await fetch(baseUrl+stockSymbol+"?apikey="+apiKey)
    const data = await request.json()
    console.log(data)
    /*  will return object in this  shape
    [ {
    "symbol" : "AAPL",
    "name" : "Apple Inc.",
    "price" : 151.07,
    "changesPercentage" : 0.5926,
    "change" : 0.89,
    "dayLow" : 149.34,
    "dayHigh" : 151.81,
    "yearHigh" : 182.94,
    "yearLow" : 129.04,
    "marketCap" : 2403236681503,
    "priceAvg50" : 146.617,
    "priceAvg200" : 154.736,
    "volume" : 55916992,
    "avgVolume" : 90413055,
    "exchange" : "NASDAQ",
    "open" : 149.45,
    "previousClose" : 150.18,
    "eps" : 6.05,
    "pe" : 24.97,
    "earningsAnnouncement" : "2023-01-25T10:59:00.000+0000",
    "sharesOutstanding" : 15908100096,
    "timestamp" : 1669237204
    } ]*/


    //adding  records to  batch  update
    if(data[0]) recordsToUpdate.push({
        id:record.id,
        fields: {
            "Price": data[0].price
        }
    })

}

while (recordsToUpdate.length > 0) {
    await table.updateRecordsAsync(recordsToUpdate.slice(0, 50));
    recordsToUpdate = recordsToUpdate.slice(50);
}

I hope that helps!


This is fantastic @Greg_F .  Is the code approach specific to airtable or Make?   I'm not familiar with either's scripting approach?   I watched your video and its absolutely excellent.  I'm a long term user of FMP but have struggled with really leveraging it.  This will up my game.   


Greg_F
Forum|alt.badge.img+18
  • Brainy
  • May 28, 2024

@lprevost The code approach is what you would use inside of Airtable automation - this could be an alternative to Make. Glad this is useful!