GitHub Search

Searches public code and repositories and returns matching file or repo metadata.

1 endpoint191 calls1/1 passing
Get API key

Returns matching code or repositories with file paths, snippets, and URLs for a query.

GET/v1/…github-code/search
passing · 0.5s5m cache

Try it

Checking your keys…

Parameters

query

string · query · required

Search keyword.

count

number · query · optional

Results per page 1-20 (default 10).

page

number · query · optional

Result page (default 1, max 50).

sort

enum · query · optional

Sort by: stars/forks/updated (default stars).

Example response

{"project":"search-tools:github-code",  "data": {"page":1,"count":5,    "items": [      {"url":"https://github.com/chimurai/http-proxy-middleware","name":"http-proxy-middleware","forks":880,"owner":"chimurai","stars":11132,"title":"chimurai/http-proxy-middleware","source":"github.com","fullName":"chimurai/http-proxy-middleware","language":"TypeScript","updatedAt":"2026-08-01T11:55:01Z","description":":zap: The one-liner node.js http-proxy middleware for connect, express, next.js and more"      },      {"url":"https://github.com/honojs/middleware","name":"middleware","forks":360,"owner":"honojs","stars":971,"title":"honojs/middleware","source":"github.com","fullName":"honojs/middleware","language":"TypeScript","updatedAt":"2026-08-02T04:49:53Z","description":"monorepo for Hono third-party middleware/helpers/wrappers"      },      {"url":"https://github.com/rhinobase/hono-openapi","name":"hono-openapi","forks":59,"owner":"rhinobase","stars":778,"title":"rhinobase/hono-openapi","source":"github.com","fullName":"rhinobase/hono-openapi","language":"TypeScript","updatedAt":"2026-07-31T13:06:26Z","description":"Hono middleware to generate OpenAPI Swagger documentation"      },      {"url":"https://github.com/rhinobase/hono-rate-limiter","name":"hono-rate-limiter","forks":23,"owner":"rhinobase","stars":646,"title":"rhinobase/hono-rate-limiter","source":"github.com","fullName":"rhinobase/hono-rate-limiter","language":"TypeScript","updatedAt":"2026-07-25T09:58:00Z","description":"Rate Limit middleware for Hono Server"      },      {"url":"https://github.com/sergiodxa/remix-hono","name":"remix-hono","forks":9,"owner":"sergiodxa","stars":553,"title":"sergiodxa/remix-hono","source":"github.com","fullName":"sergiodxa/remix-hono","language":"TypeScript","updatedAt":"2026-07-23T10:43:29Z","description":"Hono middlewares for Remix"      }    ],"total":231,"hasMore":true,"nextPage":2  },"timestamp":"2026-05-27T13:33:54Z"}

Errors

  • 401Missing or invalid x-api-key
  • 404Not found or private
  • 429Rate limit or monthly quota reached

Code

const data = await client.run(  "search-tools:github-code",  "search",  { query: "react", count: 10, page: 1, sort: "stars" });