# Correlations `GET` `https://api.unusualwhales.com/api/market/correlations` Returns the correlations between a list of tickers. Date must be the current or a past date. If no date is given, returns data for the current/last market day. You can filter the time period either by: 1. Using the `interval` parameter (e.g. "1y", "6m", "3m", "1m") 2. Using `start_date` and optionally `end_date` (if `end_date` is not provided, it defaults to the current date) If you send `interval` alongside `start_date`, `interval` filter will take priority. ## Authentication ``` Authorization: Bearer YOUR_API_KEY ``` ## Query Parameters | Name | Type | Required | Description | |------|------|----------|-------------| | `tickers` | Ticker | Yes | A comma separated list of tickers. To exclude certain tickers prefix the first ticker with a `-`. | | `interval` | Time frame | No | The timeframe of the data to return. Can be one of the following formats: - YTD - 1D, 2D, etc. - 1W, 2W, etc. - 1M, 2M, etc. - 1Y, 2Y, etc. | | `start_date` | Correlation Start Date | No | A date in the format of YYYY-MM-DD to start the correlation calculation from. This is optional and works alongside end_date to define a specific time range. Can be used as an alternative to the interval parameter. | | `end_date` | Correlation End Date | No | A date in the format of YYYY-MM-DD to end the correlation calculation. This is optional and defaults to the current date when start_date is provided. Works alongside start_date to define a specific time range. Can be used as an alternative to the interval parameter. | ## Response (200) | Field | Type | Description | |-------|------|-------------| | `correlation` | Correlation | A list of correlations | | `fst` | Stock Ticker | The stock ticker. | | `max_date` | General ISO Date | An ISO date. | | `min_date` | General ISO Date | An ISO date. | | `rows` | Count of data points | The amount of data points considered. | | `snd` | Stock Ticker | The stock ticker. | ## Example ### curl ```bash curl -X GET "https://api.unusualwhales.com/api/market/correlations?tickers=VALUE" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Accept: application/json" ``` ### Python ```python import http.client conn = http.client.HTTPSConnection("api.unusualwhales.com") headers = {"Authorization": "Bearer YOUR_API_KEY", "Accept": "application/json"} conn.request("GET", "/api/market/correlations?tickers=VALUE", headers=headers) response = conn.getresponse() print(response.read().decode("utf-8")) ``` ## Response Example ```json { "data": [ { "correlation": 0.27936797861890483, "fst": "AAPL", "max_date": "2024-07-11", "min_date": "2023-07-11", "rows": 253, "snd": "SPY" }, { "correlation": 0.279367978618901, "fst": "SPY", "max_date": "2024-07-11", "min_date": "2023-07-11", "rows": 253, "snd": "AAPL" } ] } ```