Code Search API

Image of Jason Rudolph

Humans have enjoyed our :sparkles: new code search for a while, and today we’re ready to share that joy with the machines. :mag:

With the new code search API, we’ve taken the full power of GitHub’s search and made it available in the API. You can search by file extension and language, filter by number of forks or stars, and use all the other search qualifiers you’ve come to know and love.

Highlights

In addition to finding specific files that match your search, you often want to find the exact location of your search terms inside that file. On github.com, we present code snippets for each file, and we highlight the matching text.

code-snippet-highlighting

We want API consumers to have access to that information as well. The API provides the same snippets, along with metadata identifying the exact location of each matching search term.

Improved Search API for Repositories, Issues, and Users

Search isn’t just about code. We’re also launching a more powerful search API for repositories, issues, and users. With its more extensive set of query operators, and snippets showing the specific text that matched your search, you can quickly zero in on the items you’re looking for.

For full details, check out the announcement on the Developer Blog.

Happy searching finding!

Join us at GitHub Universe

Our largest product and community conference is returning to the Palace of Fine Arts in San Francisco, November 13-14. Hear what's next for the GitHub platform, find inspiration for your next project, and connect with developers who are changing the world.

Get tickets

GitHub Actions now supports CI/CD

GitHub Actions makes it easier to automate how you build, test, and deploy your projects on any platform, including Linux, macOS, and Windows. Try out the beta before GitHub Actions is generally available on November 13.

Sign up for the beta