openapi: 3.2.0
info:
title: OSSInsight Public Trends API
description: "\nOSSInsight Public APIs (beta) provide a convenient way to access insight data for open source projects on GitHub, supplementing the existing GitHub API.\n\nIt provides data query in different dimensions, including:\n\n```mdx-code-block\nimport DocCardList from '@theme/DocCardList';\nimport {useCurrentSidebarCategory} from '@docusaurus/theme-common';\n\n<DocCardList items={useCurrentSidebarCategory().items.filter((item) => {\n // Exclude Introduction and Showcase pages\n return item.docId !== 'api/showcase' && item.docId !== 'api/ossinsight-public-api';\n})}/>\n```\n\n## Usage\n\nThe OSSInsight Public API is designed to follow the OpenAPI specification and can be accessed by initiating HTTP requests using the command line `curl` or web request libraries in different programming languages.\n\n### Base URL\n\nAll API requests are based on the following URL:\n\n```shell\nhttps://api.ossinsight.io/v1\n```\n\n### Authentication\n\nNo authentication is required for beta version of public APIs, but there are [rate limits](#rate-limit) for API requests.\n\n> Note:\n> We will add authentication way for larger API requests in future releases.\n\n### Rate Limit\n\nFor each IP address, the rate limit allows for up to **600 requests per hour**, which can be checked by the following fields in the Response Header to see the current usage:\n\n```\nx-ratelimit-limit: 600\nx-ratelimit-remaining: 599\n```\n\nIn addition, we have also set up a global rate limit of up to **1000 requests per minute**, which can be checked by the following fields in the Response Header to see the current usage:\n\n```\nx-ratelimit-limit-minute: 1000\nx-ratelimit-remaining-minute: 97\n```\n\n### Example\n\nFor example, if you want to know what countries the stargazers in the `pingcap/tidb` repository are located in, you can make a request using the curl command as follows:\n\n```shell\ncurl https://api.ossinsight.io/v1/repos/pingcap/tidb/stargazers/countries\n```\n\n<details>\n\n<summary>Example Response</summary>\n\n```json\n{\n \"type\": \"sql_endpoint\",\n \"data\": {\n \"columns\": [\n {\n \"col\": \"country_or_area\",\n \"data_type\": \"CHAR\",\n \"nullable\": true\n },\n {\n \"col\": \"count\",\n \"data_type\": \"BIGINT\",\n \"nullable\": true\n },\n {\n \"col\": \"percentage\",\n \"data_type\": \"DECIMAL\",\n \"nullable\": true\n }\n ],\n \"rows\": [\n {\n \"count\": \"9183\",\n \"country_or_area\": \"CN\",\n \"percentage\": \"0.5936\"\n },\n {\n \"count\": \"1542\",\n \"country_or_area\": \"US\",\n \"percentage\": \"0.0997\"\n },\n {\n \"count\": \"471\",\n \"country_or_area\": \"JP\",\n \"percentage\": \"0.0304\"\n }\n ],\n \"result\": {\n \"code\": 200,\n \"message\": \"Query OK!\",\n \"start_ms\": 1690351487809,\n \"end_ms\": 1690351487930,\n \"latency\": \"121ms\",\n \"row_count\": 132,\n \"row_affect\": 0,\n \"limit\": 300,\n \"databases\": [\n \"gharchive_dev\"\n ]\n }\n }\n}\n```\n\n</details>\n\n## Request New API \n\nIf the API in the documentation does not meet your query requirements, please contact us as follows:\n\n- Email us at ossinsight@pingcap.com\n- Open an issue in the [OSSInsight GitHub repository](https://github.com/pingcap/ossinsight/issues/new?assignees=&labels=type%2Ffeature&projects=&template=feature_request.md&title=New%20API)\n"
version: v1beta
servers:
- url: https://api.ossinsight.io/v1
tags:
- name: Trends
paths:
/trends/repos/:
get:
operationId: list-trending-repos
summary: List trending repos
tags:
- Trends
description: "Trending repos is an open source alternative to GitHub trends, which showcases recently popular open source projects in the GitHub community.\n\n> **Note**\n>\n> Please URI encode the requested parameters, e.g. `C++` needs to be encoded as `C%2B%2B`.\n \n☁️ Daily run on [TiDB Cloud](https://tidbcloud.com/?utm_source=ossinsight&utm_medium=ossinsight_api), analyze upon dataset that has over 6 billion GitHub events."
parameters:
- schema:
type: string
enum:
- past_24_hours
- past_week
- past_month
- past_3_months
default: past_24_hours
in: query
name: period
required: false
description: Specify the period of time to calculate trending repos.
- schema:
type: string
enum:
- All
- JavaScript
- Java
- Python
- PHP
- C++
- C#
- TypeScript
- Shell
- C
- Ruby
- Rust
- Go
- Kotlin
- HCL
- PowerShell
- CMake
- Groovy
- PLpgSQL
- TSQL
- Dart
- Swift
- HTML
- CSS
- Elixir
- Haskell
- Solidity
- Assembly
- R
- Scala
- Julia
- Lua
- Clojure
- Erlang
- Common Lisp
- Emacs Lisp
- OCaml
- MATLAB
- Objective-C
- Perl
- Fortran
default: All
in: query
name: language
required: false
description: Specify using which programming language to filter trending repos. If not specified, all languages will be included.
responses:
'200':
description: Default Response
content:
application/json:
schema:
type: object
required:
- type
- data
properties:
type:
type: string
description: The type of the endpoint.
enum:
- sql_endpoint
example: sql_endpoint
data:
type: object
required:
- columns
- rows
- result
properties:
columns:
type: array
items:
type: object
required:
- col
- data_type
- nullable
properties:
col:
type: string
description: The name of the column in the query result.
data_type:
type: string
enum:
- 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
description: The data type of the column.
nullable:
type: boolean
description: Whether the column is nullable.
additionalProperties: true
example:
- col: repo_id
data_type: INT
- col: repo_name
data_type: VARCHAR
- col: primary_language
data_type: VARCHAR
- col: description
data_type: VARCHAR
- col: stars
data_type: INT
- col: forks
data_type: INT
- col: pull_requests
data_type: INT
- col: pushes
data_type: INT
- col: total_score
data_type: DOUBLE
- col: contributor_logins
data_type: VARCHAR
- col: collection_names
data_type: VARCHAR
rows:
type: array
items:
type: object
properties:
repo_id:
type: string
description: ID of the repo
repo_name:
type: string
description: Name of the repo
primary_language:
type: string
description: Primary programing language used by the repo
description:
type: string
description: Description of the repo
stars:
type: string
description: Number of stars in the period
forks:
type: string
description: Number of forks in the period
pull_requests:
type: string
description: Number of pull requests in the period
pushes:
type: string
description: Number of pushes in the period
total_score:
type: string
description: Total score of the repo
contributor_logins:
type: string
description: Comma separated list of active contributor logins
collection_names:
type: string
description: Comma separated list of collection names
example:
- collection_names: CICD
contributor_logins: cplee,nektos-ci,usagirei,ae-ou,MrNossiom
description: Run your GitHub Actions locally 🚀
forks: '5'
primary_language: Go
pull_requests: '6'
pushes: '17'
repo_id: '163883279'
repo_name: nektos/act
stars: '395'
total_score: '1565.7526'
- collection_names: ChatGPT Alternatives
contributor_logins: antonkesy,ruanslv,starplatinum3,AlexandroLuis,realhaik
description: Inference code for LLaMA models
forks: '48'
primary_language: Python
pull_requests: '41'
pushes: '7'
repo_id: '601538369'
repo_name: facebookresearch/llama
stars: '209'
total_score: '1079.0274'
- collection_names: Stable Diffusion Ecosystem
contributor_logins: atiorh,SaladDays831,ZachNagengast,TimYao18,vzsg
description: Stable Diffusion with Core ML on Apple Silicon
forks: '5'
primary_language: Python
pull_requests: '7'
pushes: '5'
repo_id: '566576114'
repo_name: apple/ml-stable-diffusion
stars: '99'
total_score: '575.2498'
- collection_names: Stable Diffusion Ecosystem
contributor_logins: danonymous856,EvilPhi666,FurkanGozukara,Prathyusha-98,ca-kishida
description: High-Resolution Image Synthesis with Latent Diffusion Models
forks: '6'
primary_language: Python
pull_requests: '2'
pushes: ''
repo_id: '569927055'
repo_name: Stability-AI/stablediffusion
stars: '75'
total_score: '483.0236'
result:
type: object
properties:
code:
type: number
description: The code of the response.
message:
type: string
description: The message of the response.
start_ms:
type: number
description: The start time of the query in milliseconds.
end_ms:
type: number
description: The end time of the query in milliseconds.
latency:
type: string
description: The latency of the query.
row_count:
type: number
description: The number of rows in the query result.
row_affect:
type: number
description: The number of rows affected by the query.
limit:
type: number
description: The maximum number of rows in the query result.
databases:
type: array
description: The databases used in the query.
items:
type: string
additionalProperties: true
example:
code: 200
message: Query OK!
start_ms: 1690957407469
end_ms: 1690957407499
latency: 30ms
row_count: 4
row_affect: 0
limit: 50
databases:
- gharchive_dev