Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Gjakova
Post Patron
Post Patron

How can I retrieve multiple stock at once?

Hi there,

I am using the Alpha Vantage API and I would like to retrieve stock data from like 200 companies or so. The only problem I have, is that in order to do that, I have to manually insert the link 200 times. Is there a way to automate this and how?

I looked into functions, but it seems like a maze. I can't figure out where to start and which function to use.

My script for Apple stock looks like this:

 

let
Source = Json.Document(Web.Contents("https://www.alphavantage.co/" & "query?function=TIME_SERIES_DAILY" & "&symbol=AAPL" & "&outputsize=full" & "&apikey=1234567890")),
#"Time Series (Daily)" = Source[#"Time Series (Daily)"],
#"Converted to Table" = Record.ToTable(#"Time Series (Daily)"),
#"Expanded Value" = Table.ExpandRecordColumn(#"Converted to Table", "Value", {"1. open", "2. high", "3. low", "4. close", "5. volume"}, {"1. open", "2. high", "3. low", "4. close", "5. volume"})
in
#"Expanded Value"

 

Now I want to replace &symbol=AAPL for a function, so I could retrieve multiple stock from Google, Netflix, Tesla etc. at once.

I created an Excel file with the stock names of 100 different companies. I look at this blog: https://adatis.co.uk/Loop-through-Multiple-Web-Pages-using-Power-Query/ to do the same trick, but since he is using years, I can't seem to duplicate it.
Could someone help me out please? Thanks in advance!

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

Please see this recent post

 

https://community.powerbi.com/t5/Desktop/Pulling-Historic-Stock-Market-Information/m-p/1189365#M5336...

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

1 REPLY 1
mahoneypat
Microsoft Employee
Microsoft Employee

Please see this recent post

 

https://community.powerbi.com/t5/Desktop/Pulling-Historic-Stock-Market-Information/m-p/1189365#M5336...

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.