By using this API, you can obtain user contribution data easily
-
Click the Deploy Button to deploy the repository on vercel.
-
For mainland China users, since you can't access the vercel domain correctly, you need to bind a custom domain to use this API.
-
After deploying to Vercel, assuming your domain name is
git.calendar.com, you can get the contributions by visiting the following addressgit.canlendar.com/api?username -
You can visit this example url which will return my (Robert-Stackflow) contribution history.
https://api.cloudchewie.com/tools/github-calendar?Robert-Stackflow
-
To prevent abuse, you cannot use the example API on your website, it is only used as an example.
-
You can also configure CORS by the
allow_origins.txt -
By default,
allow_origins.txtcontains the following contentlocalhost 127.0.0.1 -
You can add your own website via wildcard
*.example.com blog.example.com -
If the file
allow_origins.txtdoes not exist or the file content is empty, all CORS requests are allowed by default.