{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/npm/json-schema/npm-search-results-schema.json",
  "title": "SearchResults",
  "description": "Search results from the npm registry search endpoint.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/npm-search-api-openapi.yml#/components/schemas/SearchResults",
  "type": "object",
  "properties": {
    "objects": {
      "type": "array",
      "description": "List of search result objects.",
      "items": {
        "$ref": "#/$defs/SearchResultItem"
      }
    },
    "total": {
      "type": "integer",
      "description": "The total number of matching results."
    },
    "time": {
      "type": "string",
      "description": "Timestamp of when the search was performed."
    }
  },
  "$defs": {
    "Person": {
      "type": "object",
      "description": "A person object representing a user, author, or maintainer.",
      "properties": {
        "name": {
          "type": "string",
          "description": "The display name of the person."
        },
        "email": {
          "type": "string",
          "format": "email",
          "description": "The email address of the person."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "The personal URL or website of the person."
        }
      }
    },
    "SearchResultItem": {
      "type": "object",
      "description": "A single search result item containing package metadata and scoring information.",
      "properties": {
        "package": {
          "type": "object",
          "description": "Summary package metadata.",
          "properties": {
            "name": {
              "type": "string",
              "description": "The package name."
            },
            "scope": {
              "type": "string",
              "description": "The package scope, or \"unscoped\" if none."
            },
            "version": {
              "type": "string",
              "description": "The latest version of the package."
            },
            "description": {
              "type": "string",
              "description": "A short description of the package."
            },
            "keywords": {
              "type": "array",
              "description": "Keywords associated with the package.",
              "items": {
                "type": "string"
              }
            },
            "date": {
              "type": "string",
              "format": "date-time",
              "description": "The publication date of the latest version."
            },
            "links": {
              "type": "object",
              "description": "Links to related resources such as npm page, homepage, repository, and bugs.",
              "additionalProperties": {
                "type": "string"
              }
            },
            "author": {
              "$ref": "#/$defs/Person"
            },
            "publisher": {
              "$ref": "#/$defs/Person"
            },
            "maintainers": {
              "type": "array",
              "description": "List of package maintainers.",
              "items": {
                "$ref": "#/$defs/Person"
              }
            }
          }
        },
        "score": {
          "type": "object",
          "description": "Scoring breakdown for the package.",
          "properties": {
            "final": {
              "type": "number",
              "description": "The final combined score."
            },
            "detail": {
              "type": "object",
              "description": "Detailed score breakdown.",
              "properties": {
                "quality": {
                  "type": "number",
                  "description": "The quality score component."
                },
                "popularity": {
                  "type": "number",
                  "description": "The popularity score component."
                },
                "maintenance": {
                  "type": "number",
                  "description": "The maintenance score component."
                }
              }
            }
          }
        },
        "searchScore": {
          "type": "number",
          "description": "The search relevance score for this result."
        }
      }
    }
  }
}