Help with Dolar Price API

I has this API: https://dolarapi.com/v1/dolares/blue
today its returns: {“moneda”:“USD”,“casa”:“blue”,“nombre”:“Blue”,“compra”:905,“venta”:925,“fechaActualizacion”:“2023-11-14T19:54:00.000Z”}

but im only need the “compra” and “venta” info.
How can I catch it with the nightbot?

Hey @cristianvbr!

The API returns a JSON object, so you just have to read its keys:

$(eval const response = $(urlfetch json https://dolarapi.com/v1/dolares/blue); `Compra: ${response.compra} | Venta: ${response.venta}`;)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.