# Delayed Stock Quotes

Retrieve the most recent available delayed quote for one or more stocks.

## Endpoint
```
https://api.marketdata.app/v1/stocks/quotes/{symbol}/
```
or
```
https://api.marketdata.app/v1/stocks/quotes/?symbols={symbol1},{symbol2},...
```

#### Method
```
GET
```
## Request Examples

### Single Symbol

### HTTP

**GET** [https://api.marketdata.app/v1/stocks/quotes/AAPL/](https://api.marketdata.app/v1/stocks/quotes/AAPL/)

### NodeJS

```js title="app.js"
fetch("https://api.marketdata.app/v1/stocks/quotes/AAPL/")
  .then((res) => {
    console.log(res);
  })
  .catch((err) => {
    console.log(err);
  });
```

### Python

```python title="app.py"
from marketdata import MarketDataClient

client = MarketDataClient()
quotes = client.stocks.quotes("AAPL")
print(quotes)
```

### Go

```go title="stockQuote.go"

import (
  "fmt"

  api "github.com/MarketDataApp/sdk-go"
)

func ExampleStockQuoteRequest() {
	quotes, err := StockQuote().Symbol("AAPL").Get()
	if err != nil {
		fmt.Print(err)
		return
	}

	for _, quote := range quotes {
		fmt.Println(quote)
	}
}
```
### PHP

```php title="stockQuote.php"
use MarketDataApp\Client;

$client = new Client();
$quote = $client->stocks->quote("AAPL");

// Display formatted quote with price, change, bid/ask, volume
echo $quote;
```

### Multiple Symbols

### HTTP

**GET** [https://api.marketdata.app/v1/stocks/quotes/?symbols=AAPL,META,MSFT](https://api.marketdata.app/v1/stocks/quotes/?symbols=AAPL,META,MSFT)

### NodeJS

```js title="app.js"
fetch("https://api.marketdata.app/v1/stocks/quotes/?symbols=AAPL,META,MSFT")
  .then((res) => {
    console.log(res);
  })
  .catch((err) => {
    console.log(err);
  });
```

### Python

```python title="app.py"
from marketdata import MarketDataClient

client = MarketDataClient()
quotes = client.stocks.quotes(["AAPL", "META", "MSFT"])
print(quotes)
```

### PHP

```php title="stockQuotes.php"
use MarketDataApp\Client;

$client = new Client();
$quotes = $client->stocks->quotes(["AAPL", "META", "MSFT"]);

// Display formatted quotes summary
echo $quotes;
```

## Response Example

```json
{
  "s": "ok",
  "symbol": ["AAPL", "META", "MSFT"],
  "ask": [247.94, 641.42, 465.95],
  "askSize": [200, 100, 200],
  "bid": [247.87, 641.25, 465.94],
  "bidSize": [400, 100, 40],
  "mid": [247.905, 641.335, 465.945],
  "last": [247.94, 641.42, 465.94],
  "change": [-0.41, 7.84, 14.80],
  "changepct": [-0.0017, 0.0124, 0.0328],
  "volume": [27255134, 8921456, 26896268],
  "updated": [1769210435, 1769210435, 1769210429]
}
```

## Request Parameters

### Required

You can provide the symbol(s) in one of two ways:

1. As part of the URL path:
   - **symbol** `string`
     The company's ticker symbol.

2. As a query parameter:
   - **symbols** `string`
     Comma-separated list of ticker symbols.

### Optional

- **52week** `boolean`

  Enable the output of 52-week high and 52-week low data in the quote output. By default this parameter is `false` if omitted.

- **extended** `boolean`

  Control the inclusion of extended hours data in the quote output. Defaults to `true` if omitted. 

  - When set to `true`, the most recent quote is always returned, without regard to whether the market is open for primary trading or extended hours trading.
  - When set to `false`, only quotes from the primary trading session are returned. When the market is closed or in extended hours, a historical quote from the last closing bell of the primary trading session is returned instead of an extended hours quote. 

## Response Attributes

### Success

- **s** `string`

  Will always be `ok` when there is data for the symbol requested.

- **symbol** `array[string]`

  Array of ticker symbols that were requested.

- **ask** `array[number]`

  The ask price of the stock.

- **askSize** `array[number]`

  The number of shares offered at the ask price.

- **bid** `array[number]`

  The bid price.

- **bidSize** `array[number]`

  The number of shares that may be sold at the bid price.

- **mid** `array[number]`

  The midpoint price between the ask and the bid.

- **last** `array[number]`

  The last price the stock traded at.

- **change** `array[number]`

  The difference in price in currency units compared to the closing price of the previous primary trading session.

- **changepct** `array[number]`

  The difference in price in percent, expressed as a decimal, compared to the closing price of the previous day. For example, a 3% change will be represented as 0.03.

:::note
  - When the market is open for primary trading, **change** and **changepct** are always calculated using the last traded price and the last primary session close. When the market is closed or in extended hours, this criteria is also used as long as `extended` is omitted or set to `true`.
  - When `extended` is set to `false`, and the market is closed or in extended hours, quotes from extended hours are not considered. The values for **change** and **changepct** will be calculated using the last two closing prices instead.
:::

- **52weekHigh** `array[number]`

  The 52-week high for the stock. This parameter is omitted unless the optional 52week request parameter is set to true.

- **52weekLow** `array[number]`

  The 52-week low for the stock. This parameter is omitted unless the optional 52week request parameter is set to true.

- **volume** `array[number]`

  The number of shares traded during the current session.

- **updated** `array[date]`

  The date/time of the current stock quote. All timestamps use US Eastern Time (America/New_York). See [Response Timezone](/docs/api/dates-and-times#response-timezone) for details.

### No Data

- **s** `string`

  Status will only be `no_data` if no quotes can be found for all of the symbols. If a quote for any symbol can be returned, the request will be successful.

### Error

- **s** `string`

  Status will be `error` if the request produces an error response.

- **errmsg** `string`
  An error message.

## Usage Information

### Data Availability

The type of quote you receive depends on your user type and UTP entitlement. This may include a 15-minute delayed quote or historical (1 day old) quote, depending on the plan or access level. Real-time quotes are not currently available.

| User Type        | UTP Entitlement | Quote Type             |
|------------------|-----------------|------------------------|
| Non-Professional | ✅              | 15-min delayed         |
| Non-Professional | ❌              | Historical (1 day old) |
| Professional     | Any             | Historical (1 day old) |
| Unknown          | Any             | Historical (1 day old) |

:::info What are entitlements?
Entitlements are permissions granted by exchanges that allow access to their data. To get delayed quotes, users need to sign the [UTP agreement](/account/entitlements). [Learn more about entitlements](/account/entitlements).
:::

### Pricing

The cost of using the stock quote API endpoint depends on the type of data you choose and your usage pattern. Here's a breakdown of the pricing:

| Data Type        | Cost Basis | Credits Required per Unit |
|------------------|------------|---------------------------|
| 15m Delayed Data | Per symbol | 1 credit                  |
| Historical Data  | Per symbol | 1 credit                  |
