{"openapi": "3.1.0", "info": {"title": "PairBook API", "version": "1.0.0", "description": "Correlation, covariance, beta, volatility and ETF holdings overlap for US stocks and ETFs. Static JSON, refreshed daily after the US close. Free with attribution.", "termsOfService": "https://www.pairbook.io/api/"}, "servers": [{"url": "https://www.pairbook.io"}], "paths": {"/api/v1/index.json": {"get": {"summary": "Universe index: every covered symbol with its canonical slug and endpoints", "responses": {"200": {"description": "Universe listing", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Index"}}}}}}}, "/api/v1/symbols/{slug}.json": {"get": {"summary": "One asset: beta, volatility, returns, most correlated partners, diversifiers", "parameters": [{"name": "slug", "in": "path", "required": true, "schema": {"type": "string"}, "example": "aapl"}], "responses": {"200": {"description": "Symbol analytics", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Symbol"}}}}, "404": {"description": "Unknown symbol"}}}}, "/api/v1/pairs/{pair}.json": {"get": {"summary": "One pair: correlations over 1/3/5 years, covariance, betas, volatilities, holdings overlap", "parameters": [{"name": "pair", "in": "path", "required": true, "description": "Two slugs in alphabetical order joined by -vs-", "schema": {"type": "string"}, "example": "aapl-vs-msft"}], "responses": {"200": {"description": "Pair analytics", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Pair"}}}}, "404": {"description": "Pair not tracked"}}}}, "/api/v1/series/{slug}.json": {"get": {"summary": "Weekly return series for one asset (up to 156 weeks)", "parameters": [{"name": "slug", "in": "path", "required": true, "schema": {"type": "string"}, "example": "aapl"}], "responses": {"200": {"description": "Weekly return series", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Series"}}}}, "404": {"description": "Unknown symbol"}}}}, "/api/v1/badge/{pair}.svg": {"get": {"summary": "Embeddable SVG badge showing the pair's 3-year correlation", "parameters": [{"name": "pair", "in": "path", "required": true, "schema": {"type": "string"}, "example": "spy-vs-tlt"}], "responses": {"200": {"description": "SVG image", "content": {"image/svg+xml": {}}}}}}}, "components": {"schemas": {"Index": {"type": "object", "properties": {"as_of": {"type": "string", "format": "date"}, "symbols_count": {"type": "integer"}, "pairs_count": {"type": "integer"}, "symbols": {"type": "array", "items": {"type": "object", "properties": {"symbol": {"type": "string"}, "slug": {"type": "string"}, "name": {"type": "string"}, "kind": {"type": "string", "enum": ["stock", "etf"]}, "page": {"type": "string"}, "api": {"type": "string"}}}}}}, "Symbol": {"type": "object", "properties": {"symbol": {"type": "string"}, "name": {"type": "string"}, "kind": {"type": "string"}, "as_of": {"type": "string", "format": "date"}, "beta_vs_spy_3y": {"type": ["number", "null"]}, "volatility_ann_pct_3y": {"type": ["number", "null"]}, "return_pct": {"type": "object"}, "most_correlated_3y": {"type": "array", "items": {"type": "object"}}, "diversifiers_3y": {"type": "array", "items": {"type": "object"}}}}, "Series": {"type": "object", "properties": {"symbol": {"type": "string"}, "as_of": {"type": "string", "format": "date"}, "freq": {"type": "string"}, "window_weeks": {"type": "integer"}, "returns": {"type": "array", "items": {"type": "number"}}}}, "Pair": {"type": "object", "properties": {"a": {"type": "string"}, "b": {"type": "string"}, "as_of": {"type": "string", "format": "date"}, "correlation_weekly": {"type": "object", "properties": {"1y": {"type": ["number", "null"]}, "3y": {"type": ["number", "null"]}, "5y": {"type": ["number", "null"]}}}, "covariance_ann_pct2_3y": {"type": ["number", "null"]}, "beta_vs_spy_3y": {"type": "object"}, "volatility_ann_pct_3y": {"type": "object"}, "holdings_overlap": {"type": ["object", "null"]}}}}}}