Cotações
GET
https://br.dolarapi.com/v1/cotacoesCotações das principais moedas em reais brasileiros
Respuestas
Retorna as cotações
application/json
JSON
[
{
"compra": 0,
"venda": 0,
"fechoAnterior": 0,
"nome": "string",
"moeda": "string",
"dataAtualizacao": "string"
}
]
GET
https://br.dolarapi.com/v1/cotacoesEjemplos
cURL
curl -X GET \
'https://br.dolarapi.com/v1/cotacoes'
JavaScript
fetch('https://br.dolarapi.com/v1/cotacoes')
.then(response => response.json())
.then(data => console.log(data));
PHP
<?php
$url = 'https://br.dolarapi.com/v1/cotacoes';
$method = 'GET';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
Python
import requests
url = 'https://br.dolarapi.com/v1/cotacoes'
response = requests.get(url)
print(response.json())