> ## Documentation Index
> Fetch the complete documentation index at: https://docs.benzinga.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Barras

> bars()

[\< VOLVER](/es/sdks/languages/java#bars)

<div id="overview">
  ## Descripción general
</div>

<div id="available-operations">
  ### Operaciones disponibles
</div>

* [get](#get) - Obtener barras V2

<div id="get">
  ## get
</div>

Obtener barras V2

<div id="example-usage">
  ### Ejemplo de uso
</div>

```java theme={null}
package hello.world;

import java.lang.Exception;
import org.benzinga.BZClient.Bzclient;
import org.benzinga.BZClient.models.errors.BzhttpResp;
import org.benzinga.BZClient.models.operations.GetBarsV2Response;

public class Application {

    public static void main(String[] args) throws BzhttpResp, Exception {

        Bzclient sdk = Bzclient.builder()
                .apiKeyAuth("<YOUR_API_KEY_HERE>")
            .build();

        GetBarsV2Response res = sdk.bars().get()
                .symbols("<value>")
                .from("<value>")
                .to("<value>")
                .interval("<value>")
                .call();

        if (res.responseBodies().isPresent()) {
            // manejar la respuesta
        }
    }
}
```

<div id="parameters">
  ### Parámetros
</div>

| Parámetro  | Tipo                | Obligatorio          | Descripción                         |
| ---------- | ------------------- | -------------------- | ----------------------------------- |
| `symbols`  | *String*            | :heavy\_check\_mark: | Símbolos (lista separada por comas) |
| `from`     | *String*            | :heavy\_check\_mark: | Desde                               |
| `to`       | *Optional\<String>* | :heavy\_minus\_sign: | Hasta                               |
| `interval` | *Optional\<String>* | :heavy\_minus\_sign: | Intervalo                           |

<div id="response">
  ### Respuesta
</div>

**[GetBarsV2Response](../../models/operations/GetBarsV2Response.md)**

<div id="errors">
  ### Errores
</div>

| Tipo de error              | Código de estado | Tipo de contenido |
| -------------------------- | ---------------- | ----------------- |
| models/errors/BzhttpResp   | 400, 500         | application/json  |
| models/errors/APIException | 4XX, 5XX         | */*               |
