1

How to search for some piece of code through the github api, knowing only the keyword contained in the piece of code ?

Using the search term 'preg_replace', type 'code' and language 'PHP'. In any repo.

Just like the following link, but with the dedicated API.

https://github.com/search?q=preg_replace&repo=&langOverride=&start_value=1&type=Code&language=PHP

(Checked this, but can't see how to search code. http://developer.github.com/v3/search/#search-issues https://github.com/search )

2 Answers 2

3

As of July 2013, code search is available via an API:

https://github.com/blog/1564-code-search-api

Sign up to request clarification or add additional context in comments.

Comments

0

Answer from the GitHub support team (from Wynn - Thanks for the answer)

Hi, Cedric. Sorry, code search isn't currently available in the API. We're constantly improving the API so keep an eye on the docs and @GitHubAPI on Twitter for updates as we add new features.

Cheers,

I guess I will have to parse some HTML instead (from https://github.com/search results).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.