๐Ÿ“ˆ Track investments using Baserow and n8n

โšก 6,446 views ยท ๐Ÿ“ˆ Crypto Trading & Stock Market

๐Ÿ’ก Pro Tip โ€” HTTP Request scraping tends to break when sites update their markup. If youโ€™re scraping a major platform, check if ScraperNode covers it โ€” it has maintained scrapers for LinkedIn, Instagram, TikTok, YouTube, and 20+ other platforms that return structured data.

View All Scrapers

Description

This workflow uses a number of technologies to track the value of ETFs, stocks and other exchange-traded products:

Thanks to n8n, the steps in this workflow can easily be changed. Not a Sendgrid user? Simply remove the Sendgrid node and add a Gmail node instead. The stock exchange has a REST API? Just throw away the HTML Extract node.

Hereโ€™s how it works:

Data Source

In this scenario, our data source is Baserow. In our table, weโ€™ll track all information needed to identify each investment product:

image.png

We have two text type columns (Name and ISIN) as well as two number type columns (Count and Purchase Price).

Workflow

image.png

Nodes

1. Cron

The Cron node will trigger our workflow to run each work day in the morning hours.

2. Baserow

The Baserow node will fetch our investments from the database table shown above.

3. HTTP Request

Using the HTTP Request node we can fetch live data from the stock exchange of our choice based on the ISIN. This example uses Tradegate, which is used by many German fintechs. The basic approach should also work for other exchanges, as long as they provide the required data to the public.

4. HTML Extract

Since our HTTP Request node fetches full websites, weโ€™re using the HTML Extract node to extract the information weโ€™re looking for from each website. If an exchange other than Tradegate is used, the selectors used in this node will most likely need to be updated.

5. + 6. Set

The Set nodes helps with setting the exact columns weโ€™ll use in our table. In this case weโ€™re first formatting the results from our exchange, then calculate the changes based on the purchase price.

7. Function

Here were using a bit of Javascript magic to build an HTML email. This is where any changes to the email content would have to be made.

8. Sendgrid

Finally we send out the email built in the previous step. This is where you can configure sender and recipients.

Result

The basic email generated by this workflow will look like so:

image.png

๐Ÿ”— Nodes Used

Cron, Function, HTTP Request, Start, HTML Extract, SendGrid

๐Ÿ“ฅ Import

Download workflow.json and import into n8n: Workflow menu โ†’ Import from File

๐Ÿ“– Importing guide ยท ๐Ÿ”‘ Credential setup