{
  "openapi": "3.1.0",
  "info": {
    "title": "DC Hub — Data Center Intelligence Platform",
    "description": "DC Hub is a global data center intelligence platform tracking 21,000+ facilities across 170+ countries. Provides real-time energy pricing, grid fuel mix, carbon intensity, M&A transactions, capacity pipeline, site scoring, and market intelligence for AI agents and investment analysts. Free tier endpoints require no authentication. Pro tier endpoints require a Bearer token.",
    "version": "1.0.0",
    "contact": {
      "name": "DC Hub",
      "url": "https://dchub.cloud/connect"
    }
  },
  "servers": [
    {
      "url": "https://dchub.cloud",
      "description": "DC Hub Production API"
    }
  ],
  "paths": {
    "/api/agent/facilities": {
      "get": {
        "operationId": "searchFacilities",
        "summary": "Search data center facilities by country, region, or query",
        "description": "Returns facility metadata including location, operator, and capacity. Free tier returns preview (2 results + total count). Pro tier returns full results.",
        "parameters": [
          {
            "name": "country",
            "in": "query",
            "required": false,
            "description": "Country name or ISO 2-letter code (e.g., US, DE, SG, BR, JP, ZA)",
            "schema": { "type": "string" }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Free-text search across facility names, operators, and locations",
            "schema": { "type": "string" }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "description": "US state filter (e.g., VA, TX, CA)",
            "schema": { "type": "string" }
          },
          {
            "name": "city",
            "in": "query",
            "required": false,
            "description": "City name filter",
            "schema": { "type": "string" }
          }
        ],
        "responses": {
          "200": {
            "description": "Facility search results with preview or full data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": { "type": "boolean" },
                    "preview": { "type": "boolean", "description": "True if free tier preview mode" },
                    "total_available": { "type": "integer", "description": "Total facilities matching query" },
                    "message": { "type": "string" },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": { "type": "string" },
                          "operator": { "type": "string" },
                          "country": { "type": "string" },
                          "state": { "type": "string" },
                          "city": { "type": "string" },
                          "latitude": { "type": "number" },
                          "longitude": { "type": "number" }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/energy/prices/{state}": {
      "get": {
        "operationId": "getEnergyPrices",
        "summary": "Get energy pricing data for a US state",
        "description": "Returns commercial and industrial electricity pricing, rate trends, and utility information for the specified state. Free tier, no auth required.",
        "parameters": [
          {
            "name": "state",
            "in": "path",
            "required": true,
            "description": "US state abbreviation (e.g., TX, VA, CA, AZ, GA, IL, OR)",
            "schema": { "type": "string" }
          }
        ],
        "responses": {
          "200": {
            "description": "Energy pricing data for the specified state",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "state": { "type": "string" },
                    "avg_commercial_rate": { "type": "string", "description": "Average commercial rate in cents/kWh" },
                    "avg_industrial_rate": { "type": "string", "description": "Average industrial rate in cents/kWh" },
                    "utilities": { "type": "array", "items": { "type": "object" } }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/grid/fuel-mix": {
      "get": {
        "operationId": "getGridFuelMix",
        "summary": "Get grid fuel mix for an ISO/region",
        "description": "Returns percentage breakdown of energy sources (gas, coal, nuclear, wind, solar, hydro) for the specified ISO or grid region. Free tier, no auth required.",
        "parameters": [
          {
            "name": "iso",
            "in": "query",
            "required": true,
            "description": "ISO/RTO identifier (e.g., ERCOT, PJM, CAISO, MISO, SPP, NYISO, ISONE)",
            "schema": { "type": "string" }
          }
        ],
        "responses": {
          "200": {
            "description": "Grid fuel mix breakdown by source",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "iso": { "type": "string" },
                    "fuel_mix": {
                      "type": "object",
                      "properties": {
                        "gas": { "type": "number" },
                        "coal": { "type": "number" },
                        "nuclear": { "type": "number" },
                        "wind": { "type": "number" },
                        "solar": { "type": "number" },
                        "hydro": { "type": "number" },
                        "other": { "type": "number" }
                      }
                    },
                    "renewable_pct": { "type": "number" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/carbon/intensity": {
      "get": {
        "operationId": "getCarbonIntensity",
        "summary": "Get carbon intensity of grid power",
        "description": "Returns CO2 emissions per MWh for the specified state or region. Free tier, no auth required.",
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "required": true,
            "description": "US state abbreviation (e.g., TX, VA, CA)",
            "schema": { "type": "string" }
          }
        ],
        "responses": {
          "200": {
            "description": "Carbon intensity metrics",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "state": { "type": "string" },
                    "carbon_intensity_gCO2_per_kWh": { "type": "number" },
                    "primary_source": { "type": "string" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/renewable/combined": {
      "get": {
        "operationId": "getRenewablePotential",
        "summary": "Get renewable energy potential for a state",
        "description": "Returns solar and wind generation potential, installed capacity, and growth trends. Free tier, no auth required.",
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "required": true,
            "description": "US state abbreviation (e.g., TX, AZ, CA, VA)",
            "schema": { "type": "string" }
          }
        ],
        "responses": {
          "200": {
            "description": "Renewable energy potential data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "state": { "type": "string" },
                    "solar_potential": { "type": "object" },
                    "wind_potential": { "type": "object" },
                    "installed_renewable_mw": { "type": "number" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/site-score": {
      "get": {
        "operationId": "getSiteScore",
        "summary": "Get composite site suitability score for coordinates",
        "description": "Returns a multi-dimensional site score including connectivity, power reliability, environmental risk, water stress, renewable access, and regulatory environment for the given latitude/longitude. Free tier, no auth required.",
        "parameters": [
          {
            "name": "lat",
            "in": "query",
            "required": true,
            "description": "Latitude in decimal degrees (e.g., 39.0437 for Ashburn VA)",
            "schema": { "type": "number", "format": "float" }
          },
          {
            "name": "lon",
            "in": "query",
            "required": true,
            "description": "Longitude in decimal degrees (e.g., -77.4875 for Ashburn VA)",
            "schema": { "type": "number", "format": "float" }
          }
        ],
        "responses": {
          "200": {
            "description": "Site score with sub-dimensions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "latitude": { "type": "number" },
                    "longitude": { "type": "number" },
                    "overall_score": { "type": "number" },
                    "connectivity_score": { "type": "number" },
                    "power_score": { "type": "number" },
                    "environmental_risk_score": { "type": "number" },
                    "water_stress_score": { "type": "number" },
                    "renewable_access_score": { "type": "number" },
                    "regulatory_score": { "type": "number" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/transactions": {
      "get": {
        "operationId": "getTransactions",
        "summary": "Get recent M&A transactions in the data center industry",
        "description": "Returns recent mergers, acquisitions, and investment deals including deal size, parties, and market context. Free tier, no auth required.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of transactions to return (default: 20)",
            "schema": { "type": "integer", "default": 20 }
          }
        ],
        "responses": {
          "200": {
            "description": "List of M&A transactions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transactions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": { "type": "string" },
                          "date": { "type": "string" },
                          "value": { "type": "string" },
                          "buyer": { "type": "string" },
                          "seller": { "type": "string" },
                          "market": { "type": "string" }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/market-report": {
      "get": {
        "operationId": "getMarketReport",
        "summary": "Get weekly market intelligence summary",
        "description": "Returns the latest DC Hub market intelligence report including facility counts, capacity trends, pricing, and key market developments. Free tier, no auth required.",
        "responses": {
          "200": {
            "description": "Market intelligence report",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total_facilities": { "type": "integer" },
                    "total_countries": { "type": "integer" },
                    "pipeline_gw": { "type": "number" },
                    "market_summary": { "type": "string" },
                    "key_trends": { "type": "array", "items": { "type": "string" } }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/news": {
      "get": {
        "operationId": "getNews",
        "summary": "Get latest data center industry news",
        "description": "Returns real-time data center industry news aggregated from 40+ sources including M&A announcements, capacity expansions, energy developments, and regulatory changes. Free tier, no auth required.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of news items to return (default: 10)",
            "schema": { "type": "integer", "default": 10 }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Search query to filter news (e.g., 'Texas data center', 'M&A')",
            "schema": { "type": "string" }
          }
        ],
        "responses": {
          "200": {
            "description": "List of news items",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "news": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": { "type": "string" },
                          "source": { "type": "string" },
                          "url": { "type": "string" },
                          "published_at": { "type": "string" },
                          "summary": { "type": "string" }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/stats": {
      "get": {
        "operationId": "getGlobalStats",
        "summary": "Get DC Hub global platform statistics",
        "description": "Returns high-level platform stats including total facilities tracked, countries covered, providers, pipeline capacity, and transaction volume.",
        "responses": {
          "200": {
            "description": "Global platform statistics",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total_facilities": { "type": "integer" },
                    "total_countries": { "type": "integer" },
                    "total_providers": { "type": "integer" },
                    "pipeline_gw": { "type": "number" },
                    "transactions_tracked": { "type": "integer" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/water/drought": {
      "get": {
        "operationId": "getWaterStress",
        "summary": "Get water stress and drought index for a state",
        "description": "Returns water stress levels, drought conditions, and water availability risk for data center operations in the specified state. Free tier, no auth required.",
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "required": true,
            "description": "US state abbreviation (e.g., AZ, TX, CA, VA)",
            "schema": { "type": "string" }
          }
        ],
        "responses": {
          "200": {
            "description": "Water stress and drought data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "state": { "type": "string" },
                    "drought_level": { "type": "string" },
                    "water_stress_index": { "type": "number" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/capabilities": {
      "get": {
        "operationId": "getCapabilities",
        "summary": "Get DC Hub platform capability manifest",
        "description": "Returns the full list of DC Hub capabilities, available tools, data coverage, and integration options. Useful for agent self-discovery.",
        "responses": {
          "200": {
            "description": "Platform capability manifest",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "platform": { "type": "string" },
                    "capabilities": { "type": "array", "items": { "type": "string" } },
                    "tools": { "type": "array", "items": { "type": "string" } },
                    "coverage": { "type": "object" }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
