> For the complete documentation index, see [llms.txt](https://nighostchris.gitbook.io/traders/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nighostchris.gitbook.io/traders/categories/ticker.md).

# Ticker

## Real Time Quoting

Get the real-time market price related information on that stock

{% tabs %}
{% tab title="JavaScript" %}

```javascript
import { Ticker } from 'traders';

const ticker = new Ticker('AAPL');

const result = await ticker.liveQuote();
```

{% endtab %}

{% tab title="Typescript" %}

```typescript
import { Ticker, LiveQuoteData } from 'traders';

const ticker: Ticker = new Ticker('AAPL');

const result: LiveQuoteData = await ticker.liveQuote();
```

{% endtab %}
{% endtabs %}

```bash
# Example of liveQuote result
{
  open: '120.40',
  price: '121.03',
  high: '121.17',
  low: '119.16',
  volume: '88.11M',
  change: '-0.93',
  changePercent: '-0.76%'
}
```

## Historical Prices

Get the historical prices for particular stock

{% tabs %}
{% tab title="JavaScript" %}

```javascript
import { Ticker } from 'traders';

const ticker = new Ticker('V');

// Certain combination of date range and interval are forbidden
// Example like '1m', '2021-03-01', '2021-03-15'
// Since Yahoo Finance only provide 1-min data for 7 days range
const result = await ticker.historical('1d', '2021-03-01', '2021-03-03');
```

{% endtab %}

{% tab title="Typescript" %}

```typescript
import { Ticker, HistoricalData } from 'traders';

const ticker: Ticker = new Ticker('V');

// Certain combination of date range and interval are forbidden
// Example like '1m', '2021-03-01', '2021-03-15'
// Since Yahoo Finance only provide 1-min data for 7 days range
const result: HistoricalData[] = await ticker.historical('1d', '2021-03-01', '2021-03-03');
```

{% endtab %}
{% endtabs %}

```bash
# Example of historical result
[
  {
    open: 214.97000122070312,
    high: 217.8000030517578,
    low: 214.7899932861328,
    volume: 6982000,
    close: 216.6300048828125,
    date: '2021-03-01 22:30:00'
  },
  {
    open: 216.9600067138672,
    high: 217.92999267578125,
    low: 214.82000732421875,
    volume: 6153500,
    close: 215.77000427246094,
    date: '2021-03-02 22:30:00'
  }
]
```


---

# 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:

```
GET https://nighostchris.gitbook.io/traders/categories/ticker.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
