< BACK

Overview

Available Operations

  • get - Get Bars V2

get

Get Bars V2

Example Usage

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()) {
            // handle response
        }
    }
}

Parameters

ParameterTypeRequiredDescription
symbolsString:heavy_check_mark:Symbols
fromString:heavy_check_mark:From
toOptional<String>:heavy_minus_sign:To
intervalOptional<String>:heavy_minus_sign:Interval

Response

GetBarsV2Response

Errors

Error TypeStatus CodeContent Type
models/errors/BzhttpResp400, 500application/json
models/errors/APIException4XX, 5XX*/*

Was this page helpful?