-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
I use this api in Google Sheets to get the latest dollar blue price in a cell to use in other fomulaes.
Currently, sheets doesn't have a way to import and read from JSON format directly, I have to import the raw JSON and use a RegEx to extract the value:
=TEXT(REGEXEXTRACT(IMPORTDATA("https://api.bluelytics.com.ar/v2/latest","|"),"blue.+?value_buy.+?([\d\.]+)"), "0.00")
It works, but is a bit messy.
Sheets has a function to import and read XML, and the formula would be cleaner and less error prone:
=TEXT(IMPORTXML("https://api.bluelytics.com.ar/v2/latest.xml", "result/blue/buy"), "0.00")
Assuming the response is:
<result>
<official>
<valueavg>XXXX</valueavg>
<valuesell>XXXX</valuesell>
<valuebuy>XXXX</valuebuy>
</official>
<blue>
<valueavg>XXXX</valueavg>
<valuesell>XXXX</valuesell>
<valuebuy>XXXX</valuebuy>
</blue>
...
<lastupdate>2024-12-11T12:16:12.015118-03:00</lastupdate>
</result>
Format parameter could be as an "extension": /v2/latest.xml or a query param ?format=xml
I would submit a PR myself buy don't know golang.
This API is great and very useful, thanks for the effort!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels