{
  "openapi": "3.1.0",
  "info": {
    "title": "installer API",
    "version": "ddeb895 - 2026-12-03-034910",
    "description": "Read install counts and install commands of GitHub releases installed through installer.dev. Public and read only, no key needed.",
    "license": {
      "name": "MIT",
      "identifier": "MIT"
    }
  },
  "externalDocs": {
    "url": "https://installer.dev/docs/api"
  },
  "servers": [
    {
      "url": "https://installer.dev"
    },
    {
      "url": "https://instl.sh"
    }
  ],
  "security": [],
  "tags": [
    {
      "name": "stats",
      "description": "Install counts"
    },
    {
      "name": "commands",
      "description": "Install commands and script options"
    }
  ],
  "paths": {
    "/api/stats/{owner}/{repo}": {
      "get": {
        "operationId": "getRepositoryStats",
        "tags": [
          "stats"
        ],
        "summary": "Install counts of one repository",
        "parameters": [
          {
            "name": "owner",
            "in": "path",
            "required": true,
            "description": "GitHub user or organization, as in github.com/{owner}.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9](?:[A-Za-z0-9]|-(?=[A-Za-z0-9])){0,38}$"
            },
            "example": "installer"
          },
          {
            "name": "repo",
            "in": "path",
            "required": true,
            "description": "Repository name, as in github.com/{owner}/{repo}.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._-]{1,100}$"
            },
            "example": "demo"
          }
        ],
        "responses": {
          "200": {
            "description": "The install counts. A repository without installs returns zero counts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RepositoryStats"
                }
              }
            }
          },
          "404": {
            "description": "Not a name GitHub would accept.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from one client. Wait for the minute to pass.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The stats database is unreachable. Send the request again later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/stats/{owner}": {
      "get": {
        "operationId": "getOwnerStats",
        "tags": [
          "stats"
        ],
        "summary": "Install counts across every repository of one owner",
        "parameters": [
          {
            "name": "owner",
            "in": "path",
            "required": true,
            "description": "GitHub user or organization, as in github.com/{owner}.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9](?:[A-Za-z0-9]|-(?=[A-Za-z0-9])){0,38}$"
            },
            "example": "installer"
          }
        ],
        "responses": {
          "200": {
            "description": "The install counts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OwnerStats"
                }
              }
            }
          },
          "404": {
            "description": "Not a name GitHub would accept.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from one client. Wait for the minute to pass.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The stats database is unreachable. Send the request again later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/stats": {
      "get": {
        "operationId": "getSiteStats",
        "tags": [
          "stats"
        ],
        "summary": "Install counts across every repository",
        "responses": {
          "200": {
            "description": "The install counts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteStats"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from one client. Wait for the minute to pass.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The stats database is unreachable. Send the request again later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/trending": {
      "get": {
        "operationId": "getTrending",
        "tags": [
          "stats"
        ],
        "summary": "Repositories whose installs grew the most in the last 7 days",
        "responses": {
          "200": {
            "description": "The trending repositories.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Trending"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from one client. Wait for the minute to pass.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The stats database is unreachable. Send the request again later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/commands/{owner}/{repo}": {
      "get": {
        "operationId": "getCommands",
        "tags": [
          "commands"
        ],
        "summary": "Install and uninstall commands of one repository, for every platform",
        "parameters": [
          {
            "name": "owner",
            "in": "path",
            "required": true,
            "description": "GitHub user or organization, as in github.com/{owner}.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9](?:[A-Za-z0-9]|-(?=[A-Za-z0-9])){0,38}$"
            },
            "example": "installer"
          },
          {
            "name": "repo",
            "in": "path",
            "required": true,
            "description": "Repository name, as in github.com/{owner}/{repo}.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._-]{1,100}$"
            },
            "example": "demo"
          },
          {
            "name": "version",
            "in": "query",
            "required": false,
            "description": "Release tag the install commands pin. Latest release when missing.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._+/-]{1,128}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The commands.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RepositoryCommands"
                }
              }
            }
          },
          "400": {
            "description": "Not a valid release tag.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not a name GitHub would accept.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from one client. Wait for the minute to pass.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/options": {
      "get": {
        "operationId": "getOptions",
        "tags": [
          "commands"
        ],
        "summary": "Script URLs, query parameters and environment variables of the install scripts",
        "responses": {
          "200": {
            "description": "The options.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScriptOptions"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from one client. Wait for the minute to pass.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          }
        }
      },
      "Platform": {
        "type": "string",
        "enum": [
          "linux",
          "macos",
          "windows"
        ]
      },
      "PlatformCounts": {
        "type": "object",
        "description": "unix counts installs through install.sh, which serves Linux and macOS alike. linux, macos and windows count the URLs that name them.",
        "required": [
          "unix",
          "linux",
          "macos",
          "windows"
        ],
        "properties": {
          "unix": {
            "type": "integer",
            "minimum": 0
          },
          "linux": {
            "type": "integer",
            "minimum": 0
          },
          "macos": {
            "type": "integer",
            "minimum": 0
          },
          "windows": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "PeriodCounts": {
        "type": "object",
        "required": [
          "installs",
          "platforms"
        ],
        "properties": {
          "installs": {
            "type": "integer",
            "minimum": 0
          },
          "platforms": {
            "$ref": "#/components/schemas/PlatformCounts"
          }
        }
      },
      "RecentCounts": {
        "type": "object",
        "description": "Installs of the last 7 and the last 30 days, both including today.",
        "required": [
          "week",
          "month"
        ],
        "properties": {
          "week": {
            "$ref": "#/components/schemas/PeriodCounts"
          },
          "month": {
            "$ref": "#/components/schemas/PeriodCounts"
          }
        }
      },
      "DailyInstalls": {
        "type": "object",
        "required": [
          "date",
          "installs"
        ],
        "properties": {
          "date": {
            "type": "string",
            "format": "date"
          },
          "installs": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "Daily": {
        "type": "array",
        "description": "One entry per day, oldest first, ending today. Days without installs count 0.",
        "items": {
          "$ref": "#/components/schemas/DailyInstalls"
        }
      },
      "RepositoryInstalls": {
        "type": "object",
        "required": [
          "repository",
          "installs"
        ],
        "properties": {
          "repository": {
            "type": "string",
            "description": "Lowercased {owner}/{repo}."
          },
          "installs": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "RepositoryStats": {
        "type": "object",
        "required": [
          "repository",
          "total",
          "platforms",
          "recent",
          "daily"
        ],
        "properties": {
          "repository": {
            "type": "string",
            "description": "Lowercased {owner}/{repo}."
          },
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "platforms": {
            "$ref": "#/components/schemas/PlatformCounts"
          },
          "recent": {
            "$ref": "#/components/schemas/RecentCounts"
          },
          "daily": {
            "$ref": "#/components/schemas/Daily",
            "description": "The last 90 days."
          }
        }
      },
      "OwnerStats": {
        "type": "object",
        "required": [
          "owner",
          "total",
          "platforms",
          "recent",
          "repositories",
          "top",
          "daily"
        ],
        "properties": {
          "owner": {
            "type": "string",
            "description": "Lowercased {owner}."
          },
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "platforms": {
            "$ref": "#/components/schemas/PlatformCounts"
          },
          "recent": {
            "$ref": "#/components/schemas/RecentCounts"
          },
          "repositories": {
            "type": "integer",
            "minimum": 0,
            "description": "Repositories of the owner with at least one install."
          },
          "top": {
            "type": "array",
            "description": "Up to 50 repositories with at least 10 installs, most installed first.",
            "items": {
              "$ref": "#/components/schemas/RepositoryInstalls"
            }
          },
          "daily": {
            "$ref": "#/components/schemas/Daily",
            "description": "The last 90 days."
          }
        }
      },
      "SiteStats": {
        "type": "object",
        "required": [
          "total",
          "platforms",
          "recent",
          "repositories",
          "top",
          "daily"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "platforms": {
            "$ref": "#/components/schemas/PlatformCounts"
          },
          "recent": {
            "$ref": "#/components/schemas/RecentCounts"
          },
          "repositories": {
            "type": "integer",
            "minimum": 0,
            "description": "Repositories with at least one install."
          },
          "top": {
            "type": "array",
            "description": "Up to 50 repositories with at least 10 installs, most installed first.",
            "items": {
              "$ref": "#/components/schemas/RepositoryInstalls"
            }
          },
          "daily": {
            "$ref": "#/components/schemas/Daily",
            "description": "The last 90 days."
          }
        }
      },
      "Trending": {
        "type": "object",
        "required": [
          "days",
          "trending"
        ],
        "properties": {
          "days": {
            "type": "integer",
            "minimum": 0,
            "description": "Length of each of the two compared periods."
          },
          "trending": {
            "type": "array",
            "description": "Up to 10 repositories, the fastest growing first.",
            "items": {
              "type": "object",
              "required": [
                "repository",
                "installs",
                "previousInstalls",
                "daily"
              ],
              "properties": {
                "repository": {
                  "type": "string",
                  "description": "Lowercased {owner}/{repo}."
                },
                "installs": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Installs in the last `days` days, including today."
                },
                "previousInstalls": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Installs in the `days` days before."
                },
                "daily": {
                  "$ref": "#/components/schemas/Daily",
                  "description": "Both periods, oldest first."
                }
              }
            }
          }
        }
      },
      "ScriptCommand": {
        "type": "object",
        "required": [
          "command",
          "url"
        ],
        "properties": {
          "command": {
            "type": "string",
            "description": "The one-liner to run."
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "The script URL the command fetches."
          }
        }
      },
      "PlatformCommands": {
        "type": "object",
        "description": "Linux and macOS share the install.sh command.",
        "required": [
          "linux",
          "macos",
          "windows"
        ],
        "properties": {
          "linux": {
            "$ref": "#/components/schemas/ScriptCommand"
          },
          "macos": {
            "$ref": "#/components/schemas/ScriptCommand"
          },
          "windows": {
            "$ref": "#/components/schemas/ScriptCommand"
          }
        }
      },
      "RepositoryCommands": {
        "type": "object",
        "required": [
          "repository",
          "version",
          "install",
          "uninstall"
        ],
        "properties": {
          "repository": {
            "type": "string",
            "description": "{owner}/{repo}, as requested."
          },
          "version": {
            "type": [
              "string",
              "null"
            ],
            "description": "The pinned release tag, or null for the latest release."
          },
          "install": {
            "$ref": "#/components/schemas/PlatformCommands"
          },
          "uninstall": {
            "$ref": "#/components/schemas/PlatformCommands"
          }
        }
      },
      "EnvironmentVariable": {
        "type": "object",
        "required": [
          "name",
          "default",
          "values",
          "platforms",
          "description"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "default": {
            "type": [
              "string",
              "null"
            ],
            "description": "The value the scripts use when the variable is unset, or null when there is none or it depends on the machine."
          },
          "values": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "The accepted values, or null for free text."
          },
          "platforms": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Platform"
            }
          },
          "description": {
            "type": "string"
          }
        }
      },
      "QueryParameter": {
        "type": "object",
        "required": [
          "name",
          "default",
          "description"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "default": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": "string"
          }
        }
      },
      "ScriptOptions": {
        "type": "object",
        "required": [
          "domains",
          "platforms",
          "scriptFiles",
          "scripts",
          "parameters",
          "environment"
        ],
        "properties": {
          "domains": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "platforms": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Platform"
            }
          },
          "scriptFiles": {
            "type": "object",
            "description": "The script file of each platform, the value for {script}.",
            "required": [
              "linux",
              "macos",
              "windows"
            ],
            "properties": {
              "linux": {
                "type": "string",
                "enum": [
                  "install.sh",
                  "install.ps1"
                ]
              },
              "macos": {
                "type": "string",
                "enum": [
                  "install.sh",
                  "install.ps1"
                ]
              },
              "windows": {
                "type": "string",
                "enum": [
                  "install.sh",
                  "install.ps1"
                ]
              }
            }
          },
          "scripts": {
            "type": "object",
            "description": "URL templates with {owner}, {repo} and {script} to fill in.",
            "required": [
              "install",
              "installVerbose",
              "uninstall",
              "update",
              "remove"
            ],
            "properties": {
              "install": {
                "type": "string"
              },
              "installVerbose": {
                "type": "string"
              },
              "uninstall": {
                "type": "string"
              },
              "update": {
                "type": "string"
              },
              "remove": {
                "type": "string"
              }
            }
          },
          "parameters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QueryParameter"
            }
          },
          "environment": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EnvironmentVariable"
            }
          }
        }
      }
    }
  }
}
