libgithub is a C client library for accessing the Github REST API and has been tested on Linux (Debian variants), MacOS, and FreeBSD with GCC and Clang, amd64 and arm64 architectures.
To initialize the library, the user's github token is required.
gh_client_init(token);Clean up after use.
gh_client_free();If an error occurs during the call, the error will be put into the response->err_msg field and response->resp will be set to NULL.
gh_client_response_t *res = gh_client_repo_release_by_tag("briandowns", "spinner", "v1.29.16");
if (res->err_msg != NULL) {
fprintf(stderr, "%s\n", res->err_msg);
gh_client_response_free(res);
}To build the shared object:
make installBuild the example:
make example- API response data is returned in a string containing JSON.
- The caller is responsible for how to handle the data.
- List calls support pagination.
- Each response from the API includes rate limit data.
- List repositories
- Retrieve a repository
- Create repository
- Update repository
- Delete repository
- List languages in repository
- List branches
- Get a branch
- Rename a branch
- Sync to an upstream
- Merge a branch
- List commits
- Get a commit
- Compare commits
- Get PR from commit
- List pull requests
- Get a pull request by id
- Create a pull request
- Update a pull request
- List pull request files
- Check if pull request has been merged
- Merge a pull request
- Update a pull request branch
- List releases
- Create a release
- Generate release notes
- Get latest
- Get by tag
- Get by id
- Update a release
- Delete a release
- List release assets
- Get a release asset
- Update a release asset
- Delete a release asset
- Upload a release asset
- List stargazers
- List issues assigned to logged in user
- List issues by repository
- Create an issue
- Get by id
- Update an issue
- Lock issue
- Unlock issue
- Get info for logged in user
- Get info for user by id
- Get hovercard info
- List blocked users
- Block a user
- Unblock a user
- List followers
- Get rate limit info for auth'd user
- List starred repositories
- List user repositories
- Community Profile Metrics
- Repository Clones data
- Top 10 referral paths
- Top referral sources
- Number of page views
- List events by organization
- List events by user
- Get action billing by org
- Get all codes of conduct
- Get a code of conduct by key
- libcurl
Please feel free to open a PR!
Brian Downs @bdowns328
BSD 2 Clause License.