{
  "openapi": "3.1.0",
  "info": {
    "title": "DC Hub \u2014 Data Center Intelligence API",
    "version": "2.1.0",
    "description": "DC Hub provides real-time data center intelligence: facility search (20,000+ facilities, 140+ countries), M&A deal tracking, construction pipeline data, energy pricing, and site scoring.",
    "contact": {
      "name": "DC Hub Support",
      "url": "https://dchub.cloud",
      "email": "info@dchub.cloud"
    },
    "termsOfService": "https://dchub.cloud/terms",
    "license": {
      "name": "Proprietary",
      "url": "https://dchub.cloud/terms"
    }
  },
  "servers": [
    {
      "url": "https://dchub.cloud",
      "description": "Production"
    }
  ],
  "paths": {
    "/api/v1/stats": {
      "get": {
        "operationId": "getStats",
        "summary": "Platform statistics",
        "description": "Returns global stats: total facilities, countries, providers, capacity (MW)",
        "responses": {
          "200": {
            "description": "Platform statistics"
          }
        },
        "tags": [
          "Public"
        ]
      }
    },
    "/api/v1/facilities": {
      "get": {
        "operationId": "searchFacilities",
        "summary": "Search data center facilities",
        "description": "Search 20,000+ facilities by location, provider, or market",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Search term (city, provider, market)"
          },
          {
            "name": "country",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "ISO 3166-1 alpha-2 country code"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 25,
              "maximum": 100
            },
            "description": "Max results"
          }
        ],
        "responses": {
          "200": {
            "description": "Facility search results"
          }
        },
        "tags": [
          "Public"
        ]
      }
    },
    "/api/v1/markets": {
      "get": {
        "operationId": "getMarkets",
        "summary": "List all data center markets",
        "description": "Returns all tracked markets with summary statistics",
        "responses": {
          "200": {
            "description": "Market list"
          }
        },
        "tags": [
          "Public"
        ]
      }
    },
    "/api/v1/markets/compare": {
      "get": {
        "operationId": "compareMarkets",
        "summary": "Compare data center markets",
        "description": "Side-by-side comparison of two or more markets",
        "parameters": [
          {
            "name": "markets",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated market names"
          }
        ],
        "responses": {
          "200": {
            "description": "Market comparison"
          }
        },
        "tags": [
          "Public"
        ]
      }
    },
    "/api/news": {
      "get": {
        "operationId": "getNews",
        "summary": "Latest industry news",
        "description": "Aggregated from 40+ data center industry sources",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 10
            },
            "description": "Max results"
          }
        ],
        "responses": {
          "200": {
            "description": "News articles"
          }
        },
        "tags": [
          "Public"
        ]
      }
    },
    "/api/v1/transactions": {
      "get": {
        "operationId": "getTransactions",
        "summary": "M&A transactions and deals",
        "description": "Recent acquisitions, investments, and joint ventures",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 20
            }
          },
          {
            "name": "deal_type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "acquisition",
                "investment",
                "joint_venture",
                "lease",
                "development"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transaction list"
          }
        },
        "tags": [
          "Public"
        ]
      }
    },
    "/api/v1/pipeline": {
      "get": {
        "operationId": "getPipeline",
        "summary": "Construction pipeline",
        "description": "Data centers under construction or announced",
        "responses": {
          "200": {
            "description": "Pipeline data"
          }
        },
        "tags": [
          "Public"
        ]
      }
    },
    "/api/site-score": {
      "get": {
        "operationId": "getSiteScore",
        "summary": "Site suitability score",
        "description": "Score (0-100) for data center development at a location",
        "parameters": [
          {
            "name": "lat",
            "in": "query",
            "schema": {
              "type": "number"
            },
            "required": true
          },
          {
            "name": "lon",
            "in": "query",
            "schema": {
              "type": "number"
            },
            "required": true
          },
          {
            "name": "state",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "US state abbreviation"
          }
        ],
        "responses": {
          "200": {
            "description": "Site score"
          }
        },
        "tags": [
          "Public"
        ]
      }
    },
    "/api/grid/fuel-mix": {
      "get": {
        "operationId": "getGridFuelMix",
        "summary": "Real-time power grid fuel mix",
        "parameters": [
          {
            "name": "iso",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "ERCOT",
                "PJM",
                "CAISO",
                "MISO",
                "SPP",
                "NYISO",
                "ISONE"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Grid fuel mix data"
          }
        },
        "tags": [
          "Public"
        ]
      }
    },
    "/api/energy/prices/{state}": {
      "get": {
        "operationId": "getEnergyPrices",
        "summary": "Electricity pricing by US state",
        "parameters": [
          {
            "name": "state",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Energy pricing"
          }
        },
        "tags": [
          "Public"
        ]
      }
    },
    "/api/v1/facilities/detail/{facility_id}": {
      "get": {
        "operationId": "getFacilityDetail",
        "summary": "Full facility record",
        "description": "Detailed info including contacts, capacity, certifications. Requires API key.",
        "parameters": [
          {
            "name": "facility_id",
            "in": "path",
            "schema": {
              "type": "integer"
            },
            "required": true
          }
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Facility detail"
          },
          "401": {
            "description": "API key required"
          }
        },
        "tags": [
          "Pro"
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "API key from https://dchub.cloud/pricing"
      }
    }
  },
  "tags": [
    {
      "name": "Public",
      "description": "Free endpoints \u2014 no auth required"
    },
    {
      "name": "Pro",
      "description": "Requires API key ($49/mo)"
    }
  ]
}