Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: trends api #697

Merged
merged 1 commit into from
Jun 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions docs/registry-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
* [Package](/docs/registry-api.md#package)
* [User](/docs/registry-api.md#user)
* [Search](/docs/registry-api.md#search)
* [Token](/docs/registry-api.md#token)
* [Trend](/docs/registry-api.md#trend)

[![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/f6c8cb46358039bcd689#?env%5BRegistry%5D=W3sia2V5IjoicmVnaXN0cnkiLCJ0eXBlIjoidGV4dCIsInZhbHVlIjoiaHR0cHM6Ly9yZWdpc3RyeS5ucG0udGFvYmFvLm9yZyIsImVuYWJsZWQiOnRydWV9LHsia2V5IjoicGFja2FnZSIsInZhbHVlIjoiY25wbSIsInR5cGUiOiJ0ZXh0IiwiZW5hYmxlZCI6dHJ1ZX1d)

Expand Down Expand Up @@ -1036,3 +1038,32 @@ GET /-/npm/v1/tokens/token/:UUID
```

#### Response 204

## Trend

### get download trends for a package

```
GET /downloads/range/:start::end/:pkgName
```

#### Response 200

```json
HTTP/1.1 200 OK

// /downloads/range/2024-01-01:2024-12-31/cnpmcore
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{
"downloads": [
// ...
{ "day": "2024-01-03", "downloads": 2 },
{ "day": "2024-05-30", "downloads": 16 }
],
"versions": {
// ...
"3.61.1": [{ "day": "2024-05-30", "downloads": 5 }],
"3.61.2": [{ "day": "2024-05-30", "downloads": 5 }],
"3.61.3": [{ "day": "2024-05-30", "downloads": 6 }]
}
}
fengmk2 marked this conversation as resolved.
Show resolved Hide resolved
```
Loading