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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Lud8080
Frequent Visitor

Create new column to get stock prices with API

Good morning all,

Hope someone can help me. I need to create a new column that shows the price of a specific asset trough an API.

API link is like this:

https://api.binance.com/api/v3/ticker/price?symbols=["BTCUSDT"]

1 - I need to replace this part of the API ["BTCUSDT"] with the first column named "Coin".

2 - Then to run the API and retrieve the price in the new coulmn I think I should use something like "" Text.From(Web.Contents([ColumnName]))"" or maybe some other formula.

 

Lud8080_1-1734426468488.png

 

 

Thank you very much 🙂

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

Something like this.  Note that access is restricted so you will need to provide authentication in the code.

 

 

let
  Source = #table({"Coin"}, {{"BTC"}, {"ETH"}, {"SOL"}}), 
  #"Added Custom" = Table.AddColumn(
    Source, 
    "Data", 
    each Web.Contents(
      "https://api.binance.com/api/v3/ticker/price", 
      [Query = [symbols = [Coin] & "USDT"]]
    )
  )
in
  #"Added Custom"

 

View solution in original post

1 REPLY 1
lbendlin
Super User
Super User

Something like this.  Note that access is restricted so you will need to provide authentication in the code.

 

 

let
  Source = #table({"Coin"}, {{"BTC"}, {"ETH"}, {"SOL"}}), 
  #"Added Custom" = Table.AddColumn(
    Source, 
    "Data", 
    each Web.Contents(
      "https://api.binance.com/api/v3/ticker/price", 
      [Query = [symbols = [Coin] & "USDT"]]
    )
  )
in
  #"Added Custom"

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.