# Mercado Financeiro

> Dados financeiros atualizados e precisos.

A **HG Finance** reúne diversos conjuntos de dados essenciais para o monitoramento do mercado financeiro. Com ela, você poderá:

- Acessar **cotações de moedas e ativos** (como ações e FIIs);
- Consultar **índices de mercado**, inclusive os que exibem altas e baixas;
- Obter informações sobre **criptomoedas** a partir de múltiplas exchanges;
- Recuperar as principais **taxas de juros** do Brasil (CDI, SELIC, etc.);
- Consultar **dados históricos** para análises e projeções.

Esta página serve como ponto de partida para entender a estrutura geral da API, como autenticar suas requisições e quais formatos de resposta estão disponíveis.

<callout color="neutral" icon="tabler:key" to="/docs/guide/key">

Para acessar os dados da API é necessário utilizar uma chave de integração.

</callout>

<note icon="tabler:clock">

As cotações são atualizadas em intervalos de 15 a 45 minutos durante o pregão.

</note>

## Requisição

Todas as requisições tem como base o seguinte endpoint:

<endpoint endpoint="/finance">



</endpoint>

<request-example endpoint="/finance">



</request-example>

## Resposta

Exemplo de resposta no formato `JSON`.

<response-json endpoint="/finance">



</response-json>

### Campos

Os dados referentes à consulta chegam no parâmetro `results`, você também pode conferir a autenticação de sua chave no parâmetro de retorno `valid_key`.

<field-group>
<field name="currencies" type="object">

Cotação das moedas.

<table>
<thead>
  <tr>
    <th>
      Campo
    </th>
    
    <th>
      Tipo
    </th>
    
    <th>
      Descrição
    </th>
    
    <th>
      Exemplo
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        source
      </code>
    </td>
    
    <td>
      <code className="language-ts-type shiki shiki-themes one-light one-dark-pro one-dark-pro" language="ts-type" style="">
        <span class="s3iYH">
          string
        </span>
      </code>
    </td>
    
    <td>
      Código ISO da moeda base da cotação.
    </td>
    
    <td>
      BRL
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        [iso]
      </code>
    </td>
    
    <td>
      <code className="language-ts-type shiki shiki-themes one-light one-dark-pro one-dark-pro" language="ts-type" style="">
        <span class="s3iYH">
          object
        </span>
      </code>
    </td>
    
    <td>
      Código ISO da moeda destino.
    </td>
    
    <td>
      USD
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        [iso].name
      </code>
    </td>
    
    <td>
      <code className="language-ts-type shiki shiki-themes one-light one-dark-pro one-dark-pro" language="ts-type" style="">
        <span class="s3iYH">
          string
        </span>
      </code>
    </td>
    
    <td>
      Nome da moeda.
    </td>
    
    <td>
      Dollar
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        [iso].buy
      </code>
    </td>
    
    <td>
      <code className="language-ts-type shiki shiki-themes one-light one-dark-pro one-dark-pro" language="ts-type" style="">
        <span class="s3iYH">
          number
        </span>
      </code>
    </td>
    
    <td>
      Valor de compra.
    </td>
    
    <td>
      5.7276
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        [iso].sell
      </code>
    </td>
    
    <td>
      <code className="language-ts-type shiki shiki-themes one-light one-dark-pro one-dark-pro" language="ts-type" style="">
        <span class="s3iYH">
          number
        </span>
      </code>
    </td>
    
    <td>
      Valor de venda.
    </td>
    
    <td>
      5.7274
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        [iso].variation
      </code>
    </td>
    
    <td>
      <code className="language-ts-type shiki shiki-themes one-light one-dark-pro one-dark-pro" language="ts-type" style="">
        <span class="s3iYH">
          number
        </span>
      </code>
    </td>
    
    <td>
      Variação em percentual referente à última hora útil anterior.
    </td>
    
    <td>
      -0.021
    </td>
  </tr>
</tbody>
</table>
</field>

<field name="stocks" type="object">

