{
  "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. Full-data endpoints require an X-API-Key header (claim a free key via the claim_free_key MCP tool or POST /api/v1/keys/claim).",
    "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/v1/ai-capacity-index": {
      "get": {
        "operationId": "findDeployableCapacity",
        "summary": "Find where N MW of AI compute can land — markets ranked by deployable capacity",
        "description": "Find where N MW can deploy. US markets ranked by deployable MW for a 30/60/90-day horizon, each with deployable_mw, facility_count, operator_count, hyperscale_ready, score. Covers Dallas (dallas-tx), N. Virginia, Phoenix, etc. Call this FIRST for 'find me 100 MW in <market>' questions.",
        "parameters": [
          {
            "name": "horizon",
            "in": "query",
            "required": false,
            "description": "Time-to-power horizon in days: 30, 60, or 90. Default 90.",
            "schema": { "type": "integer", "default": 90 }
          }
        ],
        "responses": {
          "200": {
            "description": "Markets ranked by deployable capacity",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "index_name": { "type": "string" },
                    "horizon_days": { "type": "integer" },
                    "markets": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "market": { "type": "string" },
                          "city": { "type": "string" },
                          "state": { "type": "string" },
                          "deployable_mw": { "type": "number" },
                          "facility_count": { "type": "integer" },
                          "operator_count": { "type": "integer" },
                          "hyperscale_ready": { "type": "boolean" },
                          "score": { "type": "number" },
                          "rank": { "type": "integer" }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/market-brief/{slug}": {
      "get": {
        "operationId": "getMarketBrief",
        "summary": "Full market brief for one market — power, grid, pipeline, operators, M&A",
        "description": "Live brief for one market slug (dallas, northern-virginia, phoenix, atlanta, ...): hero KPIs, power & grid capacity (MW), construction pipeline, operators, and M&A. Free gets KPIs + outlook; Pro unlocks full depth. Use for 'how much capacity is in <market>'.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Market slug, e.g. dallas, northern-virginia, phoenix, atlanta, chicago",
            "schema": { "type": "string" }
          }
        ],
        "responses": {
          "200": {
            "description": "Market brief JSON (hero, kpis, power_grid, pipeline, operators, ma)",
            "content": { "application/json": { "schema": { "type": "object", "properties": { "ok": { "type": "boolean" }, "hero": { "type": "object" }, "kpis": { "type": "object" }, "power_grid": { "type": "object" }, "pipeline": { "type": "object" }, "operators": { "type": "object" }, "ma": { "type": "object" } } } } }
          },
          "404": { "description": "market not found" }
        }
      }
    },
    "/api/v1/markets": {
      "get": {
        "operationId": "rankMarkets",
        "summary": "Rank / list data-center markets by power capacity",
        "description": "Data-center markets ranked by total power capacity (MW), each with name, cities, facility_count, total_power_mw. Use for 'rank the top US markets by power capacity' or to list markets. Free tier, no auth.",
        "responses": {
          "200": {
            "description": "Markets ranked by capacity",
            "content": { "application/json": { "schema": { "type": "object", "properties": {
              "count": { "type": "integer" },
              "data": { "type": "array", "items": { "type": "object", "properties": {
                "id": { "type": "string" },
                "name": { "type": "string" },
                "cities": { "type": "array", "items": { "type": "string" } },
                "facility_count": { "type": "integer" },
                "total_power_mw": { "type": "number" }
              } } }
            } } } }
          }
        }
      }
    },
    "/api/v1/markets/compare": {
      "get": {
        "operationId": "compareMarkets",
        "summary": "Compare two or more data-center markets side by side",
        "description": "Side-by-side comparison of markets (power MW, facility counts, operators, pricing context). Use for 'compare Dallas vs Phoenix'. Pass comma-separated market slugs. Free tier, no auth.",
        "parameters": [
          {
            "name": "markets",
            "in": "query",
            "required": true,
            "description": "Comma-separated market slugs, e.g. dallas,phoenix or northern-virginia,dallas,phoenix",
            "schema": { "type": "string" }
          }
        ],
        "responses": {
          "200": {
            "description": "Market comparison",
            "content": { "application/json": { "schema": { "type": "object", "properties": {
              "success": { "type": "boolean" },
              "comparison": { "type": "object" },
              "generated_at": { "type": "string" }
            } } } }
          }
        }
      }
    },
    "/api/v1/interconnection-queue/by-iso": {
      "get": {
        "operationId": "getInterconnectionQueue",
        "summary": "Grid interconnection queue + time-to-power for an ISO",
        "description": "Live interconnection queue for a US ISO: queued_load_total_gw, queued_load_data_center_gw, DC share %, project_count, historical_completion_pct. Use for 'what is the grid wait / queue in ERCOT'. Free tier, no auth.",
        "parameters": [
          {
            "name": "iso",
            "in": "query",
            "required": true,
            "description": "US ISO code: ERCOT, PJM, MISO, SPP, CAISO, NYISO, ISO-NE",
            "schema": { "type": "string" }
          }
        ],
        "responses": {
          "200": {
            "description": "Interconnection queue for the ISO",
            "content": { "application/json": { "schema": { "type": "object", "properties": {
              "iso": { "type": "string" },
              "project_count": { "type": "integer" },
              "queued_load_total_gw": { "type": "number" },
              "queued_load_data_center_gw": { "type": "number" },
              "queued_load_dc_share_pct": { "type": "number" },
              "historical_completion_pct": { "type": "number" },
              "as_of": { "type": "string" }
            } } } }
          }
        }
      }
    },
    "/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" }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "DC Hub API key. Claim a free key (no email) via the claim_free_key MCP tool at https://dchub.cloud/mcp or POST https://dchub.cloud/api/v1/keys/claim. Free tier works without a key (10 calls/day)."
      }
    }
  },
  "security": [ {}, { "apiKey": [] } ]
}
