Giter VIP home page Giter VIP logo

github-trending-api's Introduction

Github Unofficial Trending API

Travis semantic-release coverage GitHub license

npm (scoped) npm size module formats: cjs, es

Code of Conduct

hero image

:octocat: A simple API that returns number of Github trending repositories and developers.


Table of Contents

REST API

See the full API documentation in Apiary.

Trending Repositories

Receive an array of trending repositories.

URL Endpoint:

https://github-trending-api.now.sh/repositories?language=javascript&since=weekly

Parameters:

  • language: optional, list trending repositories of certain programming languages, possible values are listed here.
  • since: optional, default to daily, possible values: daily, weekly and monthly.

Response:

[
  ...
  {
    "author": "google",
    "name": "gvisor",
    "url": "https://github.com/google/gvisor",
    "description": "Container Runtime Sandbox",
    "language": "Go",
    "languageColor": "#3572A5",
    "stars": 3320,
    "forks": 118,
    "currentPeriodStars": 1624,
    "builtBy": [
      {
        "href": "https://github.com/viatsko",
        "avatar": "https://avatars0.githubusercontent.com/u/376065",
        "username": "viatsko"
      }
    ]
  }
  ...
]

Trending Developers

Receive an array of trending developers.

URL Endpoint:

https://github-trending-api.now.sh/developers?language=javascript&since=weekly

Parameters:

  • language: optional, list trending repositories of certain programming languages, possible values are listed here.
  • since: optional, default to daily, possible values: daily, weekly and monthly.

Response:

[
  ...
  {
    "username": "google",
    "name": "Google",
    "url": "https://github.com/google",
    "avatar": "https://avatars0.githubusercontent.com/u/1342004",
    "repo": {
      "name": "traceur-compiler",
      "description":
        "Traceur is a JavaScript.next-to-JavaScript-of-today compiler",
      "url": "https://github.com/google/traceur-compiler"
    }
  }
  ...
]

List Languages

Receive popular languages and all languages.

URL Endpoint:

https://github-trending-api.now.sh/languages

Response:

{
  "popular": [
    ...
    {
      "urlParam": "html",
      "name": "HTML"
    }
    ...
  ],
  "all": [
    ...
    {
      "urlParam": "javascript",
      "name": "JavaScript"
    }
    ...
  ]
}

NPM Package

You could also use the API as a NPM package.

Install

$ npm install --save @huchenme/github-trending

Usage

import {
  fetchAllLanguages,
  fetchRepositories,
  fetchDevelopers,
} from '@huchenme/github-trending';

fetchAllLanguages().then(languages => {
  console.log(languages);
});

fetchRepositories({ language: 'ruby', since: 'monthly' }).then(repositories => {
  console.log(repositories);
});

fetchDevelopers({ language: 'javascript' }).then(developers => {
  console.log(developers);
});

API

fetchAllLanguages()

Return popular languages and all languages.

{
  popular: [
    ...
    {
      urlParam: 'html',
      name: 'HTML'
    }
    ...
  ],
  all: [
    ...
    {
      urlParam: 'javascript',
      name: 'JavaScript'
    }
    ...
  ]
}

fetchRepositories(params)

Receive an array of trending repositories.

params:

  • language: possible values are the the ones from fetchAllLanguages() or just find here.
  • since: daily, weekly or monthly, default to daily.
[
  ...
  {
    author: 'google',
    name: 'gvisor',
    url: 'https://github.com/google/gvisor',
    description: 'Container Runtime Sandbox',
    language: 'Go',
    languageColor: '#3572A5',
    stars: 3320,
    forks: 118,
    currentPeriodStars: 1624,
    "builtBy": [
      {
        "href": "https://github.com/viatsko",
        "avatar": "https://avatars0.githubusercontent.com/u/376065",
        "username": "viatsko"
      }
    ]
  }
  ...
]

fetchDevelopers(params)

Receive an array of trending developers.

params:

  • language: possible values are the the ones from fetchAllLanguages() or just find here.
  • since: daily, weekly or monthly, default to daily.
[
  ...
  {
    username: 'google',
    name: 'Google',
    url: 'https://github.com/google',
    avatar: 'https://avatars0.githubusercontent.com/u/1342004',
    repo: {
      name: 'traceur-compiler',
      description:
        'Traceur is a JavaScript.next-to-JavaScript-of-today compiler',
      url: 'https://github.com/google/traceur-compiler'
    }
  }
  ...
]

License

MIT

github-trending-api's People

Contributors

huchenme avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.