Posições dos principais mercados.

<table>
<thead>
  <tr>
    <th>
      Campo
    </th>
    
    <th>
      Tipo
    </th>
    
    <th>
      Descrição
    </th>
    
    <th>
      Exemplo
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        [index]
      </code>
    </td>
    
    <td>
      <code className="language-ts-type shiki shiki-themes one-light one-dark-pro one-dark-pro" language="ts-type" style="">
        <span class="s3iYH">
          object
        </span>
      </code>
    </td>
    
    <td>
      Dados do índice de mercado.
    </td>
    
    <td>
      Ibovespa
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        [index].name
      </code>
    </td>
    
    <td>
      <code className="language-ts-type shiki shiki-themes one-light one-dark-pro one-dark-pro" language="ts-type" style="">
        <span class="s3iYH">
          string
        </span>
      </code>
    </td>
    
    <td>
      Nome do índice.
    </td>
    
    <td>
      BM&F BOVESPA
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        [index].location
      </code>
    </td>
    
    <td>
      <code className="language-ts-type shiki shiki-themes one-light one-dark-pro one-dark-pro" language="ts-type" style="">
        <span class="s3iYH">
          string
        </span>
      </code>
    </td>
    
    <td>
      Localização do mercado.
    </td>
    
    <td>
      Sao Paulo, Brazil
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        [index].points
      </code>
    </td>
    
    <td>
      <code className="language-ts-type shiki shiki-themes one-light one-dark-pro one-dark-pro" language="ts-type" style="">
        <span class="s3iYH">
          number
        </span>
      </code>
    </td>
    
    <td>
      Pontos (somente Ibovespa).
    </td>
    
    <td>
      126571.9
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        [index].variation
      </code>
    </td>
    
    <td>
      <code className="language-ts-type shiki shiki-themes one-light one-dark-pro one-dark-pro" language="ts-type" style="">
        <span class="s3iYH">
          number
        </span>
      </code>
    </td>
    
    <td>
      Variação em percentual referente à última hora útil anterior.
    </td>
    
    <td>
      -0.44
    </td>
  </tr>
</tbody>
</table>
</field>

<field name="bitcoin" type="object">

Cotação do Bitcoin nas principais corretoras.

<table>
<thead>
  <tr>
    <th>
      Campo
    </th>
    
    <th>
      Tipo
    </th>
    
    <th>
      Descrição
    </th>
    
    <th>
      Exemplo
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        [broker]
      </code>
    </td>
    
    <td>
      <code className="language-ts-type shiki shiki-themes one-light one-dark-pro one-dark-pro" language="ts-type" style="">
        <span class="s3iYH">
          object
        </span>
      </code>
    </td>
    
    <td>
      Dados da corretora.
    </td>
    
    <td>
      blockchain_info
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        [broker].name
      </code>
    </td>
    
    <td>
      <code className="language-ts-type shiki shiki-themes one-light one-dark-pro one-dark-pro" language="ts-type" style="">
        <span class="s3iYH">
          string
        </span>
      </code>
    </td>
    
    <td>
      Nome da corretora.
    </td>
    
    <td>
      Blockchain.info
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        [broker].format
      </code>
    </td>
    
    <td>
      <code className="language-ts-type shiki shiki-themes one-light one-dark-pro one-dark-pro" language="ts-type" style="">
        <span class="sE6NF">
          Array
        </span>
      </code>
    </td>
    
    <td>
      Array com moeda base e idioma da moeda.
    </td>
    
    <td>
      <code className="language-json shiki shiki-themes one-light one-dark-pro one-dark-pro" language="json" style="">
        <span class="sFmRJ">
          [
        </span>
        
        <span class="s8ZqH">
          "USD"
        </span>
        
        <span class="sFmRJ">
          ,
        </span>
        
        <span class="s8ZqH">
          "en_US"
        </span>
        
        <span class="sFmRJ">
          ]
        </span>
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        [broker].last
      </code>
    </td>
    
    <td>
      <code className="language-ts-type shiki shiki-themes one-light one-dark-pro one-dark-pro" language="ts-type" style="">
        <span class="s3iYH">
          number
        </span>
      </code>
    </td>
    
    <td>
      Última posição (cotação atual).
    </td>
    
    <td>
      93989.45
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        [broker].buy
      </code>
    </td>
    
    <td>
      <code className="language-ts-type shiki shiki-themes one-light one-dark-pro one-dark-pro" language="ts-type" style="">
        <span class="s3iYH">
          number
        </span>
      </code>
    </td>
    
    <td>
      Valor para compra (pode não estar disponível).
    </td>
    
    <td>
      93989.45
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        [broker].sell
      </code>
    </td>
    
    <td>
      <code className="language-ts-type shiki shiki-themes one-light one-dark-pro one-dark-pro" language="ts-type" style="">
        <span class="s3iYH">
          number
        </span>
      </code>
    </td>
    
    <td>
      Valor para venda (pode não estar disponível).
    </td>
    
    <td>
      93989.45
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        [broker].variation
      </code>
    </td>
    
    <td>
      <code className="language-ts-type shiki shiki-themes one-light one-dark-pro one-dark-pro" language="ts-type" style="">
        <span class="s3iYH">
          number
        </span>
      </code>
    </td>
    
    <td>
      Variação em percentual referente à última hora útil anterior.
    </td>
    
    <td>
      -1.245
    </td>
  </tr>
