{"uid":"cap_elpyqDn_Nz0MafyxmE8xH","slug":"2s-io-github-code-search-6cf6950f","name":"2s.io GitHub Code Search","description":"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.","url":"https://2s.io/api/github/search-code","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","queryParams"],"properties":{"type":{"const":"http"},"method":{"const":"GET"},"queryParams":{"type":"object","required":["q"],"properties":{"q":{"type":"string","maxLength":400,"minLength":1},"page":{"type":"integer","minimum":1},"perPage":{"type":"integer","maximum":50,"minimum":1}},"additionalProperties":false}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.0025","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.0025/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0025","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0025","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_5DYBx4Y4DeEF4tonoLWqF","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.0025","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Search GitHub repositories using GitHub's code-search syntax and return matching file names, paths, repositories, and URLs","exampleAgentPrompt":"Search GitHub for all JavaScript files that use the addEventListener function — show me the file names, paths, and repo links for the first 10 results.","exampleUseCases":null,"resultDescription":"Returns the total number of matching files found on GitHub, plus a list of results each containing the file name, file path, repository name, and direct URL to the file on GitHub.","failureModes":["Empty query string returns validation error (minLength:1 violated)","Query exceeding 400 characters rejected (maxLength:400 violated)","Invalid page or perPage values return schema validation errors","Overly broad queries may return very high match counts with limited per-page results","GitHub's code search index may not include very recently pushed code","Rate limits from the underlying GitHub API may cause transient failures"],"whenToPreferThis":"Use this endpoint when you need to search across all public GitHub code using GitHub's powerful code-search syntax (e.g. scoping by repo, language, filename, or path), without needing a GitHub API key. Ideal for agents that need to find real code examples, discover usage patterns of a library or function, or locate specific files across open-source repositories. Prefer this over raw GitHub API calls when no auth token is available and the cost of $0.001 per call is acceptable.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T07:10:53.326Z","isFirstParty":false}