SpyREST

Supported by Mashape

Home » api.github.com Versions » v3 Resources » search » GET /search/code

GET /search/code

Description

Query Parameters

Name Type Example Values Description
q String addClass in:file language:js repo:jquery/jquery

Response Fields

Name Type Description
total_count Integer
incomplete_results Boolean
items Array
items[].name String
items[].path String
items[].sha String
items[].url String
items[].git_url String
items[].html_url String
items[].repository.id Integer
items[].repository.name String
items[].repository.full_name String
items[].repository.owner.login String
items[].repository.owner.id Integer
items[].repository.owner.avatar_url String
items[].repository.owner.gravatar_id String
items[].repository.owner.url String
items[].repository.owner.html_url String
items[].repository.owner.followers_url String
items[].repository.owner.following_url String
items[].repository.owner.gists_url String
items[].repository.owner.starred_url String
items[].repository.owner.subscriptions_url String
items[].repository.owner.organizations_url String
items[].repository.owner.repos_url String
items[].repository.owner.events_url String
items[].repository.owner.received_events_url String
items[].repository.owner.type String
items[].repository.owner.site_admin Boolean
items[].repository.private Boolean
items[].repository.html_url String
items[].repository.description String
items[].repository.fork Boolean
items[].repository.url String
items[].repository.forks_url String
items[].repository.keys_url String
items[].repository.collaborators_url String
items[].repository.teams_url String
items[].repository.hooks_url String
items[].repository.issue_events_url String
items[].repository.events_url String
items[].repository.assignees_url String
items[].repository.branches_url String
items[].repository.tags_url String
items[].repository.blobs_url String
items[].repository.git_tags_url String
items[].repository.git_refs_url String
items[].repository.trees_url String
items[].repository.statuses_url String
items[].repository.languages_url String
items[].repository.stargazers_url String
items[].repository.contributors_url String
items[].repository.subscribers_url String
items[].repository.subscription_url String
items[].repository.commits_url String
items[].repository.git_commits_url String
items[].repository.comments_url String
items[].repository.issue_comment_url String
items[].repository.contents_url String
items[].repository.compare_url String
items[].repository.merges_url String
items[].repository.archive_url String
items[].repository.downloads_url String
items[].repository.issues_url String
items[].repository.pulls_url String
items[].repository.milestones_url String
items[].repository.notifications_url String
items[].repository.labels_url String
items[].repository.releases_url String
items[].score Float
Write
Preview

Examples

Suppose you want to find th...

Suppose you want to find the definition of the addClass function inside jQuery. Your query would look something like this:

Recorded at

2015-05-14 18:20:58 UTC

Try with cURL

Request URL

GET /search/code?q=addClass+in:file+language:js+repo:jquery/jquery      

Query Parameters

q: addClass in:file language:js repo:jquery/jquery
      

Request Headers

content-type: application/json
accept: application/vnd.github.v3+json
user-agent: curl/7.37.1
      

Response Headers

transfer-encoding: chunked
x-served-by: 76d9828c7e4f1d910f7ba069e90ce976
vary: Accept-Encoding
x-content-type-options: nosniff
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-github-request-id: 68EC8CA8:07E8:35E4DA0:5554E78A
access-control-allow-origin: *
access-control-expose-headers: ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
access-control-allow-credentials: true
content-security-policy: default-src 'none'
x-frame-options: deny
x-xss-protection: 1; mode=block
x-github-media-type: github.v3; format=json
cache-control: no-cache
x-ratelimit-reset: 1431627718
x-ratelimit-remaining: 9
x-ratelimit-limit: 10
status: 200 OK
connection: close
content-length: 34737
content-type: application/json; charset=utf-8
date: Thu, 14 May 2015 18:20:58 GMT
server: GitHub.com
      

Response Body

Shortened for readability

