Skip to content

API/PackMetaData stats.score and stats.downloads.pastWeek are undocumented #12

@bbfh-dev

Description

@bbfh-dev

The current schema of PackMetaData (at /api/:id/meta):

{
  docId: string
  rawId: string
  stats: {
    updated: number?
    added: number
    downloads: {
      total: number
      today: number
    }
  }
  owner: string
  contributors: string[]
}

is missing 2 fields that actually get returned by the API:

  • stats.score which contains the score used for trending sorting.
  • stats.downloads.pastWeek which reports the amount of downloads in the past week.

Example API response:

/packs/bound/meta:

{
  "docId": "5BltfprJBHfrMF1SFZwJ",
  "rawId": "bound",
  "stats": {
    "added": 1743969186740,
    "updated": 1743969186740,
    "downloads": {
      "total": 3,
      "today": 2,
      "pastWeek": 3 // Not in the schema!
    },
    "score": 1813 // Not in the schema!
  },
  "owner": "Pz0dCLQTndM6corTKpg4jsk6fOx1",
  "contributors": [
    "Pz0dCLQTndM6corTKpg4jsk6fOx1"
  ]
}

My thoughts

For score specifically, it should be documented since it's not self-explanatory what it does.

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiRelated to the smithed apiinvalidThis doesn't seem right

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions