{"openapi":"3.1.0","info":{"title":"Stock Sector Correlation Matrix API","version":"1.0.0","description":"How the eleven S&P 500 sectors move together, computed live from Yahoo Finance via the SPDR sector ETFs (no key, nothing stored). Sector correlation is the heart of equity diversification and rotation: defensives (utilities, staples, health care) and cyclicals (tech, discretionary, financials, energy) cluster differently, and when correlations rise the whole market is moving as one (risk-on/risk-off), while a spread of correlations means stock-picking and rotation are rewarded. The matrix endpoint returns the full pairwise return-correlation matrix across all eleven sectors with the most- and least-correlated sector pairs. The sector endpoint returns one sector's correlation to every other, ranked, plus its beta to the S&P 500 (how much it amplifies the market). The sectors endpoint lists what is covered. The equity sector correlation / rotation cut — distinct from the cross-asset correlation matrix (asset classes, not sectors), the crypto and currency correlation APIs (other markets) and the sector price/performance feed. It answers which sectors are the same bet and which diversify, within the stock market.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/sectorcorrelation-api","description":"oanor gateway"}],"tags":[{"name":"Matrix"},{"name":"Sector"},{"name":"Sectors"},{"name":"Meta"}],"components":{"securitySchemes":{"oanorKey":{"type":"apiKey","in":"header","name":"x-oanor-key","description":"Get your key at https://www.oanor.com/developer/keys"}}},"security":[{"oanorKey":[]}],"paths":{"/v1/matrix":{"get":{"operationId":"get_v1_matrix","tags":["Matrix"],"summary":"Full 11x11 sector correlation matrix with most/least correlated pairs","description":"","parameters":[{"name":"window","in":"query","required":false,"description":"Lookback in days (20-365)","schema":{"type":"string"},"example":"90"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"to":"2026-06-11","from":"2026-02-02","note":"Full pairwise Pearson correlation of daily log returns across the eleven S&P 500 sectors, aligned on common trading days. High correlations mean the market is moving as one (risk-on/risk-off); low or spread correlations reward rotation and stock-picking. most_correlated pairs double up risk; least_correlated diversify.","matrix":{"energy":{"energy":1,"materials":-0.11,"utilities":-0.013,"financials":-0.246,"technology":-0.221,"health_care":-0.149,"industrials":-0.28,"real_estate":-0.248,"communication":-0.387,"consumer_staples":0.061,"consumer_discretionary":-0.464},"materials":{"energy":-0.11,"materials":1,"utilities":0.351,"financials":0.318,"technology":0.446,"health_care":0.416,"industrials":0.747,"real_estate":0.484,"communication":0.335,"consumer_staples":0.272,"consumer_discretionary":0.547},"utilities":{"energy":-0.013,"materials":0.351,"utilities":1,"financials":-0.029,"technology":-0.131,"health_care":0.318,"industrials":0.327,"real_estate":0.623,"communication":0.032,"consumer_staples":0.434,"consumer_discretionary":0.109},"financials":{"energy":-0.246,"materials":0.318,"utilities":-0.029,"financials":1,"technology":0.351,"health_care":0.395,"industrials":0.498,"real_estate":0.409,"communication":0.531,"consumer_staples":-0.008,"consumer_discretionary":0.563},"technology":{"energy":-0.221,"materials":0.446,"utilities":-0.131,"financials":0.351,"technology":1,"health_care":0.087,"industrials":0.526,"real_estate":0.082,"communication":0.458,"consumer_staples":-0.261,"consumer_discretionary":0.629},"health_care":{"energy":-0.149,"materials":0.416,"utilities":0.318,"financials":0.395,"technology":0.087,"health_care":1,"industrials":0.534,"real_estate":0.537,"communication":0.421,"consumer_staples":0.482,"consumer_discretionary":0.417},"industrials":{"energy":-0.28,"materials":0.747,"utilities":0.327,"financials":0.498,"technology":0.526,"health_care":0.534,"industrials":1,"real_estate":0.549,"communication":0.495,"consumer_staples":0.22,"consumer_discretionary":0.646},"real_estate":{"energy":-0.248,"materials":0.484,"utilities":0.623,"financials":0.409,"technology":0.082,"health_care":0.537,"industrials":0.549,"real_estate":1,"communication":0.421,"consumer_staples":0.461,"consumer_discretionary":0.418},"communication":{"energy":-0.387,"materials":0.335,"utilities":0.032,"financials":0.531,"technology":0.458,"health_care":0.421,"industrials":0.495,"real_estate":0.421,"communication":1,"consumer_staples":0.101,"consumer_discretionary":0.683},"consumer_staples":{"energy":0.061,"materials":0.272,"utilities":0.434,"financials":-0.008,"technology":-0.261,"health_care":0.482,"industrials":0.22,"real_estate":0.461,"communication":0.101,"consumer_staples":1,"consumer_discretionary":0.098},"consumer_discretionary":{"energy":-0.464,"materials":0.547,"utilities":0.109,"financials":0.563,"technology":0.629,"health_care":0.417,"industrials":0.646,"real_estate":0.418,"communication":0.683,"consumer_staples":0.098,"consumer_discretionary":1}},"source":"Yahoo Finance","sectors":[{"key":"technology","name":"Technology"},{"key":"financials","name":"Financials"},{"key":"energy","name":"Energy"},{"key":"health_care","name":"Health Care"},{"key":"consumer_discretionary","name":"Consumer Discretionary"},{"key":"consumer_staples","name":"Consumer Staples"},{"key":"industrials","name":"Industrials"},{"key":"materials","name":"Materials"},{"key":"utilities","name":"Utilities"},{"key":"real_estate","name":"Real Estate"},{"key":"communication","name":"Communication Services"}],"window_days":90,"observations":90,"most_correlated":[{"a":"industrials","b":"materials","correlation":0.747},{"a":"consumer_discretionary","b":"communication","correlation":0.683},{"a":"consumer_discretionary","b":"industrials","correlation":0.646}],"least_correlated":[{"a":"energy","b":"consumer_discretionary","correlation":-0.464},{"a":"energy","b":"communication","correlation":-0.387},{"a":"energy","b":"industrials","correlation":-0.28}]},"meta":{"timestamp":"2026-06-12T10:35:12.979Z","request_id":"3b605c05-9e6f-4243-9f9a-fcf8c3a6f6e0"},"status":"ok","message":"Matrix retrieved successfully","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/sector":{"get":{"operationId":"get_v1_sector","tags":["Sector"],"summary":"One sector correlations to all others, ranked, with beta to S&P 500","description":"","parameters":[{"name":"sector","in":"query","required":true,"description":"Sector key (see /v1/sectors)","schema":{"type":"string"},"example":"technology"},{"name":"window","in":"query","required":false,"description":"Lookback in days (20-365)","schema":{"type":"string"},"example":"90"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"to":"2026-06-11","from":"2026-02-02","name":"Technology","note":"One sector's correlation to every other sector, ranked, plus its beta to the S&P 500 (beta > 1 amplifies market moves; a defensive sector is < 1). best_diversifiers are the least-correlated sectors.","sector":"technology","source":"Yahoo Finance","window_days":90,"correlations":[{"key":"consumer_discretionary","name":"Consumer Discretionary","correlation":0.629},{"key":"industrials","name":"Industrials","correlation":0.526},{"key":"communication","name":"Communication Services","correlation":0.458},{"key":"materials","name":"Materials","correlation":0.446},{"key":"financials","name":"Financials","correlation":0.351},{"key":"health_care","name":"Health Care","correlation":0.087},{"key":"real_estate","name":"Real Estate","correlation":0.082},{"key":"utilities","name":"Utilities","correlation":-0.131},{"key":"energy","name":"Energy","correlation":-0.221},{"key":"consumer_staples","name":"Consumer Staples","correlation":-0.261}],"observations":90,"beta_to_sp500":1.733,"best_diversifiers":[{"key":"consumer_staples","name":"Consumer Staples","correlation":-0.261},{"key":"energy","name":"Energy","correlation":-0.221},{"key":"utilities","name":"Utilities","correlation":-0.131}]},"meta":{"timestamp":"2026-06-12T10:35:13.145Z","request_id":"fd7fe134-d930-4fb3-ad96-108c6c8904a2"},"status":"ok","message":"Sector retrieved successfully","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/sectors":{"get":{"operationId":"get_v1_sectors","tags":["Sectors"],"summary":"The eleven S&P 500 sectors","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"The eleven S&P 500 GICS sectors (via SPDR sector ETFs). Pass key/alias as sector= to /v1/sector.","count":11,"source":"Yahoo Finance","sectors":[{"etf":"XLK","key":"technology","name":"Technology"},{"etf":"XLF","key":"financials","name":"Financials"},{"etf":"XLE","key":"energy","name":"Energy"},{"etf":"XLV","key":"health_care","name":"Health Care"},{"etf":"XLY","key":"consumer_discretionary","name":"Consumer Discretionary"},{"etf":"XLP","key":"consumer_staples","name":"Consumer Staples"},{"etf":"XLI","key":"industrials","name":"Industrials"},{"etf":"XLB","key":"materials","name":"Materials"},{"etf":"XLU","key":"utilities","name":"Utilities"},{"etf":"XLRE","key":"real_estate","name":"Real Estate"},{"etf":"XLC","key":"communication","name":"Communication Services"}]},"meta":{"timestamp":"2026-06-12T10:35:13.245Z","request_id":"3a75ee4f-8172-430b-a453-f93e1684c641"},"status":"ok","message":"Sectors retrieved successfully","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/meta":{"get":{"operationId":"get_v1_meta","tags":["Meta"],"summary":"Service metadata","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"window is 20-365 days (default 90). Correlations use daily log returns aligned on common trading days. Beta is measured against SPY. Read fresh per call, nothing cached.","source":"Yahoo Finance daily SPDR sector ETF closes, live","service":"sectorcorrelation-api","endpoints":{"GET /v1/meta":"This document.","GET /v1/matrix":"Full 11x11 sector correlation matrix with most/least correlated pairs (window=90).","GET /v1/sector":"One sector's correlations to all others, ranked, with beta to the S&P 500 (sector=technology, window=90).","GET /v1/sectors":"The eleven S&P 500 sectors."},"description":"Stock sector correlation matrix — how the eleven S&P 500 sectors move together, live from Yahoo Finance via the SPDR sector ETFs (no key, nothing stored). matrix returns the full pairwise return-correlation matrix with the most- and least-correlated sector pairs. sector returns one sector's correlation to every other, ranked, plus its beta to the S&P 500. sectors lists what is covered. The equity sector correlation / rotation cut — distinct from the cross-asset correlation matrix, the crypto and currency correlation APIs and the sector price/performance feed.","sectors_loaded":11,"upstream_status":"ok","sectors_supported":11},"meta":{"timestamp":"2026-06-12T10:35:13.551Z","request_id":"61e43c36-9f3d-41b9-b6f7-bd93fad1003c"},"status":"ok","message":"Meta","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}}},"x-oanor-pricing":[{"slug":"free","name":"Free","price_cents_month":0,"monthly_call_quota":720,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":1086,"monthly_call_quota":16700,"rps_limit":6,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":3266,"monthly_call_quota":87500,"rps_limit":16,"hard_limit":true},{"slug":"business","name":"Business","price_cents_month":7480,"monthly_call_quota":476000,"rps_limit":40,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/sectorcorrelation-api"}