How can i integrate stock prices of yahoo.finance

How can i integrate stock prices on a simple way in my tables ?
for example: msft.nms; appal.nms; …

Thank you for any help in this manner…
Adrian

Hi @VBSG.

You can use a automation service like https://n8n.io/ or https://www.make.com/en. Those services do have SeaTable Plugins which you can use to connect to your bases.

Another way can be to write your own python script.

2 Likes

Dear VBSG,

I’m excited to share two potential methods for creating your SeaTable “stock price watching app.”

As mentioned by @AkDk7, you have two options: either coding a Python script or utilizing an automation tool like https://n8n.io. Below, I’ll outline how I approached this challenge.

Preparation: Finding a public stock price service with an API

The initial step involves identifying a source for stock prices. A quick search for “stock price public API” led me to a comprehensive page: Top 8 Stock Market APIs for Developers in 2023."

After a brief exploration, I registered on twelvedata.com. They offer a free subscription allowing up to 800 API requests daily. Their API documentation is thorough and well-structured API Documentation - Twelve Data.

Upon registration, I obtained my private Twelve Data API key and familiarized myself with the API endpoint to retrieve data:

GET https://api.twelvedata.com/price?symbol={symbol}&apikey={apikey}

Python Script Creation

Initially, I asked ChatGPT to generate a basic Python script to acquire the stock price, for instance, of Apple. The script provided by ChatGPT efficiently fetched the current stock price.

Building upon that foundation, I expanded the script to extract symbols from a SeaTable Base and update the stock prices. This modification took around 15 minutes, and the finalized script is available in the examples within the developer manual.

Utilizing n8n

Alternatively, leveraging n8n allows achieving the same result without coding. By creating a new workflow, consider the necessary steps:

  1. Retrieve the symbol from SeaTable.
  2. Make an API request to acquire the current stock price.
  3. Update SeaTable with the obtained result.

Creating this workflow merely took a minute.

get-stock-prices-from-seatable

Summary

Both approaches yield the desired outcome. Your choice depends on your comfort with Python or your preferred method. Currently, both solutions focus on retrieving “current” prices but could easily expand to create timelines or compare current prices with purchase prices, among other functionalities.

Should you have any questions, please feel free to reach out.
Christoph

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.