# Price history

- Method: `GET`
- Path: `/price-history`
- Tier: Free
- HTML docs: https://docs.hiddensystems.ai/nebula/reference/get-price-history/
- Interactive docs: https://docs.hiddensystems.ai/nebula/api/#endpoint=get-price-history

## Description

Returns market-price observations and a separate daily trading-volume series for one resolved asset. Trading volume is measured in shares for equities and USD for crypto. Asset selectors support equities, commodities, indices, and crypto assets returned by GET /assets; commodity and index IDs use asset_class=equity.

## cURL Example

```bash
curl --get \
  --url 'https://nebula-api.hiddensystems.ai/api/v1/public/price-history' \
  --data-urlencode 'asset_id=NVDA' \
  --data-urlencode 'asset_class=equity' \
  --header 'X-API-Key: YOUR_API_KEY'
```

## Path Parameters

No path parameters for this endpoint.

## Query Parameters

- `asset_id` (string, required): Canonical identifier returned by /assets. Stock, commodity, and index IDs are normally ticker or market symbols and use asset_class=equity; crypto IDs are canonical crypto slugs. asset_class is mandatory whenever asset_id is present.
- `asset_class` (string, required, allowed: equity, crypto): Namespace of asset_id, or the market class for endpoints with a class-scoped global view. Stocks, commodities, and indices use equity. Equity is the documented default only where the endpoint description states a default.
- `hours` (integer, optional, default: 168): Lookback window in hours.
- `granularity` (string, optional, allowed: 1h, 2h, 4h, 12h, 1d): Requested time-series bucket size. When omitted, the service chooses a bucket size appropriate for the lookback window.

## Response

OK

- `daily_trading_volume` (array<object>, required): One trading-volume observation per calendar day, kept separate from the price-series clock.
- `daily_trading_volume[].timestamp` (string (date-time), required): UTC RFC 3339 timestamp for the observation or bucket start.
- `daily_trading_volume[].trading_volume` (number (double), required): Trading volume for the observation in the unit declared by the response.
- `series` (array<object>, required): Chronologically ordered observations.
- `series[].high_usd` (number (double)): Observed high price in US dollars.
- `series[].low_usd` (number (double)): Observed low price in US dollars.
- `series[].price_usd` (number (double)): Latest or observed market price in US dollars.
- `series[].timestamp` (string (date-time), required): UTC RFC 3339 timestamp for the observation or bucket start.
- `series[].trading_volume` (number (double)): Trading volume for the observation in the unit declared by the response.
- `trading_volume_unit` (string, required, enum: shares, usd): Unit used by every trading-volume value in this response.

Media type: `application/json`

## JSON Response

```json
{
  "daily_trading_volume": [
    {
      "timestamp": "2026-08-07T15:00:00Z",
      "trading_volume": 18420531
    }
  ],
  "series": [
    {
      "high_usd": 184.17,
      "low_usd": 179.82,
      "price_usd": 182.41,
      "timestamp": "2026-08-07T15:00:00Z",
      "trading_volume": 18420531
    }
  ],
  "trading_volume_unit": "shares"
}
```
