com.barchart.base:barchart-ondemand-client

barchart-ondemand-client

License

License

Categories

Categories

CLI User Interface
GroupId

GroupId

com.barchart.base
ArtifactId

ArtifactId

barchart-ondemand-client
Last Version

Last Version

2.0.2
Release Date

Release Date

Type

Type

jar
Description

Description

barchart-ondemand-client
Project Organization

Project Organization

Barchart, Inc.
Source Code Management

Source Code Management

https://github.com/barchart/barchart-ondemand-client-java

Download barchart-ondemand-client

How to add to project

<!-- https://jarcasting.com/artifacts/com.barchart.base/barchart-ondemand-client/ -->
<dependency>
    <groupId>com.barchart.base</groupId>
    <artifactId>barchart-ondemand-client</artifactId>
    <version>2.0.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.barchart.base/barchart-ondemand-client/
implementation 'com.barchart.base:barchart-ondemand-client:2.0.2'
// https://jarcasting.com/artifacts/com.barchart.base/barchart-ondemand-client/
implementation ("com.barchart.base:barchart-ondemand-client:2.0.2")
'com.barchart.base:barchart-ondemand-client:jar:2.0.2'
<dependency org="com.barchart.base" name="barchart-ondemand-client" rev="2.0.2">
  <artifact name="barchart-ondemand-client" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.barchart.base', module='barchart-ondemand-client', version='2.0.2')
)
libraryDependencies += "com.barchart.base" % "barchart-ondemand-client" % "2.0.2"
[com.barchart.base/barchart-ondemand-client "2.0.2"]

Dependencies

compile (3)

Group / Artifact Type Version
com.fasterxml.jackson.core : jackson-core jar [2.1,2.2-rc1)
com.fasterxml.jackson.core : jackson-databind jar [2.1,2.2-rc1)
commons-lang : commons-lang jar [2.6,3-SNAPSHOT)

provided (4)

Group / Artifact Type Version
joda-time : joda-time jar [2.3,2.4-SNAPSHOT)
com.squareup.okhttp : okhttp jar 2.0.0
org.slf4j : slf4j-api jar 1.7.6
ch.qos.logback : logback-classic jar 1.1.2

test (1)

Group / Artifact Type Version
junit : junit jar 4.11

Project Modules

There are no modules declared in this project.

Java client for Barchart OnDemand

Check out some examples here

See how to use the client in your project here

Currently supports

  • getQuote
  • getQuoteEod
  • getEquitiesByExchange
  • getFuturesByExchange
  • getFuturesOptions
  • getShortDatedFuturesOptions
  • getProfile
  • getFinancialHighlights
  • getFinancialRatios
  • getIncomeStatements
  • getBalanceSheets
  • getCompetitors
  • getInsiders
  • getRatings
  • getIndexMembers
  • getCorporateActions
  • getEarningsEstimates
  • getLeaders
  • getHighsLows
  • getInstrumentDefinition
  • getFuturesSpecifications
  • getFuturesExpirations
  • getWeather
  • getUSDAGrainPrices

Example Code

private final BarchartOnDemandClient onDemand = new BarchartOnDemandClient.Builder().apiKey("CHANGE-ME").build();

/* build a new getQuotes request */
final QuoteRequest.Builder builder = new QuoteRequest.Builder();

/* add symbols to request */
builder.symbols(new String[] { "AAPL", "GOOG" });
/* set mode to real-time */
builder.mode(QuoteRequestMode.REAL_TIME);
/* add optional request fields */
builder.fields(new QuoteRequestField[] { QuoteRequestField._52_WEEK_HIGH_DATE });

/* fetch results */
final Quotes quotes = onDemand.fetch(builder.build());

for (Quote q : quotes.all()) {
	System.out.println("Quote for : " + q.getSymbol() + " = " + q);
}

System.out.println("Quote by symbol = " + JsonUtil.intoJson(quotes.bySymbol("AAPL")));

Adding to your project

Plain Jar

Download the latest version here

Maven
<!-- version 2 (latest) -->
<dependency>
	<groupId>com.barchart.base</groupId>
	<artifactId>barchart-ondemand-client</artifactId>
	<version>2.0.2</version>
</dependency>

<!-- version 1 (deprecated & frozen) -->
<dependency>
	<groupId>com.barchart.base</groupId>
	<artifactId>barchart-ondemand-client</artifactId>
	<version>1.0.20</version>
</dependency>
com.barchart.base

Barchart, Inc.

Versions

Version
2.0.2
2.0.1
1.0.20
1.0.14
1.0.13
1.0.3
1.0.2