{
  "total_count": 7,
  "incomplete_results": false,
  "items": [
    {
      "name": "classes.js",
      "path": "src/attributes/classes.js",
      "sha": "d0d1d989f19fc4bf1c09667420288d3fcad84fab",
      "url": "https://api.github.com/repositories/167174/contents/src/attributes/classes.js?ref=20aaed367f993f3c2aa204183d82d0d73efa114f",
      "git_url": "https://api.github.com/repositories/167174/git/blobs/d0d1d989f19fc4bf1c09667420288d3fcad84fab",
      "html_url": "https://github.com/jquery/jquery/blob/20aaed367f993f3c2aa204183d82d0d73efa114f/src/attributes/classes.js",
      "repository": {
        "id": 167174,
        "name": "jquery",
        "full_name": "jquery/jquery",
        "owner": {
          "login": "jquery",
          "id": 70142,
          "avatar_url": "https://avatars.githubusercontent.com/u/70142?v=3",
          "gravatar_id": "",
          "url": "https://api.github.com/users/jquery",
          "html_url": "https://github.com/jquery",
          "followers_url": "https://api.github.com/users/jquery/followers",
          "following_url": "https://api.github.com/users/jquery/following{/other_user}",
          "gists_url": "https://api.github.com/users/jquery/gists{/gist_id}",
          "starred_url": "https://api.github.com/users/jquery/starred{/owner}{/repo}",
          "subscriptions_url": "https://api.github.com/users/jquery/subscriptions",
          "organizations_url": "https://api.github.com/users/jquery/orgs",
          "repos_url": "https://api.github.com/users/jquery/repos",
          "events_url": "https://api.github.com/users/jquery/events{/privacy}",
          "received_events_url": "https://api.github.com/users/jquery/received_events",
          "type": "Organization",
          "site_admin": false
        },
        "private": false,
        "html_url": "https://github.com/jquery/jquery",
        "description": "jQuery JavaScript Library",
        "fork": false,
        "url": "https://api.github.com/repos/jquery/jquery",
        "forks_url": "https://api.github.com/repos/jquery/jquery/forks",
        "keys_url": "https://api.github.com/repos/jquery/jquery/keys{/key_id}",
        "collaborators_url": "https://api.github.com/repos/jquery/jquery/collaborators{/collaborator}",
        "teams_url": "https://api.github.com/repos/jquery/jquery/teams",
        "hooks_url": "https://api.github.com/repos/jquery/jquery/hooks",
        "issue_events_url": "https://api.github.com/repos/jquery/jquery/issues/events{/number}",
        "events_url": "https://api.github.com/repos/jquery/jquery/events",
        "assignees_url": "https://api.github.com/repos/jquery/jquery/assignees{/user}",
        "branches_url": "https://api.github.com/repos/jquery/jquery/branches{/branch}",
        "tags_url": "https://api.github.com/repos/jquery/jquery/tags",
        "blobs_url": "https://api.github.com/repos/jquery/jquery/git/blobs{/sha}",
        "git_tags_url": "https://api.github.com/repos/jquery/jquery/git/tags{/sha}",
        "git_refs_url": "https://api.github.com/repos/jquery/jquery/git/refs{/sha}",
        "trees_url": "https://api.github.com/repos/jquery/jquery/git/trees{/sha}",
        "statuses_url": "https://api.github.com/repos/jquery/jquery/statuses/{sha}",
        "languages_url": "https://api.github.com/repos/jquery/jquery/languages",
        "stargazers_url": "https://api.github.com/repos/jquery/jquery/stargazers",
        "contributors_url": "https://api.github.com/repos/jquery/jquery/contributors",
        "subscribers_url": "https://api.github.com/repos/jquery/jquery/subscribers",
        "subscription_url": "https://api.github.com/repos/jquery/jquery/subscription",
        "commits_url": "https://api.github.com/repos/jquery/jquery/commits{/sha}",
        "git_commits_url": "https://api.github.com/repos/jquery/jquery/git/commits{/sha}",
        "comments_url": "https://api.github.com/repos/jquery/jquery/comments{/number}",
        "issue_comment_url": "https://api.github.com/repos/jquery/jquery/issues/comments{/number}",
        "contents_url": "https://api.github.com/repos/jquery/jquery/contents/{+path}",
        "compare_url": "https://api.github.com/repos/jquery/jquery/compare/{base}...{head}",
        "merges_url": "https://api.github.com/repos/jquery/jquery/merges",
        "archive_url": "https://api.github.com/repos/jquery/jquery/{archive_format}{/ref}",
        "downloads_url": "https://api.github.com/repos/jquery/jquery/downloads",
        "issues_url": "https://api.github.com/repos/jquery/jquery/issues{/number}",
        "pulls_url": "https://api.github.com/repos/jquery/jquery/pulls{/number}",
        "milestones_url": "https://api.github.com/repos/jquery/jquery/milestones{/number}",
        "notifications_url": "https://api.github.com/repos/jquery/jquery/notifications{?since,all,participating}",
        "labels_url": "https://api.github.com/repos/jquery/jquery/labels{/name}",
        "releases_url": "https://api.github.com/repos/jquery/jquery/releases{/id}"
      },
      "score": 0.5139766
    },
    {
      "name": "attributes.js",
      "path": "test/unit/attributes.js",
      "sha": "526cfc99dbeb939de883622b152429094cd35188",
      "url": "https://api.github.com/repositories/167174/contents/test/unit/attributes.js?ref=20aaed367f993f3c2aa204183d82d0d73efa114f",
      "git_url": "https://api.github.com/repositories/167174/git/blobs/526cfc99dbeb939de883622b152429094cd35188",
      "html_url": "https://github.com/jquery/jquery/blob/20aaed367f993f3c2aa204183d82d0d73efa114f/test/unit/attributes.js",
      "repository": {
        "id": 167174,
        "name": "jquery",
        "full_name": "jquery/jquery",
        "owner": {
          "login": "jquery",
          "id": 70142,
          "avatar_url": "https://avatars.githubusercontent.com/u/70142?v=3",
          "gravatar_id": "",
          "url": "https://api.github.com/users/jquery",
          "html_url": "https://github.com/jquery",
          "followers_url": "https://api.github.com/users/jquery/followers",
          "following_url": "https://api.github.com/users/jquery/following{/other_user}",
          "gists_url": "https://api.github.com/users/jquery/gists{/gist_id}",
          "starred_url": "https://api.github.com/users/jquery/starred{/owner}{/repo}",
          "subscriptions_url": "https://api.github.com/users/jquery/subscriptions",
          "organizations_url": "https://api.github.com/users/jquery/orgs",
          "repos_url": "https://api.github.com/users/jquery/repos",
          "events_url": "https://api.github.com/users/jquery/events{/privacy}",
          "received_events_url": "https://api.github.com/users/jquery/received_events",
          "type": "Organization",
          "site_admin": false
        },
        "private": false,
        "html_url": "https://github.com/jquery/jquery",
        "description": "jQuery JavaScript Library",
        "fork": false,
        "url": "https://api.github.com/repos/jquery/jquery",
        "forks_url": "https://api.github.com/repos/jquery/jquery/forks",
        "keys_url": "https://api.github.com/repos/jquery/jquery/keys{/key_id}",
        "collaborators_url": "https://api.github.com/repos/jquery/jquery/collaborators{/collaborator}",
        "teams_url": "https://api.github.com/repos/jquery/jquery/teams",
        "hooks_url": "https://api.github.com/repos/jquery/jquery/hooks",
        "issue_events_url": "https://api.github.com/repos/jquery/jquery/issues/events{/number}",
        "events_url": "https://api.github.com/repos/jquery/jquery/events",
        "assignees_url": "https://api.github.com/repos/jquery/jquery/assignees{/user}",
        "branches_url": "https://api.github.com/repos/jquery/jquery/branches{/branch}",
        "tags_url": "https://api.github.com/repos/jquery/jquery/tags",
        "blobs_url": "https://api.github.com/repos/jquery/jquery/git/blobs{/sha}",
        "git_tags_url": "https://api.github.com/repos/jquery/jquery/git/tags{/sha}",
        "git_refs_url": "https://api.github.com/repos/jquery/jquery/git/refs{/sha}",
        "trees_url": "https://api.github.com/repos/jquery/jquery/git/trees{/sha}",
        "statuses_url": "https://api.github.com/repos/jquery/jquery/statuses/{sha}",
        "languages_url": "https://api.github.com/repos/jquery/jquery/languages",
        "stargazers_url": "https://api.github.com/repos/jquery/jquery/stargazers",
        "contributors_url": "https://api.github.com/repos/jquery/jquery/contributors",
        "subscribers_url": "https://api.github.com/repos/jquery/jquery/subscribers",
        "subscription_url": "https://api.github.com/repos/jquery/jquery/subscription",
        "commits_url": "https://api.github.com/repos/jquery/jquery/commits{/sha}",
        "git_commits_url": "https://api.github.com/repos/jquery/jquery/git/commits{/sha}",
        "comments_url": "https://api.github.com/repos/jquery/jquery/comments{/number}",
        "issue_comment_url": "https://api.github.com/repos/jquery/jquery/issues/comments{/number}",
        "contents_url": "https://api.github.com/repos/jquery/jquery/contents/{+path}",
        "compare_url": "https://api.github.com/repos/jquery/jquery/compare/{base}...{head}",
        "merges_url": "https://api.github.com/repos/jquery/jquery/merges",
        "archive_url": "https://api.github.com/repos/jquery/jquery/{archive_format}{/ref}",
        "downloads_url": "https://api.github.com/repos/jquery/jquery/downloads",
        "issues_url": "https://api.github.com/repos/jquery/jquery/issues{/number}",
        "pulls_url": "https://api.github.com/repos/jquery/jquery/pulls{/number}",
        "milestones_url": "https://api.github.com/repos/jquery/jquery/milestones{/number}",
        "notifications_url": "https://api.github.com/repos/jquery/jquery/notifications{?since,all,participating}",
        "labels_url": "https://api.github.com/repos/jquery/jquery/labels{/name}",
        "releases_url": "https://api.github.com/repos/jquery/jquery/releases{/id}"
      },
      "score": 0.3350717
    }
  ]
}