From 8d492aef2eabdaea392a11a990f6846cef42482d Mon Sep 17 00:00:00 2001 From: Istvan Soos Date: Tue, 26 Aug 2025 12:25:16 +0200 Subject: [PATCH 1/2] Promoting more endpoint to public API: publisher and score. --- doc/help-api.md | 51 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/doc/help-api.md b/doc/help-api.md index 35b7480c72..d15ab297a2 100644 --- a/doc/help-api.md +++ b/doc/help-api.md @@ -50,6 +50,7 @@ Notes: * The order of the packages reflects their overall ranking on `pub.dev`. * The inclusion criteria used by `pub.dev` may change without notice. + ### Package names for archiving and mirrors **GET** `https://pub.dev/api/package-names` @@ -85,6 +86,56 @@ Notes: * The order of the packages, the number of packages on a response page, or the URL structure of `"nextUrl"` may change without notice. + +### Package metadata: publisher + +**GET** `https://pub.dev/api/packages//publisher` + +**Response** +* `cache-control: public, max-age=120` +* `content-type: application/json; charset="utf-8"` + +```js +{ + "publisherId": "dart.dev" +} +``` + +The API returns the publisher of the requested ``, or `null` if the +package is not under a publisher. + + +### Package metadata: score + +**GET** `https://pub.dev/api/packages//score` + +**Response** +* `cache-control: public, max-age=120` +* `content-type: application/json; charset="utf-8"` + +```js +{ + "grantedPoints": 160, + "maxPoints": 160, + "likeCount": 8297, + "downloadCount30Days": 11831655, + "tags": [ + "sdk:dart", + "sdk:flutter", + "platform:android", + /* further tags */ + ], +} +``` + +The API returns the current scores and score-related metadata for the package: +- `likeCount`: the number of likes on the package +- `downloadCount30Days`: the 30-days download count of the package +- `grantedPoints` / `maxPoints`: the current values of `pana` scores +- `tags`: the tags assigned by `pana` or by `pub.dev` + +Absent values or values that are not calculated yet return `null`. + ## FAQ ### I'd like to implement search, what API can I use? From be2cb923ee76ed1627b5f4d6c6a95f271693d86f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20So=C3=B3s?= Date: Tue, 26 Aug 2025 12:16:30 +0200 Subject: [PATCH 2/2] Update doc/help-api.md Co-authored-by: Sigurd Meldgaard --- doc/help-api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/help-api.md b/doc/help-api.md index d15ab297a2..8b43aba7fa 100644 --- a/doc/help-api.md +++ b/doc/help-api.md @@ -134,7 +134,7 @@ The API returns the current scores and score-related metadata for the package: - `grantedPoints` / `maxPoints`: the current values of `pana` scores - `tags`: the tags assigned by `pana` or by `pub.dev` -Absent values or values that are not calculated yet return `null`. +If a value has not been calculated yet (e.g. for newly created packages) it will be `null`. ## FAQ