Endpoint | Version |
---|---|
https://api.razonyang.com | v1 |
The instance is launched on my small k8s (k3s) cluster, you can also host it yourself.
Since 02/02/2023, the APIs service was hosted on Digital Ocean instead of China cloud servers, for getting lower latency between APIs and related services, such as GitHub APIs.
Show how many projects are using your repository.
{endpoint}/{version}/github/dependents/{owner}/{repo}
{
"packages": 520,
"packages_humanize": "520",
"repositories": 468751,
"repositories_humanize": "468.8k"
}
Integrate with Shields.io
https://img.shields.io/badge/dynamic/json?color=success&label=used+by&query=repositories_humanize&logo=github&url={endpoint}/{version}/github/dependents/{owner}/{repo}
Get the latest tag of repository.
{endpoint}/{version}/github/tag/{owner}/{repo}?prefix={prefix}
prefix
: optional.
{
"name": "v0.1.0"
}
Returns Hugo module/theme info, i.e. .
{endpoint}/{version}/hugo/modules/github.com/{owner}/{repo}
.
{
"hugoVersion":{
"extended":true,
"min":"0.99.0",
"max":"0.111.1"
},
"requirements":"\u003e=0.99.0 \u003c=0.111.1 extended"
}
- Redis: for caching.
Env | Required | Default | Description |
---|---|---|---|
PORT |
N | 8080 |
The HTTP server port. |
REDIS_ADDR |
N | 127.0.0.1:6379 |
Redis address in form host:port . |
REDIS_PASSWORD |
N | - | Redis password. |
GITHUB_TOKEN |
N | - | GitHub API access token. |
API_NAME |
N | `` | The API name. |
API_ENDPOINT |
Y | https://api.razonyang.com |
The API endpoint. |
The .env
file will be loaded if presents.
$ git clone https://github.com/razonyang/api
$ cd api
$ go build
$ ./api
Or via go install
.
$ go install github.com/razonyang/api@latest
$ api
$ docker run -p 8080:8080 razonyang/api