Home | Edit | New

Guides: The GitHub API feed

Brand New API at develop.github.com



We’re adding an API bit by bit. This page will serve as the documentation.

The basic url template:

http://github.com/api/version/format/username/repository/type/object

  • Current version: v1
  • Acceptable formats: json, xml, yaml
  • Acceptable types: commits, commit

Grabbing all recent commits:

$ curl -i http://github.com/api/v1/xml/caged/gitnub/commits/master | less

Grabbing a single commit:

$ curl -i http://github.com/api/v1/json/defunkt/github-gem/commit/c26d4ce9807ecf57d3f9eefe19ae64e75bcaaa8b | less

Repository search:

$ curl -i http://github.com/api/v1/xml/search/merb | less

You can also grab a user’s info, including a list of his repositories:

$ curl -i http://github.com/api/v1/json/defunkt | less

(Using token authentication, described below, will enable listing of private repositories.)

With JSON requests, you can have the result passed to a callback method of your choice:

$ curl -i http://github.com/api/v1/json/defunkt?callback=myCallbackMethod | less

Projects using API

Additional resources

Last edited by davetron5000, 2 months ago
Versions: