Search repositories

GET {{baseUrl}}/search/repositories?q=<string>&sort=<string>&order=desc&per_page=30&page=1

Find repositories via various criteria. This method returns up to 100 results per page.

When searching for repositories, you can get text match metadata for the name and description fields when you pass the text-match media type. For more details about how to receive highlighted search results, see Text match metadata.

For example, if you want to search for popular Tetris repositories written in assembly code, your query might look like this:

q=tetris+language:assembly&sort=stars&order=desc

This query searches for repositories with the word tetris in the name, the description, or the README. The results are limited to repositories where the primary language is assembly. The results are sorted by stars in descending order, so that the most popular repositories appear first in the search results.

When you include the mercy preview header, you can also search for multiple topics by adding more topic: instances. For example, your query might look like this:

q=topic:ruby+topic:rails

Request Params

KeyDatatypeRequiredDescription
qstring(Required) The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see Constructing a search query. See "Searching for repositories" for a detailed list of qualifiers.
sortstringSorts the results of your query by number of stars, forks, or help-wanted-issues or how recently the items were updated. Default: best match
orderstringDetermines whether the first search result returned is the highest number of matches (desc) or lowest number of matches (asc). This parameter is ignored unless you provide sort.
per_pagenumberResults per page (max 100)
pagenumberPage number of the results to fetch.

RESPONSES

status: OK

