/github-stars-api

Primary LanguageTypeScriptMIT LicenseMIT

Github Stars API

This repo contains a Hono API that retrieves github star data for a given project for a given year.

Built with hono / cloudflare workers / KV and queues.

Data

  • 2024 JS star data is available here

Setup

Copy the .dev.vars.example to .dev.vars and update with your GITHUB_API_TOKEN

If you plan to deploy to cloudflare, you can also update the KV id and queue name in wrangler.toml

pnpm install
pnpm run dev

Routes

Visit http://localhost:8787/stars/owner-name/repo-name?year=4-digit-year to start retrieving star data.

For example: http://localhost:8787/stars/honojs/hono?year=2024

This will queue a background job and intermediate data will be available at the same endpoint (poll the endpoint to get the latest data / job status).

Once the job is finished the status property of the response will be "finished".