# Barchart — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Monitor live stock quotes and commodity prices, analyze options chains with gamma exposure data, and access historical market time series to track top-performing stocks. Use real-time and historical data to make informed trading and investment decisions across equities and commodities.

**Category:** Finance & Markets | **Website:** [barchart.com/](https://barchart.com/) | **Docs:** [parse.bot/marketplace/d94c9b41-0a26-4490-a931-e27dbf335330/barchart-com-api](https://parse.bot/marketplace/d94c9b41-0a26-4490-a931-e27dbf335330/barchart-com-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-barchart-com-api-d94c9b41/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_futures_prices

Get all futures contract prices for a given root symbol. Returns symbol, contract name, last price, price change, percent change, settlement price, volume, open interest, and high/low prices for each contract.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `root_symbol` | string | Yes | Futures root symbol (e.g. 'CL' for Crude Oil, 'GC' for Gold, 'ES' for E-mini S&P). Any contract specifier like '*1' is stripped automatically. |
| `timeframe` | string | No | Timeframe for data (e.g. 'daily') |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-barchart-com-api-d94c9b41/get_futures_prices \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"root_symbol":"<string>","timeframe":"<string>"}'
```

### get_gamma_exposure

Get gamma exposure details for a specified stock symbol, grouped by strike price. Returns options data with gamma, delta, open interest, and pricing for each strike price level across multiple expirations.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `symbol` | string | Yes | Stock or ETF symbol (e.g. 'AAPL') |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-barchart-com-api-d94c9b41/get_gamma_exposure \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"symbol":"<string>"}'
```

### get_historical_data

Get historical price data for a symbol. Returns OHLCV candle data ordered ascending by date. Supports daily and 5-minute intraday intervals.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `interval` | string | No | Data interval: 'daily' or '5min' (intraday) |
| `max_records` | integer | No | Maximum number of records to return |
| `symbol` | string | Yes | Symbol to retrieve history for (e.g. 'AAPL' for a stock, 'GC*0' for Gold futures front-month) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-barchart-com-api-d94c9b41/get_historical_data \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"interval":"<string>","max_records":"<integer>","symbol":"<string>"}'
```

### get_nearest_put_call_ratio

Get the put/call volume ratio for the nearest upcoming options expiration of a stock symbol. Selects the valid row with the smallest non-negative DTE (days to expiration). Returns put and call total volumes for that single expiration and their ratio. Returns null fields with a descriptive source_status if the symbol has no listed options or no valid upcoming expiration.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `symbol` | string | Yes | Stock or ETF symbol (e.g. 'STNE', 'AAPL') |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-barchart-com-api-d94c9b41/get_nearest_put_call_ratio \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"symbol":"<string>"}'
```

### get_options_chain

Get detailed option chain data for a specified stock symbol. Returns all call and put options with greeks, pricing, volume, and open interest for the nearest available expiration date.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `symbol` | string | Yes | Stock or ETF symbol (e.g. 'AAPL') |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-barchart-com-api-d94c9b41/get_options_chain \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"symbol":"<string>"}'
```

### get_stock_quotes

Get current quotes for a list of stock symbols. Returns real-time price data including last price, price change, percent change, and symbol metadata. Accepts up to ~25 symbols per call. Each quote includes both formatted display strings and raw numeric values.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `symbols` | string | Yes | Comma-separated list of stock or ETF symbols (e.g. 'AAPL,MSFT,SPY') |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-barchart-com-api-d94c9b41/get_stock_quotes \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"symbols":"<string>"}'
```

### get_stock_volume_metrics

Get current stock volume metrics for a symbol. Returns the session's consolidated volume, 20-day average volume (as defined by Barchart), previous session volume, and trade time. Does not include options volume.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `symbol` | string | Yes | Stock or ETF symbol (e.g. 'STNE', 'AAPL') |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-barchart-com-api-d94c9b41/get_stock_volume_metrics \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"symbol":"<string>"}'
```

### get_top_stocks

Get top-performing stocks ranked by weighted alpha. Returns price change and year-over-year performance data for the leading symbols.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-barchart-com-api-d94c9b41/get_top_stocks \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```
