{
  "openapi": "3.1.0",
  "info": {
    "title": "Skill Leaderboard Developer API",
    "version": "1.0.0",
    "description": "Read-only published catalog metadata. Pagination may shift between snapshots."
  },
  "servers": [
    {
      "url": "https://www.skillleaderboard.com"
    }
  ],
  "paths": {
    "/api/v1/repositories": {
      "get": {
        "summary": "Search repositories",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Case-insensitive substring query."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10000,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Published snapshot results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "snapshotDate",
                    "total",
                    "limit",
                    "offset",
                    "data"
                  ],
                  "properties": {
                    "snapshotDate": {
                      "type": "string",
                      "format": "date"
                    },
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "offset": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Repository"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/skills": {
      "get": {
        "summary": "Search individual skills",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Case-insensitive substring query."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10000,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Published snapshot results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "snapshotDate",
                    "total",
                    "limit",
                    "offset",
                    "data"
                  ],
                  "properties": {
                    "snapshotDate": {
                      "type": "string",
                      "format": "date"
                    },
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "offset": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Skill"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "Search names, paths and repository identities; source descriptions and file contents are not returned."
      }
    }
  },
  "components": {
    "schemas": {
      "Repository": {
        "type": "object",
        "properties": {
          "repo": {
            "type": "string"
          },
          "owner": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "ownerAvatarUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "rank": {
            "type": "integer"
          },
          "category": {
            "type": "string"
          },
          "secondaryCategories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "tagline": {
            "type": [
              "string",
              "null"
            ]
          },
          "summary": {
            "type": "string"
          },
          "stars": {
            "type": "integer"
          },
          "forks": {
            "type": [
              "integer",
              "null"
            ]
          },
          "stars7d": {
            "type": [
              "integer",
              "null"
            ]
          },
          "stars30d": {
            "type": [
              "integer",
              "null"
            ]
          },
          "delta7dPct": {
            "type": [
              "number",
              "null"
            ]
          },
          "delta30dPct": {
            "type": [
              "number",
              "null"
            ]
          },
          "estimatedGrowthPeriods": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "tractionScore": {
            "type": [
              "number",
              "null"
            ]
          },
          "compatibleAgents": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "language": {
            "type": "string"
          },
          "license": {
            "type": "object",
            "properties": {
              "display": {
                "type": "string"
              }
            },
            "required": [
              "display"
            ]
          },
          "githubCreatedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "lastUpdatedAt": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "repo",
          "owner",
          "name",
          "ownerAvatarUrl",
          "rank",
          "category",
          "secondaryCategories",
          "tagline",
          "summary",
          "stars",
          "forks",
          "stars7d",
          "stars30d",
          "delta7dPct",
          "delta30dPct",
          "tractionScore",
          "compatibleAgents",
          "language",
          "license",
          "githubCreatedAt",
          "lastUpdatedAt"
        ]
      },
      "Skill": {
        "type": "object",
        "properties": {
          "repo": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "repo",
          "name",
          "path",
          "url"
        ]
      }
    },
    "responses": {
      "Error": {
        "description": "Invalid request or data unavailable",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "string"
                }
              },
              "required": [
                "error"
              ]
            }
          }
        }
      }
    }
  }
}
