{
  "openapi": "3.0.3",
  "info": {
    "title": "RunsWith - Stack Intelligence",
    "version": "1.10.2",
    "description": "Technology stack detection API. Know what infrastructure any company uses - hosting, email, DNS, CDN, security, and verified services."
  },
  "servers": [
    {
      "url": "https://runswith.dns.drm3.network"
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ],
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-RunsWith-Key"
      }
    }
  },
  "tags": [
    {
      "name": "Status"
    },
    {
      "name": "Domains"
    },
    {
      "name": "Search"
    },
    {
      "name": "Statistics"
    },
    {
      "name": "Monitoring"
    },
    {
      "name": "Intelligence"
    },
    {
      "name": "Enrichment"
    },
    {
      "name": "Feeds"
    },
    {
      "name": "Exports"
    },
    {
      "name": "Providers"
    },
    {
      "name": "Streams"
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "tags": [
          "Status"
        ],
        "summary": "Health check",
        "security": [],
        "responses": {
          "200": {
            "description": "Status"
          }
        }
      }
    },
    "/runswith/v1/domains/{domain}": {
      "get": {
        "tags": [
          "Domains"
        ],
        "summary": "Analyzed domain profile",
        "parameters": [
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/runswith/v1/domains/{domain}/changes": {
      "get": {
        "tags": [
          "Domains"
        ],
        "summary": "Provider transition history",
        "parameters": [
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/runswith/v1/search": {
      "get": {
        "tags": [
          "Search"
        ],
        "summary": "Search domains by name, provider, or category",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "provider",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 0
            }
          }
        ]
      }
    },
    "/runswith/v1/stats": {
      "get": {
        "tags": [
          "Statistics"
        ],
        "summary": "Aggregate stats (computed on read)"
      }
    },
    "/runswith/v1/stats/providers": {
      "get": {
        "tags": [
          "Statistics"
        ],
        "summary": "Provider leaderboard (top 50 by domain count)"
      }
    },
    "/runswith/v1/stats/migrations": {
      "get": {
        "tags": [
          "Statistics"
        ],
        "summary": "Recent provider migrations"
      }
    },
    "/runswith/v1/alerts": {
      "get": {
        "tags": [
          "Monitoring"
        ],
        "summary": "Intelligence alerts (migrations + anomalies)",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 20
            }
          }
        ]
      }
    },
    "/runswith/v1/anomalies": {
      "get": {
        "tags": [
          "Monitoring"
        ],
        "summary": "Anomaly detection (3-sigma deviations)",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 50
            }
          }
        ]
      }
    },
    "/runswith/v1/intelligence/security-scorecard": {
      "get": {
        "tags": [
          "Intelligence"
        ],
        "summary": "DMARC/SPF adoption scorecard across all domains"
      }
    },
    "/runswith/v1/intelligence/market-share": {
      "get": {
        "tags": [
          "Intelligence"
        ],
        "summary": "Provider market share by category",
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/runswith/v1/intelligence/supply-chain/{provider}": {
      "get": {
        "tags": [
          "Intelligence"
        ],
        "summary": "Supply chain concentration risk for a provider",
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/runswith/v1/intelligence/adoption/{tool}": {
      "get": {
        "tags": [
          "Intelligence"
        ],
        "summary": "Tool adoption curve and co-adoption",
        "parameters": [
          {
            "name": "tool",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/runswith/v1/intelligence/risk/{domain}": {
      "get": {
        "tags": [
          "Intelligence"
        ],
        "summary": "Domain risk profile (security + vendor concentration)",
        "parameters": [
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/runswith/v1/enrichment/status": {
      "get": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Enrichment sync state and coverage"
      }
    },
    "/runswith/v1/enrichment/advisories": {
      "get": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Security advisories affecting tracked domains",
        "parameters": [
          {
            "name": "severity",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 50
            }
          }
        ]
      }
    },
    "/runswith/v1/enrichment/affected": {
      "get": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Domains affected by known CVEs",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "severity",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 50
            }
          }
        ]
      }
    },
    "/runswith/v1/feeds/stats": {
      "get": {
        "tags": [
          "Feeds"
        ],
        "summary": "RSS feed domain aggregate stats"
      }
    },
    "/runswith/v1/feeds/leaderboard": {
      "get": {
        "tags": [
          "Feeds"
        ],
        "summary": "Feed domain leaderboard",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 20
            }
          }
        ]
      }
    },
    "/runswith/v1/feeds/domain/{domain}": {
      "get": {
        "tags": [
          "Feeds"
        ],
        "summary": "Single feed domain profile",
        "parameters": [
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/runswith/v1/security/export.csv": {
      "get": {
        "tags": [
          "Exports"
        ],
        "summary": "Security scorecard CSV export (max 1000 rows)",
        "parameters": [
          {
            "name": "sector",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "score_lte",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/runswith/v1/migrations/export.csv": {
      "get": {
        "tags": [
          "Exports"
        ],
        "summary": "Migration history CSV export (max 1000 rows)",
        "parameters": [
          {
            "name": "provider",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "direction",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "in",
                "out"
              ]
            }
          }
        ]
      }
    },
    "/runswith/v1/providers/{provider}/domains.csv": {
      "get": {
        "tags": [
          "Exports"
        ],
        "summary": "Domains using a provider CSV export (max 1000 rows)",
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/runswith/v1/providers/{provider}": {
      "get": {
        "tags": [
          "Providers"
        ],
        "summary": "Provider detail, domains, and market context",
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/runswith/v1/stream": {
      "get": {
        "tags": [
          "Streams"
        ],
        "summary": "SSE event stream (migrations, anomalies, service changes)"
      }
    },
    "/runswith/v1/stream/json": {
      "get": {
        "tags": [
          "Streams"
        ],
        "summary": "JSON event stream (polling fallback)",
        "parameters": [
          {
            "name": "since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ]
      }
    }
  }
}