> 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/reference/authentication.md).

# Authentication

Market Replay authenticates requests with a `username` and `password`.

Pass both values on every request.

## Required parameters

Every authenticated request includes:

* `username`
* `password`

Example:

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

## Supported base URLs

Use the historical base URL for ticks, minutes, EOD data, and events:

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

Use the futures options base URL for futures options EOD:

```
https://marketreplay.barchart.com/historical/
```

## Authentication pattern by endpoint

Most endpoints use the same pattern:

* `queryticks.ashx`
* `queryminutes.ashx`
* `querynearbyminutes.ashx`
* `queryformtminutes.ashx`
* `queryeod.ashx`
* `queryevents.ashx`
* `queryminutedaterange.ashx`
* `queryeoddaterange.ashx`
* `futuresoptions`
* `futuresoptions/json`

Example with tick data:

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

## Security guidance

Treat your credentials like secrets.

* Store them in environment variables
* Never hard-code them in client-side apps
* Never commit them to version control

Example with environment variables:

```bash
curl "https://historical.aws.barchart.com/historical/queryminutes.ashx?username=${BARCHART_USERNAME}&password=${BARCHART_PASSWORD}&symbol=AAPL&maxrecords=10&order=desc"
```

{% hint style="warning" %}
Do not expose credentials in browser-based frontend code. Route requests through your own backend or job runner.
{% endhint %}

## Related

* [Quickstart](/market-replay-docs/getting-started/quickstart.md)
* [Python example](/market-replay-docs/getting-started/python-example.md)
* [JavaScript example](/market-replay-docs/getting-started/javascript-example.md)
* [curl examples](/market-replay-docs/getting-started/curl-examples.md)
* [Query parameter cheat sheet](/market-replay-docs/reference/query-parameter-cheat-sheet.md)
* [Errors and troubleshooting](/market-replay-docs/reference/errors-and-troubleshooting.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/reference/authentication.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.
