API de cotação da ação PETR4 em JSON
Consulte PETR4 (Petroleo Brasileiro SA) via REST: cotação e fundamentos em JSON, com exemplos em curl, Python e Node.
Indicadores de PETR4
| Nome | Petroleo Brasileiro SA |
|---|---|
| Último fechamento | R$ 41,78 (04/12/2026) |
| P/VP | 1,07 |
| Dividend yield | 8,72% |
| P/L | 3,83 |
| ROE | 27,82% |
curl
curl https://api.sldx.com.br/stock-price/PETR4
Este exemplo funciona sem cadastro.
Python
import requests
r = requests.get("https://api.sldx.com.br/stock-price/PETR4", timeout=10)
r.raise_for_status()
print(r.json())
Node.js 18+
const r = await fetch("https://api.sldx.com.br/stock-price/PETR4");
console.log(await r.json());
Formato da resposta
{
"success": true,
"result": {
"petr4": {
"exchange_code": "BVMF",
"name": "Petroleo Brasileiro SA",
"current_price": number,
"high_24h": number,
"low_24h": number,
"change_24h": number,
"lastUpdated": unix timestamp
}
}
}
Também: GET /stock-fundamentals/PETR4 (Free) e GET /stock-dividends/PETR4 (plano pago). Detalhes na documentação.