---
title: "Repository ranking by stars"
method: GET
path: "/collections/{collection_id}/ranking_by_stars/"
tags: ["Collections"]
---

# Repository ranking by stars

`GET /collections/{collection_id}/ranking_by_stars/`

## Request

- Base URL: `https://api.ossinsight.io/v1`
- URL: `https://api.ossinsight.io/v1/collections/{collection_id}/ranking_by_stars/`
- Auth: none declared

Rank the GitHub repositories in the specified collection according to the number of stars.

## Path parameters

- `collection_id` number, required

## Query parameters

- `period` 'past_28_days' | 'past_month'

## Response `200`

Default Response

- object
  - `type` 'sql_endpoint', required: The type of the endpoint.
  - `data` object, required
    - `columns` object[], required
      - `col` string, required: The name of the column in the query result.
      - `data_type` 'CHAR' | 'BIGINT' | 'DECIMAL' | 'INT' | 'UNSIGNED BIGINT' | 'TINYINT' | 'TIMESTAMP' | 'TEXT' | 'VARCHAR' | 'DATETIME' | 'DOUBLE' | 'FLOAT' | 'DATE' | 'TIME' | 'YEAR' | 'MEDIUMINT' | 'SMALLINT' | 'BIT' | 'BINARY' | 'VARBINARY' | 'JSON' | 'ENUM' | 'SET' | 'TINYTEXT' | 'MEDIUMTEXT' | 'LONGTEXT' | 'TINYBLOB' | 'MEDIUMBLOB' | 'BLOB' | 'LONGBLOB', required: The data type of the column.
      - `nullable` boolean, required: Whether the column is nullable.
    - `rows` object[], required
      - `repo_id` string: The repository ID
      - `repo_name` string: The repository name
      - `current_period_growth` string: Stars growth in the current period (past 28 days / current month)
      - `past_period_growth` string: Stars growth in the past period (The 28 days before the past 28 days / past month)
      - `growth_pop` string: The period-over-period growth of stars
      - `rank_pop` string: The period-over-period rank changes of stars
      - `total` string: The current total stars of repository
    - `result` object, required
      - `code` number: The code of the response.
      - `message` string: The message of the response.
      - `start_ms` number: The start time of the query in milliseconds.
      - `end_ms` number: The end time of the query in milliseconds.
      - `latency` string: The latency of the query.
      - `row_count` number: The number of rows in the query result.
      - `row_affect` number: The number of rows affected by the query.
      - `limit` number: The maximum number of rows in the query result.
      - `databases` string[]: The databases used in the query.

## Changes

- **2023-09-12** `7d4d76a76c97`: 1 breaking, 1 warning
  - added the new path request parameter `collection_id`
  - deleted the `path` request parameter `collectionId`
- **2023-09-11** `a8392d43bf5f`: 1 info
  - endpoint added
- **2023-07-27** `30f8bc584bb3`: 1 breaking
  - api path removed without deprecation

[Operation history](https://skmtc.dev/pingcap/apis/ossinsight-public-api/changes/collections/:collection_id/ranking_by_stars/get.md)

---

[API](https://skmtc.dev/pingcap/apis/ossinsight-public-api.md) - [All operations](https://skmtc.dev/pingcap/apis/ossinsight-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/pingcap/apis/ossinsight-public-api/revisions/9eeddbadc4bb?raw)
