> 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/getting-started/futures-examples.md).

# Futures examples

Use these examples when you want to test futures-specific Market Replay behavior fast.

## Minute bars for a futures contract

Query minute bars for a specific contract:

```bash
curl "https://historical.aws.barchart.com/historical/queryminutes.ashx?username=YOUR_USERNAME&password=YOUR_PASSWORD&symbol=ESH09&start=200902030900&end=200902031200"
```

## Nearby minute data by root

Query nearby minute data with the root symbol:

```bash
curl "https://historical.aws.barchart.com/historical/querynearbyminutes.ashx?username=YOUR_USERNAME&password=YOUR_PASSWORD&symbol=ES&start=20090601&end=20090701"
```

Query hourly nearby bars:

```bash
curl "https://historical.aws.barchart.com/historical/querynearbyminutes.ashx?username=YOUR_USERNAME&password=YOUR_PASSWORD&symbol=ES&start=20090601&end=20090701&interval=60"
```

## Tick data for a futures symbol

Query ticks for a futures contract:

```bash
curl "https://historical.aws.barchart.com/historical/queryticks.ashx?username=YOUR_USERNAME&password=YOUR_PASSWORD&symbol=ESH09&start=20090203090000&end=20090203120000"
```

Query ticks with root notation:

```bash
curl "https://historical.aws.barchart.com/historical/queryticks.ashx?username=YOUR_USERNAME&password=YOUR_PASSWORD&symbol=ES*1&maxrecords=500&order=desc"
```

{% hint style="info" %}
Tick queries stay within one day. Split multi-day futures downloads into one request per day.
{% endhint %}

## End-of-day nearby series

Query daily nearest records:

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

Query nearest records with total volume:

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

Query the second nearby contract:

```bash
curl "https://historical.aws.barchart.com/historical/queryeod.ashx?username=YOUR_USERNAME&password=YOUR_PASSWORD&symbol=ES&maxrecords=100&data=dailynearest&nearby=2"
```

## Back-adjusted futures series

Query a back-adjusted nearby series:

```bash
curl "https://historical.aws.barchart.com/historical/queryeod.ashx?username=YOUR_USERNAME&password=YOUR_PASSWORD&symbol=ES&maxrecords=100&data=dailynearest&backadjust=true"
```

## Futures options through `queryeod.ashx`

Query a futures option by option symbol:

```bash
curl "https://historical.aws.barchart.com/historical/queryeod.ashx?username=YOUR_USERNAME&password=YOUR_PASSWORD&symbol=NGH12|600C&start=20120101&end=20120131&data=daily&volume=contract"
```

## Futures options EOD endpoint

Query futures options EOD by root and date:

```bash
curl "https://marketreplay.barchart.com/historical/futuresoptions?username=YOUR_USERNAME&password=YOUR_PASSWORD&root=CK&date=2023-04-14"
```

Query JSON output with aggregate stats when enabled:

```bash
curl "https://marketreplay.barchart.com/historical/futuresoptions/json?username=YOUR_USERNAME&password=YOUR_PASSWORD&root=ZC&date=2023-08-16"
```

## Time and symbol reminders

* futures queries use Central Time
* nearby minute queries use the root symbol
* EOD nearest queries can use `nearby`
* futures options EOD uses `root` and `date`

## Related

* [Symbols and notation](/market-replay-docs/reference/symbols-and-notation.md)
* [curl examples](/market-replay-docs/getting-started/curl-examples.md)
* [Minute queries](/market-replay-docs/api-query-types/minute-queries.md)
* [End-of-day queries](/market-replay-docs/api-query-types/end-of-day-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/getting-started/futures-examples.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.
