> 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

Authenticate Market Replay requests with your username and password.

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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.barchart.com/market-replay-docs/reference/authentication.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
