# Get Historical Prices

Get public OHLC candles for a ticker from the MarketWatch chart history. Each candle has an ISO date, an ISO time and the open, high, low and close price. The response names the exchange key that served the ticker. The only valid pairs are P1Y with P1D and D5 with PT1H; other pairs return 422.

- **Documentation:** [https://scrappa.co/docs/marketwatch-api/marketwatch_history](https://scrappa.co/docs/marketwatch-api/marketwatch_history)
- **API group:** MarketWatch API
- **Endpoint:** `GET https://scrappa.co/api/marketwatch/history`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `ticker` | string | Yes | Ticker symbol, e.g. AAPL. |
| `period` | string | No | P1Y with step P1D, or D5 with step PT1H. Default P1Y. |
| `step` | string | No | P1D with period P1Y, or PT1H with period D5. Default P1D. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/marketwatch/history?ticker=AAPL&period=P1Y&step=P1D"
```

## Example response

```json
{
    "ticker": "AAPL",
    "exchange": "XNAS",
    "period": "P1Y",
    "step": "P1D",
    "candles": [
        {
            "date": "2026-11-19",
            "time": "2026-11-19T14:30:00Z",
            "open": 197.4,
            "high": 199.6,
            "low": 196.1,
            "close": 198.4
        }
    ],
    "source": "marketwatch"
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
|  | Not found | No candles were returned. |

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
