Search repositories
GET
/search/repositories
search
text-match
media type. For more details about how to receive highlighted search results, see Text match metadata.q=tetris+language:assembly&sort=stars&order=desc
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.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
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request GET 'https://api.github.com/search/repositories?q='
响应示例响应示例
200 - 示例 1
{
"incomplete_results": true,
"items": [
{
"allow_merge_commit": true,
"allow_rebase_merge": true,
"allow_squash_merge": true,
"archive_url": "string",
"archived": true,
"assignees_url": "string",
"blobs_url": "string",
"branches_url": "string",
"clone_url": "string",
"collaborators_url": "string",
"comments_url": "string",
"commits_url": "string",
"compare_url": "string",
"contents_url": "string",
"contributors_url": "http://example.com",
"created_at": "2019-08-24T14:15:22Z",
"default_branch": "string",
"delete_branch_on_merge": true,
"deployments_url": "http://example.com",
"description": "string",
"disabled": true,
"downloads_url": "http://example.com",
"events_url": "http://example.com",
"fork": true,
"forks": 0,
"forks_count": 0,
"forks_url": "http://example.com",
"full_name": "string",
"git_commits_url": "string",
"git_refs_url": "string",
"git_tags_url": "string",
"git_url": "string",
"has_downloads": true,
"has_issues": true,
"has_pages": true,
"has_projects": true,
"has_wiki": true,
"homepage": "http://example.com",
"hooks_url": "http://example.com",
"html_url": "http://example.com",
"id": 0,
"issue_comment_url": "string",
"issue_events_url": "string",
"issues_url": "string",
"keys_url": "string",
"labels_url": "string",
"language": "string",
"languages_url": "http://example.com",
"license": {
"html_url": "http://example.com",
"key": "mit",
"name": "MIT License",
"node_id": "MDc6TGljZW5zZW1pdA==",
"spdx_id": "MIT",
"url": "https://api.github.com/licenses/mit"
},
"master_branch": "string",
"merges_url": "http://example.com",
"milestones_url": "string",
"mirror_url": "http://example.com",
"name": "string",
"node_id": "string",
"notifications_url": "string",
"open_issues": 0,
"open_issues_count": 0,
"owner": {
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"gravatar_id": "41d064eb2195891e12d0413f63227ea7",
"html_url": "https://github.com/octocat",
"id": 1,
"login": "octocat",
"node_id": "MDQ6VXNlcjE=",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"repos_url": "https://api.github.com/users/octocat/repos",
"site_admin": true,
"starred_at": "\"2020-07-09T00:17:55Z\"",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"type": "User",
"url": "https://api.github.com/users/octocat"
},
"permissions": {
"admin": true,
"pull": true,
"push": true
},
"private": true,
"pulls_url": "string",
"pushed_at": "2019-08-24T14:15:22Z",
"releases_url": "string",
"score": 0,
"size": 0,
"ssh_url": "string",
"stargazers_count": 0,
"stargazers_url": "http://example.com",
"statuses_url": "string",
"subscribers_url": "http://example.com",
"subscription_url": "http://example.com",
"svn_url": "http://example.com",
"tags_url": "http://example.com",
"teams_url": "http://example.com",
"temp_clone_token": "string",
"text_matches": [
{
"fragment": "string",
"matches": [
{
"indices": [
0
],
"text": "string"
}
],
"object_type": "string",
"object_url": "string",
"property": "string"
}
],
"topics": [
"string"
],
"trees_url": "string",
"updated_at": "2019-08-24T14:15:22Z",
"url": "http://example.com",
"watchers": 0,
"watchers_count": 0
}
],
"total_count": 0
}
请求参数
Query 参数
q
string
必需
sort
string
可选
stars
, forks
, or help-wanted-issues
or how recently the items were updated
. Default: best matchorder
string
可选
desc
) or lowest number of matches (asc
). This parameter is ignored unless you provide sort
.per_page
integer
可选
page
integer
可选