Add ranking to REST API
Created by: PyvesB
Discussion extracted from Bug 548083 on the Eclipse Bugzilla.
Initial request from @PyvesB:
The REST endpoint for specific listings (http://marketplace.eclipse.org/content/[title]/api/p) returns useful information such as "favorited", "installstotal", "installsrecent", but is lacking a "ranking" field. The ranking is displayed when visiting the solution's metrics tab on the website directly.
There is an endpoint returning the most popular listings (http://marketplace.eclipse.org/popular/top/api/p), however, it's slow and impractical to use when searching for the ranking of a specific listing.
Response from @autumnfound:
Hey Pierre-Yves, I've been looking into this, and currently rankings aren't a part of the listing itself. It's some metadata that we generate and store separately (but associated to) the listing. This makes it more costly to easily access for the call you are talking about. We could look at creating another API endpoint, something like /rankings/$node_id/api/p as an alternative that doesn't impact overall API performance. Does that work for you?
Response from @PyvesB:
Hi Martin, thanks for the response! Having a separate API endpoint would work great as well, however, could it rather be a title-based one, or possibly have both node id and title variants as for the specific listings endpoint (maybe /rankings/node/
node_id/api/p and /rankings/content/
title/api/p)?A bit of context on what I'm trying to achieve. I'm one of the maintainers of the popular Shields.io service, which produces most of the badges you see in Readmes and various other websites. A while back, I contributed 6 new badges that integrate with the Eclipse Marketplace API (monthly downloads, total downloads, favorites, license, last updated and version). As an example, here's one of my Eclipse plugins on GitHub, you will notice some of the badges in the Readme: https://github.com/PyvesB/Notepad4e
As you will have guessed, I plan on adding a new badge that will allow users to display their solution's ranking on the marketplace. All other badges require the user to provide the title (as they generally don't know the node id), hence my preference on the title-based endpoint. :)
Response from @chrisguindon:
We are currently in the process of rewriting the Api specs for Eclipse Marketplace: https://github.com/EclipseFdn/marketplace-rest-api-specs
We won't be adding new features to the current API but I think this is something that we can include in v2.
Pierre,
Could you open an issue about this against https://github.com/EclipseFdn/marketplace-rest-api-specs/issues and close this one has moved?
If a V2 is currently designed, I'm not sure how relevant the above conversations are, but they can at least be the basis for further discussions.