github

Search code across GitHub with the code-search syntax (e.g.

Search code across GitHub with the code-search syntax (e.g. 'defineEndpoint repo:AlleyFord/2s' or 'addEventListener language:js'). Returns total match count + file name, path, repository, and URL for each hit. Read-only; no caller key needed.

get/api/github/search-code

Request

  • Base URL: https://2s.io
  • URL: https://2s.io/api/github/search-code
  • Auth: API key in header PAYMENT-SIGNATURE

Query parameters

qstring required

Free-text search query.

perPageinteger

Number of results to return per page.

pageinteger

Page number (1-based) for paginated results.

trial1

Try before you buy. Set to 1 for one free real call per endpoint per hour — no wallet or payment needed — to verify the endpoint before paying. Equivalent to sending the "X-2s-Trial: 1" request header. Listed only on operations that offer a trial; the others always answer 402.

Response

(unresolved $ref)

Changes

No recorded changes to this operation across all 1 revision of this API.