{&quot;total_count&quot;:40,&quot;incomplete_results&quot;:false,&quot;items&quot;:[{&quot;id&quot;:3081286,&quot;node_id&quot;:&quot;MDEwOlJlcG9zaXRvcnkzMDgxMjg2&quot;,&quot;name&quot;:&quot;Tetris&quot;,&quot;full_name&quot;:&quot;dtrupenn/Tetris&quot;,&quot;owner&quot;:{&quot;login&quot;:&quot;dtrupenn&quot;,&quot;id&quot;:872147,&quot;node_id&quot;:&quot;MDQ6VXNlcjg3MjE0Nw==&quot;,&quot;avatar_url&quot;:&quot;https://secure.gravatar.com/avatar/e7956084e75f239de85d3a31bc172ace?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png&quot;,&quot;gravatar_id&quot;:&quot;&quot;,&quot;url&quot;:&quot;https://api.github.com/users/dtrupenn&quot;,&quot;received_events_url&quot;:&quot;https://api.github.com/users/dtrupenn/received_events&quot;,&quot;type&quot;:&quot;User&quot;,&quot;html_url&quot;:&quot;https://github.com/octocat&quot;,&quot;followers_url&quot;:&quot;https://api.github.com/users/octocat/followers&quot;,&quot;following_url&quot;:&quot;https://api.github.com/users/octocat/following{/other_user}&quot;,&quot;gists_url&quot;:&quot;https://api.github.com/users/octocat/gists{/gist_id}&quot;,&quot;starred_url&quot;:&quot;https://api.github.com/users/octocat/starred{/owner}{/repo}&quot;,&quot;subscriptions_url&quot;:&quot;https://api.github.com/users/octocat/subscriptions&quot;,&quot;organizations_url&quot;:&quot;https://api.github.com/users/octocat/orgs&quot;,&quot;repos_url&quot;:&quot;https://api.github.com/users/octocat/repos&quot;,&quot;events_url&quot;:&quot;https://api.github.com/users/octocat/events{/privacy}&quot;,&quot;site_admin&quot;:true},&quot;private&quot;:false,&quot;html_url&quot;:&quot;https://github.com/dtrupenn/Tetris&quot;,&quot;description&quot;:&quot;A C implementation of Tetris using Pennsim through LC4&quot;,&quot;fork&quot;:false,&quot;url&quot;:&quot;https://api.github.com/repos/dtrupenn/Tetris&quot;,&quot;created_at&quot;:&quot;2012-01-01T00:31:50Z&quot;,&quot;updated_at&quot;:&quot;2013-01-05T17:58:47Z&quot;,&quot;pushed_at&quot;:&quot;2012-01-01T00:37:02Z&quot;,&quot;homepage&quot;:&quot;https://github.com&quot;,&quot;size&quot;:524,&quot;stargazers_count&quot;:1,&quot;watchers_count&quot;:1,&quot;language&quot;:&quot;Assembly&quot;,&quot;forks_count&quot;:0,&quot;open_issues_count&quot;:0,&quot;master_branch&quot;:&quot;master&quot;,&quot;default_branch&quot;:&quot;master&quot;,&quot;score&quot;:1,&quot;archive_url&quot;:&quot;https://api.github.com/repos/dtrupenn/Tetris/{archive_format}{/ref}&quot;,&quot;assignees_url&quot;:&quot;https://api.github.com/repos/dtrupenn/Tetris/assignees{/user}&quot;,&quot;blobs_url&quot;:&quot;https://api.github.com/repos/dtrupenn/Tetris/git/blobs{/sha}&quot;,&quot;branches_url&quot;:&quot;https://api.github.com/repos/dtrupenn/Tetris/branches{/branch}&quot;,&quot;collaborators_url&quot;:&quot;https://api.github.com/repos/dtrupenn/Tetris/collaborators{/collaborator}&quot;,&quot;comments_url&quot;:&quot;https://api.github.com/repos/dtrupenn/Tetris/comments{/number}&quot;,&quot;commits_url&quot;:&quot;https://api.github.com/repos/dtrupenn/Tetris/commits{/sha}&quot;,&quot;compare_url&quot;:&quot;https://api.github.com/repos/dtrupenn/Tetris/compare/{base}...{head}&quot;,&quot;contents_url&quot;:&quot;https://api.github.com/repos/dtrupenn/Tetris/contents/{+path}&quot;,&quot;contributors_url&quot;:&quot;https://api.github.com/repos/dtrupenn/Tetris/contributors&quot;,&quot;deployments_url&quot;:&quot;https://api.github.com/repos/dtrupenn/Tetris/deployments&quot;,&quot;downloads_url&quot;:&quot;https://api.github.com/repos/dtrupenn/Tetris/downloads&quot;,&quot;events_url&quot;:&quot;https://api.github.com/repos/dtrupenn/Tetris/events&quot;,&quot;forks_url&quot;:&quot;https://api.github.com/repos/dtrupenn/Tetris/forks&quot;,&quot;git_commits_url&quot;:&quot;https://api.github.com/repos/dtrupenn/Tetris/git/commits{/sha}&quot;,&quot;git_refs_url&quot;:&quot;https://api.github.com/repos/dtrupenn/Tetris/git/refs{/sha}&quot;,&quot;git_tags_url&quot;:&quot;https://api.github.com/repos/dtrupenn/Tetris/git/tags{/sha}&quot;,&quot;git_url&quot;:&quot;git:github.com/dtrupenn/Tetris.git&quot;,&quot;issue_comment_url&quot;:&quot;https://api.github.com/repos/dtrupenn/Tetris/issues/comments{/number}&quot;,&quot;issue_events_url&quot;:&quot;https://api.github.com/repos/dtrupenn/Tetris/issues/events{/number}&quot;,&quot;issues_url&quot;:&quot;https://api.github.com/repos/dtrupenn/Tetris/issues{/number}&quot;,&quot;keys_url&quot;:&quot;https://api.github.com/repos/dtrupenn/Tetris/keys{/key_id}&quot;,&quot;labels_url&quot;:&quot;https://api.github.com/repos/dtrupenn/Tetris/labels{/name}&quot;,&quot;languages_url&quot;:&quot;https://api.github.com/repos/dtrupenn/Tetris/languages&quot;,&quot;merges_url&quot;:&quot;https://api.github.com/repos/dtrupenn/Tetris/merges&quot;,&quot;milestones_url&quot;:&quot;https://api.github.com/repos/dtrupenn/Tetris/milestones{/number}&quot;,&quot;notifications_url&quot;:&quot;https://api.github.com/repos/dtrupenn/Tetris/notifications{?since,all,participating}&quot;,&quot;pulls_url&quot;:&quot;https://api.github.com/repos/dtrupenn/Tetris/pulls{/number}&quot;,&quot;releases_url&quot;:&quot;https://api.github.com/repos/dtrupenn/Tetris/releases{/id}&quot;,&quot;ssh_url&quot;:&quot;git@github.com:dtrupenn/Tetris.git&quot;,&quot;stargazers_url&quot;:&quot;https://api.github.com/repos/dtrupenn/Tetris/stargazers&quot;,&quot;statuses_url&quot;:&quot;https://api.github.com/repos/dtrupenn/Tetris/statuses/{sha}&quot;,&quot;subscribers_url&quot;:&quot;https://api.github.com/repos/dtrupenn/Tetris/subscribers&quot;,&quot;subscription_url&quot;:&quot;https://api.github.com/repos/dtrupenn/Tetris/subscription&quot;,&quot;tags_url&quot;:&quot;https://api.github.com/repos/dtrupenn/Tetris/tags&quot;,&quot;teams_url&quot;:&quot;https://api.github.com/repos/dtrupenn/Tetris/teams&quot;,&quot;trees_url&quot;:&quot;https://api.github.com/repos/dtrupenn/Tetris/git/trees{/sha}&quot;,&quot;clone_url&quot;:&quot;https://github.com/dtrupenn/Tetris.git&quot;,&quot;mirror_url&quot;:&quot;git:git.example.com/dtrupenn/Tetris&quot;,&quot;hooks_url&quot;:&quot;https://api.github.com/repos/dtrupenn/Tetris/hooks&quot;,&quot;svn_url&quot;:&quot;https://svn.github.com/dtrupenn/Tetris&quot;,&quot;forks&quot;:1,&quot;open_issues&quot;:1,&quot;watchers&quot;:1,&quot;has_issues&quot;:true,&quot;has_projects&quot;:true,&quot;has_pages&quot;:true,&quot;has_wiki&quot;:true,&quot;has_downloads&quot;:true,&quot;archived&quot;:true,&quot;disabled&quot;:true,&quot;license&quot;:{&quot;key&quot;:&quot;mit&quot;,&quot;name&quot;:&quot;MIT License&quot;,&quot;url&quot;:&quot;https://api.github.com/licenses/mit&quot;,&quot;spdx_id&quot;:&quot;MIT&quot;,&quot;node_id&quot;:&quot;MDc6TGljZW5zZW1pdA==&quot;,&quot;html_url&quot;:&quot;https://api.github.com/licenses/mit&quot;}}]}