</tbody>
</table>
</field>

<field name="taxes" type="array">

Taxas de juros do Brasil.

<table>
<thead>
  <tr>
    <th>
      Campo
    </th>
    
    <th>
      Tipo
    </th>
    
    <th>
      Descrição
    </th>
    
    <th>
      Exemplo
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        [].date
      </code>
    </td>
    
    <td>
      <code className="language-ts-type shiki shiki-themes one-light one-dark-pro one-dark-pro" language="ts-type" style="">
        <span class="s3iYH">
          string
        </span>
      </code>
    </td>
    
    <td>
      Data de referência.
    </td>
    
    <td>
      2025-02-27
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        [].cdi
      </code>
    </td>
    
    <td>
      <code className="language-ts-type shiki shiki-themes one-light one-dark-pro one-dark-pro" language="ts-type" style="">
        <span class="s3iYH">
          number
        </span>
      </code>
    </td>
    
    <td>
      Taxa CDI em percentual.
    </td>
    
    <td>
      13.25
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        [].selic
      </code>
    </td>
    
    <td>
      <code className="language-ts-type shiki shiki-themes one-light one-dark-pro one-dark-pro" language="ts-type" style="">
        <span class="s3iYH">
          number
        </span>
      </code>
    </td>
    
    <td>
      Taxa Selic em percentual.
    </td>
    
    <td>
      13.25
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        [].daily_factor
      </code>
    </td>
    
    <td>
      <code className="language-ts-type shiki shiki-themes one-light one-dark-pro one-dark-pro" language="ts-type" style="">
        <span class="s3iYH">
          number
        </span>
      </code>
    </td>
    
    <td>
      Fator diário.
    </td>
    
    <td>
      1.00049037
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        [].selic_daily
      </code>
    </td>
    
    <td>
      <code className="language-ts-type shiki shiki-themes one-light one-dark-pro one-dark-pro" language="ts-type" style="">
        <span class="s3iYH">
          number
        </span>
      </code>
    </td>
    
    <td>
      Taxa Selic diária em percentual.
    </td>
    
    <td>
      13.15
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        [].cdi_daily
      </code>
    </td>
    
    <td>
      <code className="language-ts-type shiki shiki-themes one-light one-dark-pro one-dark-pro" language="ts-type" style="">
        <span class="s3iYH">
          number
        </span>
      </code>
    </td>
    
    <td>
      Taxa CDI diária em percentual.
    </td>
    
    <td>
      13.15
    </td>
  </tr>
</tbody>
</table>
</field>
</field-group>
