|
50 | 50 | * The order of the packages reflects their overall ranking on `pub.dev`. |
51 | 51 | * The inclusion criteria used by `pub.dev` may change without notice. |
52 | 52 |
|
| 53 | + |
53 | 54 | ### Package names for archiving and mirrors |
54 | 55 |
|
55 | 56 | **GET** `https://pub.dev/api/package-names` |
@@ -85,6 +86,56 @@ Notes: |
85 | 86 | * The order of the packages, the number of packages on a response page, |
86 | 87 | or the URL structure of `"nextUrl"` may change without notice. |
87 | 88 |
|
| 89 | + |
| 90 | +### Package metadata: publisher |
| 91 | + |
| 92 | +**GET** `https://pub.dev/api/packages/<package>/publisher` |
| 93 | + |
| 94 | +**Response** |
| 95 | +* `cache-control: public, max-age=120` |
| 96 | +* `content-type: application/json; charset="utf-8"` |
| 97 | + |
| 98 | +```js |
| 99 | +{ |
| 100 | + "publisherId": "dart.dev" |
| 101 | +} |
| 102 | +``` |
| 103 | + |
| 104 | +The API returns the publisher of the requested `<package>`, or `null` if the |
| 105 | +package is not under a publisher. |
| 106 | + |
| 107 | + |
| 108 | +### Package metadata: score |
| 109 | + |
| 110 | +**GET** `https://pub.dev/api/packages/<package>/score` |
| 111 | + |
| 112 | +**Response** |
| 113 | +* `cache-control: public, max-age=120` |
| 114 | +* `content-type: application/json; charset="utf-8"` |
| 115 | + |
| 116 | +```js |
| 117 | +{ |
| 118 | + "grantedPoints": 160, |
| 119 | + "maxPoints": 160, |
| 120 | + "likeCount": 8297, |
| 121 | + "downloadCount30Days": 11831655, |
| 122 | + "tags": [ |
| 123 | + "sdk:dart", |
| 124 | + "sdk:flutter", |
| 125 | + "platform:android", |
| 126 | + /* further tags */ |
| 127 | + ], |
| 128 | +} |
| 129 | +``` |
| 130 | + |
| 131 | +The API returns the current scores and score-related metadata for the package: |
| 132 | +- `likeCount`: the number of likes on the package |
| 133 | +- `downloadCount30Days`: the 30-days download count of the package |
| 134 | +- `grantedPoints` / `maxPoints`: the current values of `pana` scores |
| 135 | +- `tags`: the tags assigned by `pana` or by `pub.dev` |
| 136 | + |
| 137 | +If a value has not been calculated yet (e.g. for newly created packages) it will be `null`. |
| 138 | + |
88 | 139 | ## FAQ |
89 | 140 |
|
90 | 141 | ### I'd like to implement search, what API can I use? |
|
0 commit comments