Skip to content

RepoRank API

Jack Devey edited this page Feb 26, 2022 · 4 revisions

The open source community is an extremely important aspect to RepoRank, so it was important that RepoRank offered a public REST API allowing open access to the RepoRank algorithm and data.

The public endpoint is api.reporank.dev and access is completely free, there is no need for any API key or user authentication.

GET /

The root endpoint is designed to allow clients to verify the status of the API, to check the service is running. It also acts as a nice landing page to anyone who stumbles across the domain.

Example response

{
   "header": {
      "code": 200,
      "message": "OK"
   },
   "body": {
      "title": "🔥RepoRank Public API",
      "version": "1.0.0",
      "github": "https://github.com/jackdevey/reporank",
      "docs": "https://github.com/jackdevey/reporank/wiki/RepoRank-API",
      "frontend": "https://reporank.dev/"
   }
}

GET /owner/repo/

The main API endpoint for RepoRank calculates the latest score for the repo specified in the request's parameters. Simplicity is important in the design of the API, so repositories are identified using the same owner/repo format as GitHub.

Parameters

  • owner The username of the user or organization that owns the repository
  • repo The name of the repository

Example Response

Using facebook/react, request made on the 26/02/2022

{
   "header": {
      "code": 200,
      "message": "OK"
   },
   "body": {
      "score": 2531194018,
      "level": 10,
      "status": {
         "title": "Legendary",
         "color": "orange"
      },
         "breakdown": {
         "stars": 182991,
         "forks": 37365,
         "openIssues": 969,
         "codeChange": 588479,
         "community": 85
      }
   }
}

GET /owner/repo/badge

The badge API endpoint for RepoRank calculates the latest score for the repo specified in the request's parameters and generates a shields.io style badge for inclusion in GitHub readmes.

Parameters

  • owner The username of the user or organization that owns the repository
  • repo The name of the repository

Example Response

Using facebook/react, request using live data

RepoRank badge for react

Clone this wiki locally