Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/authentication.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Authentication
# Authentication (Java SDK)

The Market Data API uses a **Bearer Token** for authentication. The token is required for almost every request. Your token should have been e-mailed to you when you first signed up for an account. If you do not have a token or have lost your sign-up email, request a new token from the [Market Data Dashboard](https://www.marketdata.app/dashboard/).

Expand Down Expand Up @@ -41,7 +41,7 @@ setx MARKETDATA_TOKEN "your_api_token"

The SDK automatically loads a `.env` file from your working directory at startup. Create a file named `.env` in your project root:

```env title=".env"
```ini title=".env"
MARKETDATA_TOKEN=your_api_token
```

Expand Down Expand Up @@ -111,7 +111,7 @@ MarketDataClient("your_token_here", null, null, true).use { client ->
```

> [!NOTE]
> **Demo mode**
> **[Demo mode]**
>
> If no token is found anywhere in the cascade, the SDK runs in **demo mode** — startup validation is skipped and you can call the free, public endpoints (such as `AAPL` quotes and `utilities().status()`).

Expand Down
10 changes: 5 additions & 5 deletions docs/client.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Client
# Client (Java SDK)

The `MarketDataClient` is the entry point to the SDK. It handles API requests, response parsing, rate-limit tracking, retries with exponential backoff, and logging. A single client gives you access to all five resources: stocks, options, funds, markets, and utilities.

The client is immutable, thread-safe, and `AutoCloseable`. Create one per application (it holds a shared HTTP client and a 50-request concurrency pool) and close it when you're done.

### Get Started Quickly
## Get Started Quickly

1. Review the [authentication documentation](./authentication.md) to learn how to set your API token.
2. Create a [`MarketDataClient`](#MarketDataClient) and use it to make requests.
2. Create a [`MarketDataClient`](#marketdataclient) and use it to make requests.
3. Reach a resource through `client.stocks()`, `client.options()`, etc.
4. Track your [rate limit](#rate-limits) to see how many API credits remain.
5. Configure [Settings](./settings.md) to customize output format, date format, and other universal parameters.
Expand Down Expand Up @@ -82,7 +82,7 @@ MarketDataClient("your_token", null, null, false).use { client ->
```

> [!NOTE]
> **Fail-fast configuration**
> **[Fail-fast configuration]**
>
> A misconfigured base URL or API version is rejected with an `IllegalArgumentException` **at construction**, not later on the first request. Tokens are never printed in full — the client's `toString()` redacts them (long tokens show only the last four characters; short ones are hidden entirely).

Expand Down Expand Up @@ -235,7 +235,7 @@ client.stocks().quoteAsync(StockQuoteRequest.of("AAPL"))
```

> [!NOTE]
> **`join()` vs `get()`**
> **[`join()` vs `get()`]**
>
> To block on a future, prefer **`join()`** — it throws an unchecked `CompletionException`. `get()` does the same thing but throws the checked `ExecutionException` (plus `InterruptedException`), forcing a `try/catch`. Both wrap the underlying cause identically, so `join()` is usually the friendlier choice.

Expand Down
4 changes: 2 additions & 2 deletions docs/funds/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Funds
# Funds (Java SDK)

The Java SDK from Market Data provides methods to streamline your use of the Funds endpoints. These methods provide a typed interface over the underlying HTTP requests and responses, with both sync and async variants.

Reach the resource through `client.funds()`. For CSV output use `client.funds().asCsv()`.

## Funds Endpoints

- [Candles](./candles.md)
- [Fund Candles (Java SDK)](./candles.md) — Retrieve a mutual fund net asset value OHLC series with the Java SDK FundCandlesRequest, choosing the resolution that you need.
2 changes: 1 addition & 1 deletion docs/funds/candles.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Candles
# Fund Candles (Java SDK)

Retrieve a mutual fund's NAV (net asset value) OHLC series.

Expand Down
2 changes: 1 addition & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Installation
# Installation (Java SDK)

This guide will help you install the Market Data Java SDK and configure it for your project.

Expand Down
4 changes: 2 additions & 2 deletions docs/markets/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Markets
# Markets (Java SDK)

The Java SDK from Market Data provides methods to streamline your use of the Markets endpoints. These methods provide a typed interface over the underlying HTTP requests and responses, with both sync and async variants.

Reach the resource through `client.markets()`. For CSV output use `client.markets().asCsv()`.

## Markets Endpoints

- [Status](./status.md)
- [Market Status (Java SDK)](./status.md)
2 changes: 1 addition & 1 deletion docs/markets/status.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Status
# Market Status (Java SDK)

Retrieve the exchange open/closed calendar — whether the market was (or will be) open on a given day.

Expand Down
10 changes: 5 additions & 5 deletions docs/options/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Options
# Options (Java SDK)

The Java SDK from Market Data provides methods to streamline your use of the Options endpoints. These methods provide a typed interface over the underlying HTTP requests and responses, with both sync and async variants.

Reach the resource through `client.options()`. For CSV output use `client.options().asCsv()`.

## Options Endpoints

- [Lookup](./lookup.md)
- [Expirations](./expirations.md)
- [Quotes](./quotes.md)
- [Chain](./chain.md)
- [Lookup (Java SDK)](./lookup.md) — Turn a human-readable option description into a well-formed OCC option symbol with the Java SDK and its OptionsLookupRequest type.
- [Expirations (Java SDK)](./expirations.md) — List the available option expiration dates for an underlying symbol with the Java SDK and its OptionsExpirationsRequest type.
- [Option Quotes (Java SDK)](./quotes.md) — Retrieve bid, ask, last and Greeks for option contracts by OCC symbol with the Java SDK quote and quotes methods, which fan out per symbol.
- [Option Chain (Java SDK)](./chain.md)
2 changes: 1 addition & 1 deletion docs/options/chain.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Chain
# Option Chain (Java SDK)

Retrieve a full option chain for an underlying, with a rich set of filters. The chain is where most option workflows start.

Expand Down
2 changes: 1 addition & 1 deletion docs/options/expirations.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Expirations
# Expirations (Java SDK)

List the available expiration dates for an underlying.

Expand Down
4 changes: 2 additions & 2 deletions docs/options/lookup.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Lookup
# Lookup (Java SDK)

Turn a human-readable option description into a well-formed OCC option symbol.

Expand Down Expand Up @@ -33,7 +33,7 @@ try (MarketDataClient client = new MarketDataClient()) {
String occSymbol = client.options()
.lookup(OptionsLookupRequest.of("AAPL 1/16/2026 $200 Call"))
.values();
System.out.println("Resolved to: " + occSymbol); // AAPL260116C00200000
System.out.println("Resolved to: " + occSymbol); // AAPL271217C00300000
}
```

Expand Down
10 changes: 5 additions & 5 deletions docs/options/quotes.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Quotes
# Option Quotes (Java SDK)

Retrieve quotes (bid, ask, last, greeks, etc.) for one or more option contracts by OCC symbol.

Expand Down Expand Up @@ -42,7 +42,7 @@ OptionsQuotesRequest.builder(String first, String... rest)

#### Returns

`OptionsQuotesResponse` wraps `List<OptionQuote>`. See [Chain](./chain.md#optionquote) for the full `OptionQuote` record (price fields plus greeks).
`OptionsQuotesResponse` wraps `List<OptionQuote>`. See [Chain](./chain.md) for the full `OptionQuote` record (price fields plus greeks).

## Examples

Expand All @@ -58,13 +58,13 @@ try (MarketDataClient client = new MarketDataClient()) {

// Single contract.
OptionQuote q = client.options()
.quote(OptionsQuoteRequest.of("AAPL260116C00200000"))
.quote(OptionsQuoteRequest.of("AAPL271217C00300000"))
.values().get(0);
System.out.println("last=" + q.last() + " iv=" + q.iv() + " delta=" + q.delta());

// Multiple contracts — one request each, keyed by symbol.
var quotes = client.options().quotes(
OptionsQuotesRequest.of("AAPL260116C00200000", "AAPL260116C00210000"));
OptionsQuotesRequest.of("AAPL271217C00300000", "AAPL271217C00310000"));
quotes.forEach((sym, resp) ->
System.out.println(sym + " → " + resp.values().size() + " row(s)"));
}
Expand All @@ -78,7 +78,7 @@ import com.marketdata.sdk.options.OptionsQuoteRequest

MarketDataClient().use { client ->
val q = client.options()
.quote(OptionsQuoteRequest.of("AAPL260116C00200000"))
.quote(OptionsQuoteRequest.of("AAPL271217C00300000"))
.values()[0]
println("last=${q.last()} iv=${q.iv()} delta=${q.delta()}")
}
Expand Down
2 changes: 1 addition & 1 deletion docs/settings.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Settings
# Settings (Java SDK)

The Java SDK lets you customize API requests through **universal parameters** — settings such as date format, data mode, column projection, and CSV shaping that apply across endpoints. These are configured per resource, and some can also be set globally through environment variables.

Expand Down
12 changes: 6 additions & 6 deletions docs/stocks/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Stocks
# Stocks (Java SDK)

The Java SDK from Market Data provides methods to streamline your use of the Stocks endpoints. These methods provide a typed interface over the underlying HTTP requests and responses, with both sync and async variants.

Reach the resource through `client.stocks()`. For CSV output use `client.stocks().asCsv()`.

## Stocks Endpoints

- [Candles](./candles.md)
- [Quotes](./quotes.md)
- [Prices](./prices.md)
- [News](./news.md)
- [Earnings](./earnings.md)
- [Stock Candles (Java SDK)](./candles.md) — Retrieve historical open, high, low, close and volume candles for a stock with the Java SDK StockCandlesRequest and its resolution options.
- [Stock Quotes (Java SDK)](./quotes.md) — Retrieve real-time bid, ask, mid, last and volume for one or more stock symbols with the Java SDK, in single or multi-symbol request form.
- [Prices (Java SDK)](./prices.md) — Retrieve the latest mid price and change for one or more stock symbols with the Java SDK StockPricesRequest, a lighter payload than a quote.
- [News (Java SDK)](./news.md) — Retrieve news articles for a stock symbol with the Java SDK, building the query with a StockNewsRequest object.
- [Earnings (Java SDK)](./earnings.md)
2 changes: 1 addition & 1 deletion docs/stocks/candles.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Candles
# Stock Candles (Java SDK)

Retrieve historical OHLCV (open/high/low/close/volume) candles for a stock symbol.

Expand Down
2 changes: 1 addition & 1 deletion docs/stocks/earnings.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Earnings
# Earnings (Java SDK)

Retrieve historical and upcoming earnings data (EPS actuals, estimates, surprises) for a stock symbol.

Expand Down
2 changes: 1 addition & 1 deletion docs/stocks/news.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# News
# News (Java SDK)

Retrieve news articles for a stock symbol.

Expand Down
2 changes: 1 addition & 1 deletion docs/stocks/prices.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Prices
# Prices (Java SDK)

Retrieve the latest price (mid, change) for one or more stock symbols — a lighter payload than a full quote.

Expand Down
2 changes: 1 addition & 1 deletion docs/stocks/quotes.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Quotes
# Stock Quotes (Java SDK)

Retrieve real-time quotes (bid, ask, mid, last, volume, etc.) for one or more stock symbols.

Expand Down
8 changes: 4 additions & 4 deletions docs/utilities/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Utilities
# Utilities (Java SDK)

The Java SDK from Market Data provides utility methods for checking API health, inspecting your account quota, and debugging requests. These methods provide a typed interface over the underlying HTTP requests and responses, with both sync and async variants.

Reach the resource through `client.utilities()`.

## Utilities Endpoints

- [Status](./status.md)
- [User](./user.md)
- [Headers](./headers.md)
- [API Status (Java SDK)](./status.md) — Call status() on the Java SDK utilities resource for a public liveness check of Market Data API services, with an online flag and uptime percentiles.
- [User (Java SDK)](./user.md) — Retrieve your Market Data account details with the Java SDK, including how much of the daily request quota is still available.
- [Headers (Java SDK)](./headers.md) — Echo back the headers the Market Data API received with the Java SDK, to confirm your Authorization header arrived. Sensitive values are redacted.
4 changes: 2 additions & 2 deletions docs/utilities/headers.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Headers
# Headers (Java SDK)

Echo back the HTTP headers the server received for your request — useful for confirming your `Authorization` header actually reached the API. Sensitive values are redacted in the response.

Expand All @@ -11,7 +11,7 @@ UtilitiesHeadersResponse headers()
CompletableFuture<UtilitiesHeadersResponse> headersAsync()
```

#### Returns
### Returns

`UtilitiesHeadersResponse` wrapping `Map<String, String>` — the headers the server received, lower-cased keys to values (sensitive values redacted server-side).

Expand Down
4 changes: 2 additions & 2 deletions docs/utilities/status.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Status
# API Status (Java SDK)

Retrieve the health of the Market Data API's services — a handy liveness check.

Expand All @@ -14,7 +14,7 @@ UtilitiesStatusResponse status()
CompletableFuture<UtilitiesStatusResponse> statusAsync()
```

#### Returns
### Returns

`UtilitiesStatusResponse` wrapping `List<ServiceStatus>`. Each `ServiceStatus` exposes the service name, a status string, an `online()` flag, uptime percentiles, and an updated timestamp.

Expand Down
4 changes: 2 additions & 2 deletions docs/utilities/user.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# User
# User (Java SDK)

Retrieve your account details — including how much of your daily request quota remains. This is the same endpoint the SDK calls on startup to validate your token.

Expand All @@ -11,7 +11,7 @@ UtilitiesUserResponse user()
CompletableFuture<UtilitiesUserResponse> userAsync()
```

#### Returns
### Returns

`UtilitiesUserResponse` wrapping a `User`, which exposes your plan and quota — for example `requestsRemaining()` and `requestsLimit()`.

Expand Down
Loading