user2727704
user2727704

Reputation: 645

Github API to get the author/committer of specific line of code

I'm using Github code search API to get search for some text in a given repository. The response doesn't seem to contain any information related to the content that matched, sha/hash of the commit or the author/committer info:

https://api.github.com/search/code?q=addClass+repo:jquery/jquery

Is there any way to get the author/committer of the given line of code in a repo using the Github API?

Thanks!

Upvotes: 3

Views: 473

Answers (1)

Poonacha
Poonacha

Reputation: 1316

For searching commits we can use the new Commit Search API which is currently available for developers for preview . During the preview period we need to explicitly specify a custom media type in the 'Accept' header. For example your search using this API could be - curl -H 'Accept: application/vnd.github.cloak-preview' \https://api.github.com/search/commits?q=addClass+repo:jquery/jquery . ref: Search Commits

Upvotes: 1

Related Questions