An application to host as a webservice, serving to search for the most popular github repositories
Run webservice within a docker container
docker run --name gubify -p 8080:8080 anjeyy/gubify:latest
After successful launch you will see something like the following image.
The response is always a JSON payload representing results or an occurring error.
Get the X most popular GitHub repositories sorted by their stars.
/github/repositories/top{top}- replace
{top}with a numberxfor0 < x < 101
- replace
Get the most popular GitHub repositories sorted by their stars, results are paginated.
/github/repositories?limit={limit}&offset={offset}- default:
{limit}=100,{offset=1} - replace
{limit}with a numberxfor0 < x < 101 - replace
{offset}with a numberxfor0 < x < 1001
- default:
Note: Only the first 1000 matches are available from original GitHub API. Example Query
Get the most popular GitHub repositories, aggregated and sorted by their stars, 1000 at the most (see below).
/github/repositories?aggregate_results=true
Note: Only the first 1000 matches are available from original GitHub API. Example Query
Get the most popular GitHub repositories, with a creation date given and results are paginated and sorted by their stars.
/github/repositories?starting_date={creation}- default:
{limit}=100,{offset=1} - replace
{creation}with a date in the format like2022-01-01
- default:
Note: Only the first 1000 matches are available from original GitHub API. Example Query
Like above mentioned, GitHub provides the first 1000 results. Otherwise, the GitHub API returns following JSON response.
{ "message": "Only the first 1000 search results are available", "documentation_url": "https://docs.github.com/v3/search/" }Since GitHub has a rate limit for unauthenticated calls, with 10 calls per minute, this webservice provides also only 10 calls per minute to search for the most popular repositories.
Such a rate limit error will be displayed with a 429 Too Many Requests HTTP Error as a JSON response.
{ "http_status": "TOO_MANY_REQUESTS", "message": "403 rate limit exceeded: \"{\"message\":\"API rate limit exceeded for xxx.xxx.xxx.xxx. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)\",\"documentation_url\":\"https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting\"}<EOL>\"", "hint": "Please wait for another 60s to refresh your requests." }For further improvement an authentication can be provided to extend the rate limit. Please open an PR in case of improvement.
