> For the complete documentation index, see [llms.txt](https://developer.barchart.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.barchart.com/market-replay-docs/api-query-types/end-of-day-queries.md).

# End-of-Day Queries

Use this endpoint to retrieve historical OHLCV bars for equities and futures. Choose daily or longer periods, then configure nearby or continuation futures series when your analysis spans contract rolls.

{% hint style="warning" %}
Do not use `queryeod.ashx` for futures options queries. Use [Futures options EOD](/market-replay-docs/api-query-types/futures-options-eod.md) instead.

Querying equity or futures options on this endpoint is possible, but only by using a single options chain symbol per query.
{% endhint %}

Use end-of-day queries for daily, weekly, monthly, quarterly, or yearly history.

The main request handler is:

```
https://historical.aws.barchart.com/historical/queryeod.ashx
```

## What an EOD query returns

An EOD query returns records for a symbol between a start date and an end date.

You can choose:

* plain bars
* nearby futures series
* continuation futures series
* daily, weekly, monthly, quarterly, or yearly aggregation

## Parameters

Required:

* `username`
* `password`
* `symbol`

Optional:

* `start`
* `end`
* `maxrecords`
* `order`
* `data`
* `contractroll`
* `volume`
* `dividends`
* `splits`
* `nearby`
* `daystoexpiration`
* `backadjust`

## Date rules

* Date format is `yyyymmdd`
* `start` controls the first date in the range
* `end` controls the end of the range
* If `start` is set, `maxrecords` is ignored

## The `data` parameter

Use `data` to choose both aggregation and series behavior.

Supported values:

* `daily`
* `dailynearest`
* `dailycontinue`
* `weekly`
* `weeklynearest`
* `weeklycontinue`
* `monthly`
* `monthlynearest`
* `monthlycontinue`
* `quarterly`
* `quarterlynearest`
* `quarterlycontinue`
* `yearly`
* `yearlynearest`
* `yearlycontinue`

For equities, `nearest` and `continue` are ignored.

### Nearby and continuation series

A nearby series uses the nearest futures contract to expiration at a given point in time.

A continuation series uses the same contract month across different years.

Examples:

* nearby — Corn Dec 2008, Corn Sep 2008, Corn Jul 2008
* continuation — Corn Dec 2008, Corn Dec 2007, Corn Dec 2006

## Volume behavior

For futures, `volume` supports:

* `contract`
* `total`
* `sumcontract`
* `sumtotal`

If omitted, the default is `contract`.

For aggregate equity queries, use `volume=sum` to return summed daily volume for the period.

## Stock adjustments

For stocks:

* `dividends=false` turns off dividend adjustment
* `splits=false` turns off split adjustment

{% hint style="warning" %}
Use both `splits=false` and `dividends=false` if you need raw, unadjusted stock data.
{% endhint %}

## Multi-contract futures options

These parameters apply to nearest futures series:

### `contractroll`

Controls how the roll from one contract to the next is calculated.

Supported values:

* `expiration`
* `combined`

`combined` uses a combination of volume and open interest.

### `nearby`

Sets the front-month offset.

Examples:

* `nearby=1` — front month
* `nearby=2` — second nearby contract
* `nearby=3` — third nearby contract

You can also express this in the symbol, such as `ES1` or `YM*3`.

### `daystoexpiration`

Sets how many calendar days before expiration the series rolls.

Valid values are `0` through `60`.

If omitted, the default is `1`.

### `backadjust`

Set `backadjust=true` to adjust contracts based on the roll gap at the switch.

If omitted, the default is `false`.

## Response format

EOD queries return comma-delimited text, one record per line:

```
SYMBOL,YYYY-MM-DD,OPEN,HIGH,LOW,CLOSE,VOLUME[,OPENINTEREST]
```

Example:

```
CSCO,2009-02-09,16.99,17.05,16.62,16.85,37633398
CSCO,2009-02-10,16.59,16.93,15.92,16.05,69148797
```

Open interest is included for futures data and omitted for equities.

Example fragment of a weekly nearest futures series:

```
ESZ08,2008-12-08,872.25,919.25,829,886,3269325,3301807
ESZ08,2008-12-15,883.5,919.25,857.25,881.25,2670206,3198151
ESH09,2008-12-22,884.25,891.5,852.75,869,654227,2287817
```

## Examples

Daily Apple records between February 3 and February 23, 2009:

```
https://historical.aws.barchart.com/historical/queryeod.ashx?username=username&password=password&symbol=AAPL&start=20090203&end=20090223&data=daily
```

Last `10` weekly Apple records through the current day:

```
https://historical.aws.barchart.com/historical/queryeod.ashx?username=username&password=password&symbol=AAPL&maxrecords=10&data=weekly
```

Last `100` daily nearest records for `ESH09`:

```
https://historical.aws.barchart.com/historical/queryeod.ashx?username=username&password=password&symbol=ESH09&maxrecords=100&data=dailynearest
```

`100` daily nearest records for `ESH09` through February 3, 2009 with total volume:

```
https://historical.aws.barchart.com/historical/queryeod.ashx?username=username&password=password&symbol=ESH09&end=20090203&maxrecords=100&data=dailynearest&volume=total
```

## Related

* [Tick queries](/market-replay-docs/api-query-types/tick-queries.md)
* [Minute queries](/market-replay-docs/api-query-types/minute-queries.md)
* [Futures options EOD](/market-replay-docs/api-query-types/futures-options-eod.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developer.barchart.com/market-replay-docs/api-query-types/end-of-day-queries.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
