Dynamic URL Change with Date

Alex87

New Member
Joined
Jul 20, 2021
Messages
1
Office Version
  1. 2019
Platform
  1. Windows
Hi together,

I want to automate the query for the API URL from Coingecko. I have a Column in Excel where i want to load in the Date and on the Output must be the Price. It works for one Column but not for the complete row. How can I do this dynamic for several Dates in a row?

Excel Formula:
let

Year = Number.ToText(Date.Year(Date.From(Excel.CurrentWorkbook(){[Name="history_date_Abfrage_Kurstag"]}[Content]{0}[Datum]))),
  Month = Number.ToText(Date.Month(Date.From(Excel.CurrentWorkbook(){[Name="history_date_Abfrage_Kurstag"]}[Content]{0}[Datum]))),
Day = Number.ToText(Date.Day(Date.From(Excel.CurrentWorkbook(){[Name="history_date_Abfrage_Kurstag"]}[Content]{0}[Datum]))),
D=Text.Combine({Day, Month, Year}, "-"),
    Quelle = Json.Document(Web.Contents("https://api.coingecko.com/api/v3/coins/litecoin/history?date="&D)),
    market_data = Quelle[market_data],
    current_price = market_data[current_price],
    #"In Tabelle konvertiert" = Record.ToTable(current_price),
    #"Gefilterte Zeilen" = Table.SelectRows(#"In Tabelle konvertiert", each ([Name] = "eur"))
in
    #"Gefilterte Zeilen"


Thank you so much!
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

Forum statistics

Threads
1,215,999
Messages
6,128,186
Members
449,431
Latest member
Taekwon

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top