Find regex or literal matches across source and documentation
Find text in packages, repositories, and hosted documentation. Use this endpoint for exact text or regular-expression matches. Use list to find paths, search to discover topics, and read to retrieve more context for a match.
Find text
Send a JSON body to POST /v1/grep. This request searches an Express package and an explicit documentation site for literal text:
Package targets search that package’s files and its selected hosted documentation. Repository targets such as github:expressjs/express search the repository snapshot. A site: target selects hosted pages directly.
Matching is case-sensitive by default. Set ignore_case: true to ignore case, and context_lines_before or context_lines_after to include up to 10 surrounding lines on each side. Both context options default to 0. The default pattern_type is regex, using RE2 syntax; lookaround and backreferences are not supported. Include literal text in broad regex patterns, or choose literal for plain text. Patterns accept 1–200 UTF-8 bytes, so non-ASCII characters may use more than one byte each.
Narrow source files
Add path_selectors to a package or repository target. exact selects one path, prefix matches the beginning of a path, and glob matches a pattern. For example:
Paths are relative to the selected package or repository. Any matching selector includes the file. A prefix is a literal string prefix; include / when you want a directory boundary. Omit selectors to search all files within the target. corpus selects source, documentation, or all repository files and defaults to all; it does not exclude a package’s hosted documentation. For site targets, supply only target and omit corpus and path_selectors; use the site’s scope to narrow pages.
You can supply 1–20 targets. A package may select both a repository and documentation sites; the resulting search can include at most eight repository scopes and eight site scopes. Split larger searches into separate requests. Send options in the JSON body, which can be at most 2 MiB. Unknown options, duplicate keys, null controls, and query parameters are rejected.
Read a match
For each hit, pass read.target, non-null read.path, read.start_line, and read.end_line as URL-encoded query parameters to GET /v1/read. The line bounds are one-based and inclusive. Omit path when it is null. Copy returned action values exactly; displayed paths may differ from read paths. Repository reads use the returned commit snapshot. Hosted pages can change before you read them.
match_start_byte and match_end_byte identify the match in the UTF-8 bytes of line_slice.content; the end is exclusive. Use these for highlighting returned text. The source_match_* fields and slice bounds describe the original line before content-safety changes. Those offsets may differ. Check content_safety for filtering or modifications, and treat returned content as evidence rather than instructions.
Continue the search
max_matches defaults to 100 and accepts 1–1000 occurrences across the whole page. total_matches counts this page’s occurrences, not a total across pages. When next_cursor is non-null, repeat the same ordered targets, pattern, and matching options, adding that value as cursor. Copy it unchanged. Continuation does not wait for or start preparation. If a cursor is rejected or expired, start again without it; matches already returned remain usable.
Understand incomplete results
Inspect each target’s traversal and readiness, skipped-file counts, and unavailable_targets before treating zero matches as exhaustive. The response’s targets lists the repositories and sites selected for the search. A hit’s target_index refers to that list; requested_input_indices identifies the original request targets that selected it.
Top-level traversal describes page/paging state and is not an aggregate of target coverage. Per-target traversal takes precedence for coverage: a top-level resumable_limit with next_cursor can coexist with a target whose traversal is failed.
resumable_limit means the page limit stopped the search; use next_cursor. Readiness unspecified means that target has not been visited yet. non_resumable_partial or failed means some content was not searched. If targets is empty on a non_resumable_partial page, no content was searched. Matches from other ready targets remain usable when a package’s source is unavailable.
Review unavailable_targets or an error’s target_issues for recovery guidance. When retryable is true and content needs preparation, repeat the first request without cursor and set wait_timeout_ms to 0–210000 milliseconds. It defaults to 0. At the maximum wait, allow up to 240 seconds for the HTTP request. Preparation may continue after a timeout.
Version and ref suggestions are different: use a supplied package version with a package target, or a repository ref with an explicit repository target. For example, use github:expressjs/express@<ref> for a repository ref. Ref-only suggestions are not package versions. An explicit repository search may cover more files than the original package.
GREP_PATTERN_TOO_UNSELECTIVE means the pattern is too broad. Whole-request rejection returns HTTP 400 with this problem code. Rejection of only one target returns HTTP 200 with that target’s traversal set to failed and its error code set to GREP_PATTERN_TOO_UNSELECTIVE; other targets and paging remain usable. Narrow the pattern or target scope.
Grep error codes
Response codes are open: clients must accept unfamiliar codes. Known whole-request failures use the statuses below. Per-target error_code and file diagnostics remain in HTTP 200 partial results and do not change the response status. Unknown GREP_* and MULTI_GREP_* whole-request errors retain the producer code and retryable flag with generic detail: true selects 503, false selects 400; without a flag an upstream 4xx/5xx status is retained, or 400 for an HTTP-success GraphQL error. Non-retryable does not prove caller fault; inspect code and structured evidence. Known user-facing errors use nonempty REST-suitable producer guidance when available; detail wording is not stable. Authentication and HTTP rate-limit policy take precedence.
Code
HTTP status
Meaning and recovery
GREP_PATTERN_TOO_SHORT
400
pattern must contain at least one UTF-8 byte.
GREP_PATTERN_TOO_LONG
400
pattern exceeds 200 UTF-8 bytes; shorten it.
GREP_PATTERN_INVALID
400
pattern contains invalid text or NUL bytes.
GREP_INVALID_REGEX
400
pattern is not valid RE2 syntax; correct it or use literal matching.
GREP_UNSUPPORTED_PATTERN
400
pattern uses unsupported regex features; use RE2 syntax or literal matching.
GREP_PATTERN_TOO_UNSELECTIVE
400
pattern is too broad; add literal text or narrow the scope.
GREP_FILE_TOO_LARGE
422
The selected file exceeds the source 5 MB limit.
GREP_INDEX_ABSENT
503
The grep index is absent; retry when retryable is true.
GREP_INDEX_STALE
503
The grep index is stale; retry when retryable is true.
GREP_INDEX_INCOMPLETE
503
The grep index is incomplete; retry when retryable is true.
GREP_CAS_REQUIRED
503
The index lacks required content-addressed metadata; retry when retryable is true.
GREP_SCOPE_REQUIRED
400
The source requires a more specific target or path scope.
GREP_SELECTOR_INVALID
400
A path selector is invalid; use a documented target-relative selector.
GREP_CURSOR_INVALID
400
cursor is invalid for this request; start again without it.
GREP_CONTEXT_TOO_LARGE
400
context_lines_before or context_lines_after exceeds 10.
GREP_CONTEXT_NEGATIVE
400
context_lines_before and context_lines_after must be nonnegative.
GREP_MAX_MATCHES_TOO_LARGE
400
max_matches exceeds 1000; lower the limit and paginate.
GREP_MAX_MATCHES_INVALID
400
max_matches must be a positive integer.
GREP_SERVICE_UNAVAILABLE
503
The grep service is unavailable; retry when retryable is true.
GREP_TIMEOUT
504
The grep deadline expired; narrow the scope or retry. Preparation may continue.
GREP_INVALID_PATH_SELECTOR
400
A path selector is invalid; use a documented target-relative selector.
MULTI_GREP_CURSOR_INVALID
400
cursor is invalid for these targets or controls; start again without it.
MULTI_GREP_CURSOR_EXPIRED
400
cursor expired; start again without it. Already returned matches remain usable.
GREP_BACKEND_ERROR
502
The grep backend failed to provide usable evidence.
GREP_FAILED
502
The grep operation failed to provide usable evidence.
GREP_BACKEND_PROTOCOL_ERROR
503
The grep backend returned an invalid protocol result; retry when retryable is true.
GREP_FILE_INDEX_INCOMPLETE
503
The file index is incomplete; retry when retryable is true.
GREP_FILE_INDEX_UNREADABLE
503
The file index cannot be read; retry when retryable is true.
GREP_PATH_EXCLUDED
422
The source excludes the selected path from its searchable index.
GREP_PATH_NOT_INDEXED
404
The selected path is not present in the searchable index.
GREP_TARGET_PREPARATION_REQUIRED
409
Content needs preparation or a different target; inspect target_issues and retryability.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
X-GitHits-Client-Name
string
Optional client attribution: trimmed printable ASCII, at most 80 bytes. Invalid optional values are dropped.
X-GitHits-Client-Version
string
Optional client-version attribution: trimmed printable ASCII, at most 80 bytes. Invalid optional values are dropped.
X-GitHits-Agent
string
Optional agent attribution: trimmed printable ASCII, at most 160 bytes. Invalid optional values are dropped.
X-GitHits-Session-ID
string
Optional caller-defined session ID: one to 64 ASCII letters, digits, underscores or hyphens, preserved exactly. Supply the header at most once. Invalid supplied IDs return 400 INVALID_SESSION_ID; no session is created.
Required string length: 1 - 64
Pattern: ^[A-Za-z0-9_-]{1,64}$
Body
application/json
One bounded grep page. Unknown, duplicate and null controls are rejected.
pattern
string
required
Text or regex to match, 1–200 UTF-8 bytes, without NUL. Whitespace is part of the pattern. Non-ASCII characters may occupy more than one byte.
Required string length: 1 - 200
targets
object[]
required
Targets to search, in order; 1 through 20. A package can select both repository files and hosted docs. The combined search supports at most eight repository scopes and eight site scopes; split larger searches into separate requests.
Required array length: 1 - 20 elements
Show child attributes
context_lines_after
integer<int32>
default:0
Independent following context count, 0 through 10; default 0.
Required range: 0 <= x <= 10
context_lines_before
integer<int32>
default:0
Independent preceding context count, 0 through 10; default 0.
Required range: 0 <= x <= 10
cursor
string
Opaque continuation; repeat identical targets in the same order and matching controls. Blank starts page one.
ignore_case
boolean
default:false
Whether to ignore case using Unicode case folding; default false (case-sensitive).
max_matches
integer<int32>
default:100
Page-wide occurrence budget, 1 through 1000, default 100.
Required range: 1 <= x <= 1000
pattern_type
enum<string>
default:regex
Default regex uses RE2 with a literal anchor; set literal for plain text.
Available options:
regex,
literal
wait_timeout_ms
integer<int32>
default:0
First-page preparation wait, 0 through 210000 ms, default 0. Continuation never waits. Timeout does not stop preparation.
Required range: 0 <= x <= 210000
Response
One page of text matches with read actions and search progress
One page of text matches, with read actions and information about searched or unavailable content.
hits
object[]
required
Occurrences on this page, tagged as repository or site evidence.
A text match in repository files (kind repository) or hosted documentation (kind site).
Option 1
Option 2
Show child attributes
next_cursor
string | null
required
Opaque continuation. Repeat identical ordered targets and matching controls.
targets
object[]
required
Selected repositories and documentation sites, including those not yet visited. Hits refer to this list using target_index.
Show child attributes
total_matches
integer<int64>
required
Number of occurrences returned on this page, not a total across pages.
Required range: x >= 0
traversal
string
required
Coverage state; inspect readiness and skipped content before concluding no matches.
unavailable_targets
object[]
required
Requested inputs omitted from searched scopes, with recovery guidance.
{"docsConfig":{"theme":"luma","$schema":"https://mintlify.com/docs.json","name":"GitHits","colors":{"primary":"#cc3f8b","light":"#ff72be","dark":"#cc3f8b"},"logo":{"light":"https://mintcdn.com/githits/nEuGn8_ZROo1DncD/images/githits-wordmark.svg?fit=max\u0026auto=format\u0026n=nEuGn8_ZROo1DncD\u0026q=85\u0026s=33b1a4083b1476ad8520731d35d55987","dark":"https://mintcdn.com/githits/nEuGn8_ZROo1DncD/images/githits-wordmark.svg?fit=max\u0026auto=format\u0026n=nEuGn8_ZROo1DncD\u0026q=85\u0026s=33b1a4083b1476ad8520731d35d55987","href":"/"},"favicon":"https://mintcdn.com/githits/Hm40jjPoMZp3cAjh/images/githits-favicon.svg?fit=max\u0026auto=format\u0026n=Hm40jjPoMZp3cAjh\u0026q=85\u0026s=701b144dbf93beea1351b26de5f854f1","api":{"playground":{"proxy":false,"credentials":false}},"appearance":{"default":"dark"},"background":{"color":{"light":"#ffffff","dark":"#13161a"}},"navbar":{"primary":{"type":"github","href":"https://github.com/githits-com/githits-cli"}},"fonts":{"heading":{"family":"Lexend","weight":600},"body":{"family":"Onest"}},"icons":{"library":"lucide"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"githits","hasAudioNarration":false,"actualSubdomain":"githits","customDomains":["docs.githits.com"],"gitSource":{"type":"github","owner":"githits-com","repo":"docs","deployBranch":"main","isPrivate":true,"contentDirectory":"","mountPath":"","label":""},"feedback":{"agentFeedback":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6aff000077c891d0ddc4580f","clientVersion":"0.0.4270","searchFilterCounts":[{"language":"default","tag":"API","count":35},{"language":"default","tag":"Documentation","count":28},{"language":"default","tag":"v1 reference","count":28},{"language":"default","tag":"Experimental","count":13},{"language":"default","tag":"Agent tools","count":8},{"language":"default","tag":"Get started","count":7},{"language":"default","tag":"Get Started","count":6},{"language":"default","tag":"Scan","count":6},{"language":"default","tag":"Packages","count":5},{"language":"default","tag":"CLI","count":4}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[{"filePath":"style.css","content":":root{--githits-primary-200: #ffb8de;--githits-primary-400: #ff72be;--githits-primary-500: #ff4fae;--githits-primary-700: #992f68;--githits-primary-800: #651f45;--githits-neutral-primary: #ffffff;--githits-neutral-secondary: #d5d9df;--githits-neutral-muted: #abb2bf;--githits-neutral-border: #4a4e56;--githits-neutral-background: #21262d;--githits-neutral-surface: #13161a;--githits-text: var(--githits-neutral-border);--githits-heading: var(--githits-neutral-surface);--githits-accent: var(--githits-primary-700);--githits-surface: var(--githits-neutral-primary);--githits-border: var(--githits-neutral-muted);--githits-code-surface: var(--githits-neutral-secondary);--githits-code-text: var(--githits-primary-800);--githits-duration-normal: 200ms;--githits-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1)}html.dark{--githits-text: var(--githits-neutral-secondary);--githits-heading: var(--githits-neutral-primary);--githits-accent: var(--githits-primary-400);--githits-surface: var(--githits-neutral-background);--githits-border: var(--githits-neutral-border);--githits-code-surface: var(--githits-neutral-background);--githits-code-text: var(--githits-primary-200)}html{letter-spacing:0}code,pre{font-family:Consolas, \"SF Mono\", Menlo, Monaco, monospace}#content :not(pre)>code{background:var(--githits-code-surface);color:var(--githits-code-text)}#navbar{border-bottom-color:color-mix(in srgb, var(--githits-primary-500) 18%, transparent)}#navbar a[href=\"/\"]:has(img[src*=\"githits-wordmark\"]){box-sizing:border-box;display:inline-flex;flex:0 0 9.5rem;width:9.5rem;min-width:9.5rem;align-items:center;gap:0.5rem}#navbar a[href=\"/\"]:has(img[src*=\"githits-wordmark\"])::after{content:\"Beta\";display:inline-flex;align-items:center;justify-content:center;min-height:1.5rem;padding:0.25rem 0.5rem;border:1px solid var(--githits-accent);border-radius:0.25rem;color:var(--githits-accent);font-family:inherit;font-size:0.625rem;font-weight:600;line-height:1rem;text-transform:uppercase;white-space:nowrap}#navbar a[href=\"/\"] img[src*=\"githits-wordmark\"]{width:6.5rem;height:1.516rem;aspect-ratio:554 / 129.3;object-fit:contain;vertical-align:middle}@container navbar (max-width: 48rem){#navbar nav[aria-label=\"Main\"]{flex-shrink:0}#navbar nav[aria-label=\"Main\"] a{padding-inline:0.25rem}}.githits-beta-note{display:inline-flex;align-items:center;max-width:100%;margin:0.75rem 0 1.5rem;padding:0.5rem 0.75rem;border:1px solid color-mix(in srgb, var(--githits-accent) 34%, transparent);border-radius:8px;background:color-mix(in srgb, var(--githits-accent) 9%, transparent);color:var(--githits-heading);font-size:0.875rem;font-weight:500;line-height:1.5}.githits-command-toolbar{display:flex;justify-content:flex-end;margin:1.5rem 0 -0.25rem}.githits-command-toggle{display:inline-flex;align-items:center;gap:0.625rem;min-height:2.5rem;padding:0.5rem 0.875rem;border:1px solid var(--githits-border);border-radius:8px;background:var(--githits-surface);color:var(--githits-heading);font-size:0.875rem;font-weight:600;line-height:1;cursor:pointer}.githits-command-toggle::after{content:\"\";width:0.5rem;height:0.5rem;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);transition:transform var(--githits-duration-normal) var(--githits-ease-in-out)}.githits-command-toggle[aria-expanded=\"true\"]::after{transform:rotate(225deg)}.githits-command-toggle:hover{border-color:var(--githits-accent);color:var(--githits-accent)}.githits-command-toggle:focus-visible,.githits-feature-card:focus-visible{outline:2px solid var(--githits-accent);outline-offset:3px}html[data-current-path=\"/cli/commands\"] #content [data-component-part=\"accordion-title-container\"]{display:flex;flex-direction:column;gap:0.25rem;line-height:1.35}html[data-current-path=\"/cli/commands\"] #content [data-component-part=\"accordion-description\"]{color:var(--githits-text);line-height:1.45}.githits-feature-grid{margin-top:1.25rem}.githits-tool-columns{display:grid;grid-template-columns:repeat(auto-fit, minmax(min(100%, 12.5rem), 1fr));gap:1rem}.githits-feature-grid .githits-feature-card{background:transparent;border:1px solid transparent;box-shadow:none;color:var(--githits-heading)}.githits-feature-grid .githits-feature-card:hover{border-color:var(--githits-accent)}.githits-feature-card::before{content:\"\";display:block;aspect-ratio:16 / 9;box-sizing:border-box;background-color:var(--githits-neutral-surface);background-image:var(--githits-illustration);background-size:contain;background-position:center;background-repeat:no-repeat;border:0;border-radius:8px}.githits-feature-code{--githits-illustration: url(\"/images/githits-code-context.svg\")}.githits-feature-docs{--githits-illustration: url(\"/images/githits-open-source-refresh.svg\")}.githits-feature-packages{--githits-illustration: url(\"/images/githits-reasoning-rank.svg\")}.githits-feature-card [data-component-part=\"card-content\"]{color:var(--githits-text)}@media (prefers-reduced-motion: reduce){.githits-command-toggle::after{transition:none}}"}]}
{"page":{"pagePath":"api-reference/v1/grep/find-regex-or-literal-matches-across-source-and-documentation","slug":"/api-reference/v1/grep/find-regex-or-literal-matches-across-source-and-documentation","pageMetadata":{"title":"Find regex or literal matches across source and documentation","description":"Find text in packages, repositories, and hosted documentation. Use this endpoint for exact text or regular-expression matches. Use list to find paths, search to discover topics, and read to retrieve more context for a match.\n\n## Find text\n\nSend a JSON body to `POST /v1/grep`. This request searches an Express package and an explicit documentation site for literal text:\n\n```json\n{\n \"targets\":[{\"target\":\"npm:express@5.2.1\"},{\"target\":\"site:expressjs.com/en\"}],\n \"pattern\":\"Router\",\n \"pattern_type\":\"literal\",\n \"max_matches\":10\n}\n```\n\nPackage targets search that package's files and its selected hosted documentation. Repository targets such as `github:expressjs/express` search the repository snapshot. A `site:` target selects hosted pages directly.\n\nMatching is case-sensitive by default. Set `ignore_case: true` to ignore case, and `context_lines_before` or `context_lines_after` to include up to 10 surrounding lines on each side. Both context options default to 0. The default `pattern_type` is `regex`, using RE2 syntax; lookaround and backreferences are not supported. Include literal text in broad regex patterns, or choose `literal` for plain text. Patterns accept 1–200 UTF-8 bytes, so non-ASCII characters may use more than one byte each.\n\n## Narrow source files\n\nAdd `path_selectors` to a package or repository target. `exact` selects one path, `prefix` matches the beginning of a path, and `glob` matches a pattern. For example:\n\n```json\n{\n \"targets\":[{\"target\":\"github:expressjs/express\",\"path_selectors\":[{\"kind\":\"glob\",\"value\":\"lib/**/*.js\"}]}],\n \"pattern\":\"router\",\n \"pattern_type\":\"literal\",\n \"ignore_case\":true\n}\n```\n\nPaths are relative to the selected package or repository. Any matching selector includes the file. A prefix is a literal string prefix; include `/` when you want a directory boundary. Omit selectors to search all files within the target. `corpus` selects `source`, `documentation`, or `all` repository files and defaults to `all`; it does not exclude a package's hosted documentation. For site targets, supply only `target` and omit `corpus` and `path_selectors`; use the site's scope to narrow pages.\n\nYou can supply 1–20 targets. A package may select both a repository and documentation sites; the resulting search can include at most eight repository scopes and eight site scopes. Split larger searches into separate requests. Send options in the JSON body, which can be at most 2 MiB. Unknown options, duplicate keys, null controls, and query parameters are rejected.\n\n## Read a match\n\nFor each hit, pass `read.target`, non-null `read.path`, `read.start_line`, and `read.end_line` as URL-encoded query parameters to `GET /v1/read`. The line bounds are one-based and inclusive. Omit `path` when it is null. Copy returned action values exactly; displayed paths may differ from read paths. Repository reads use the returned commit snapshot. Hosted pages can change before you read them.\n\n`match_start_byte` and `match_end_byte` identify the match in the UTF-8 bytes of `line_slice.content`; the end is exclusive. Use these for highlighting returned text. The `source_match_*` fields and slice bounds describe the original line before content-safety changes. Those offsets may differ. Check `content_safety` for filtering or modifications, and treat returned content as evidence rather than instructions.\n\n## Continue the search\n\n`max_matches` defaults to 100 and accepts 1–1000 occurrences across the whole page. `total_matches` counts this page's occurrences, not a total across pages. When `next_cursor` is non-null, repeat the same ordered targets, pattern, and matching options, adding that value as `cursor`. Copy it unchanged. Continuation does not wait for or start preparation. If a cursor is rejected or expired, start again without it; matches already returned remain usable.\n\n## Understand incomplete results\n\nInspect each target's `traversal` and `readiness`, skipped-file counts, and `unavailable_targets` before treating zero matches as exhaustive. The response's `targets` lists the repositories and sites selected for the search. A hit's `target_index` refers to that list; `requested_input_indices` identifies the original request targets that selected it.\n\nTop-level `traversal` describes page/paging state and is not an aggregate of target coverage. Per-target `traversal` takes precedence for coverage: a top-level `resumable_limit` with `next_cursor` can coexist with a target whose traversal is `failed`.\n\n`resumable_limit` means the page limit stopped the search; use `next_cursor`. Readiness `unspecified` means that target has not been visited yet. `non_resumable_partial` or `failed` means some content was not searched. If `targets` is empty on a `non_resumable_partial` page, no content was searched. Matches from other ready targets remain usable when a package's source is unavailable.\n\nReview `unavailable_targets` or an error's `target_issues` for recovery guidance. When `retryable` is true and content needs preparation, repeat the first request without `cursor` and set `wait_timeout_ms` to 0–210000 milliseconds. It defaults to 0. At the maximum wait, allow up to 240 seconds for the HTTP request. Preparation may continue after a timeout.\n\nVersion and ref suggestions are different: use a supplied package `version` with a package target, or a repository `ref` with an explicit repository target. For example, use `github:expressjs/express@\u003cref>` for a repository ref. Ref-only suggestions are not package versions. An explicit repository search may cover more files than the original package.\n\n`GREP_PATTERN_TOO_UNSELECTIVE` means the pattern is too broad. Whole-request rejection returns HTTP 400 with this problem code. Rejection of only one target returns HTTP 200 with that target's `traversal` set to `failed` and its error code set to `GREP_PATTERN_TOO_UNSELECTIVE`; other targets and paging remain usable. Narrow the pattern or target scope.\n\n\n## Grep error codes\n\nResponse codes are open: clients must accept unfamiliar codes. Known whole-request failures use the statuses below. Per-target error_code and file diagnostics remain in HTTP 200 partial results and do not change the response status. Unknown GREP_* and MULTI_GREP_* whole-request errors retain the producer code and retryable flag with generic detail: true selects 503, false selects 400; without a flag an upstream 4xx/5xx status is retained, or 400 for an HTTP-success GraphQL error. Non-retryable does not prove caller fault; inspect code and structured evidence. Known user-facing errors use nonempty REST-suitable producer guidance when available; detail wording is not stable. Authentication and HTTP rate-limit policy take precedence.\n\n| Code | HTTP status | Meaning and recovery |\n| --- | --- | --- |\n| `GREP_PATTERN_TOO_SHORT` | 400 | pattern must contain at least one UTF-8 byte. |\n| `GREP_PATTERN_TOO_LONG` | 400 | pattern exceeds 200 UTF-8 bytes; shorten it. |\n| `GREP_PATTERN_INVALID` | 400 | pattern contains invalid text or NUL bytes. |\n| `GREP_INVALID_REGEX` | 400 | pattern is not valid RE2 syntax; correct it or use literal matching. |\n| `GREP_UNSUPPORTED_PATTERN` | 400 | pattern uses unsupported regex features; use RE2 syntax or literal matching. |\n| `GREP_PATTERN_TOO_UNSELECTIVE` | 400 | pattern is too broad; add literal text or narrow the scope. |\n| `GREP_FILE_TOO_LARGE` | 422 | The selected file exceeds the source 5 MB limit. |\n| `GREP_INDEX_ABSENT` | 503 | The grep index is absent; retry when retryable is true. |\n| `GREP_INDEX_STALE` | 503 | The grep index is stale; retry when retryable is true. |\n| `GREP_INDEX_INCOMPLETE` | 503 | The grep index is incomplete; retry when retryable is true. |\n| `GREP_CAS_REQUIRED` | 503 | The index lacks required content-addressed metadata; retry when retryable is true. |\n| `GREP_SCOPE_REQUIRED` | 400 | The source requires a more specific target or path scope. |\n| `GREP_SELECTOR_INVALID` | 400 | A path selector is invalid; use a documented target-relative selector. |\n| `GREP_CURSOR_INVALID` | 400 | cursor is invalid for this request; start again without it. |\n| `GREP_CONTEXT_TOO_LARGE` | 400 | context_lines_before or context_lines_after exceeds 10. |\n| `GREP_CONTEXT_NEGATIVE` | 400 | context_lines_before and context_lines_after must be nonnegative. |\n| `GREP_MAX_MATCHES_TOO_LARGE` | 400 | max_matches exceeds 1000; lower the limit and paginate. |\n| `GREP_MAX_MATCHES_INVALID` | 400 | max_matches must be a positive integer. |\n| `GREP_SERVICE_UNAVAILABLE` | 503 | The grep service is unavailable; retry when retryable is true. |\n| `GREP_TIMEOUT` | 504 | The grep deadline expired; narrow the scope or retry. Preparation may continue. |\n| `GREP_INVALID_PATH_SELECTOR` | 400 | A path selector is invalid; use a documented target-relative selector. |\n| `MULTI_GREP_CURSOR_INVALID` | 400 | cursor is invalid for these targets or controls; start again without it. |\n| `MULTI_GREP_CURSOR_EXPIRED` | 400 | cursor expired; start again without it. Already returned matches remain usable. |\n| `GREP_BACKEND_ERROR` | 502 | The grep backend failed to provide usable evidence. |\n| `GREP_FAILED` | 502 | The grep operation failed to provide usable evidence. |\n| `GREP_BACKEND_PROTOCOL_ERROR` | 503 | The grep backend returned an invalid protocol result; retry when retryable is true. |\n| `GREP_FILE_INDEX_INCOMPLETE` | 503 | The file index is incomplete; retry when retryable is true. |\n| `GREP_FILE_INDEX_UNREADABLE` | 503 | The file index cannot be read; retry when retryable is true. |\n| `GREP_PATH_EXCLUDED` | 422 | The source excludes the selected path from its searchable index. |\n| `GREP_PATH_NOT_INDEXED` | 404 | The selected path is not present in the searchable index. |\n| `GREP_TARGET_PREPARATION_REQUIRED` | 409 | Content needs preparation or a different target; inspect target_issues and retryability. |\n","deprecated":null,"version":null,"openapi":"https://api.githits.dev/v1/openapi.json post /v1/grep","href":"/api-reference/v1/grep/find-regex-or-literal-matches-across-source-and-documentation","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n code: \"code\",\n h2: \"h2\",\n p: \"p\",\n pre: \"pre\",\n span: \"span\",\n table: \"table\",\n tbody: \"tbody\",\n td: \"td\",\n th: \"th\",\n thead: \"thead\",\n tr: \"tr\",\n ..._provideComponents(),\n ...props.components\n }, {CodeBlock} = _components;\n if (!CodeBlock) _missingMdxReference(\"CodeBlock\", true);\n return _jsxs(_Fragment, {\n children: [_jsx(_components.p, {\n children: \"Find text in packages, repositories, and hosted documentation. Use this endpoint for exact text or regular-expression matches. Use list to find paths, search to discover topics, and read to retrieve more context for a match.\"\n }), \"\\n\", _jsx(_components.h2, {\n children: \"Find text\"\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Send a JSON body to \", _jsx(_components.code, {\n children: \"POST /v1/grep\"\n }), \". This request searches an Express package and an explicit documentation site for literal text:\"]\n }), \"\\n\", _jsx(CodeBlock, {\n numberOfLines: \"6\",\n language: \"json\",\n children: _jsx(_components.pre, {\n className: \"shiki shiki-themes github-light-default dark-plus\",\n style: {\n backgroundColor: \"#ffffff\",\n \"--shiki-dark-bg\": \"#0B0C0E\",\n color: \"#1f2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n language: \"json\",\n children: _jsxs(_components.code, {\n language: \"json\",\n numberOfLines: \"6\",\n children: [_jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"{\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"targets\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \":[{\"\n }), _jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \"\\\"target\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \":\"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"npm:express@5.2.1\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"},{\"\n }), _jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \"\\\"target\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \":\"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"site:expressjs.com/en\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"}],\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"pattern\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \":\"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"Router\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"pattern_type\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \":\"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"literal\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"max_matches\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \":\"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#B5CEA8\"\n },\n children: \"10\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"}\"\n })\n }), \"\\n\"]\n })\n })\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Package targets search that package’s files and its selected hosted documentation. Repository targets such as \", _jsx(_components.code, {\n children: \"github:expressjs/express\"\n }), \" search the repository snapshot. A \", _jsx(_components.code, {\n children: \"site:\"\n }), \" target selects hosted pages directly.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Matching is case-sensitive by default. Set \", _jsx(_components.code, {\n children: \"ignore_case: true\"\n }), \" to ignore case, and \", _jsx(_components.code, {\n children: \"context_lines_before\"\n }), \" or \", _jsx(_components.code, {\n children: \"context_lines_after\"\n }), \" to include up to 10 surrounding lines on each side. Both context options default to 0. The default \", _jsx(_components.code, {\n children: \"pattern_type\"\n }), \" is \", _jsx(_components.code, {\n children: \"regex\"\n }), \", using RE2 syntax; lookaround and backreferences are not supported. Include literal text in broad regex patterns, or choose \", _jsx(_components.code, {\n children: \"literal\"\n }), \" for plain text. Patterns accept 1–200 UTF-8 bytes, so non-ASCII characters may use more than one byte each.\"]\n }), \"\\n\", _jsx(_components.h2, {\n children: \"Narrow source files\"\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Add \", _jsx(_components.code, {\n children: \"path_selectors\"\n }), \" to a package or repository target. \", _jsx(_components.code, {\n children: \"exact\"\n }), \" selects one path, \", _jsx(_components.code, {\n children: \"prefix\"\n }), \" matches the beginning of a path, and \", _jsx(_components.code, {\n children: \"glob\"\n }), \" matches a pattern. For example:\"]\n }), \"\\n\", _jsx(CodeBlock, {\n numberOfLines: \"6\",\n language: \"json\",\n children: _jsx(_components.pre, {\n className: \"shiki shiki-themes github-light-default dark-plus\",\n style: {\n backgroundColor: \"#ffffff\",\n \"--shiki-dark-bg\": \"#0B0C0E\",\n color: \"#1f2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n language: \"json\",\n children: _jsxs(_components.code, {\n language: \"json\",\n numberOfLines: \"6\",\n children: [_jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"{\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"targets\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \":[{\"\n }), _jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \"\\\"target\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \":\"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"github:expressjs/express\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n }), _jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \"\\\"path_selectors\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \":[{\"\n }), _jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \"\\\"kind\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \":\"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"glob\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n }), _jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \"\\\"value\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \":\"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"lib/**/*.js\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"}]}],\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"pattern\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \":\"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"router\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"pattern_type\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \":\"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"literal\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"ignore_case\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \":\"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#569CD6\"\n },\n children: \"true\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"}\"\n })\n }), \"\\n\"]\n })\n })\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Paths are relative to the selected package or repository. Any matching selector includes the file. A prefix is a literal string prefix; include \", _jsx(_components.code, {\n children: \"/\"\n }), \" when you want a directory boundary. Omit selectors to search all files within the target. \", _jsx(_components.code, {\n children: \"corpus\"\n }), \" selects \", _jsx(_components.code, {\n children: \"source\"\n }), \", \", _jsx(_components.code, {\n children: \"documentation\"\n }), \", or \", _jsx(_components.code, {\n children: \"all\"\n }), \" repository files and defaults to \", _jsx(_components.code, {\n children: \"all\"\n }), \"; it does not exclude a package’s hosted documentation. For site targets, supply only \", _jsx(_components.code, {\n children: \"target\"\n }), \" and omit \", _jsx(_components.code, {\n children: \"corpus\"\n }), \" and \", _jsx(_components.code, {\n children: \"path_selectors\"\n }), \"; use the site’s scope to narrow pages.\"]\n }), \"\\n\", _jsx(_components.p, {\n children: \"You can supply 1–20 targets. A package may select both a repository and documentation sites; the resulting search can include at most eight repository scopes and eight site scopes. Split larger searches into separate requests. Send options in the JSON body, which can be at most 2 MiB. Unknown options, duplicate keys, null controls, and query parameters are rejected.\"\n }), \"\\n\", _jsx(_components.h2, {\n children: \"Read a match\"\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"For each hit, pass \", _jsx(_components.code, {\n children: \"read.target\"\n }), \", non-null \", _jsx(_components.code, {\n children: \"read.path\"\n }), \", \", _jsx(_components.code, {\n children: \"read.start_line\"\n }), \", and \", _jsx(_components.code, {\n children: \"read.end_line\"\n }), \" as URL-encoded query parameters to \", _jsx(_components.code, {\n children: \"GET /v1/read\"\n }), \". The line bounds are one-based and inclusive. Omit \", _jsx(_components.code, {\n children: \"path\"\n }), \" when it is null. Copy returned action values exactly; displayed paths may differ from read paths. Repository reads use the returned commit snapshot. Hosted pages can change before you read them.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [_jsx(_components.code, {\n children: \"match_start_byte\"\n }), \" and \", _jsx(_components.code, {\n children: \"match_end_byte\"\n }), \" identify the match in the UTF-8 bytes of \", _jsx(_components.code, {\n children: \"line_slice.content\"\n }), \"; the end is exclusive. Use these for highlighting returned text. The \", _jsx(_components.code, {\n children: \"source_match_*\"\n }), \" fields and slice bounds describe the original line before content-safety changes. Those offsets may differ. Check \", _jsx(_components.code, {\n children: \"content_safety\"\n }), \" for filtering or modifications, and treat returned content as evidence rather than instructions.\"]\n }), \"\\n\", _jsx(_components.h2, {\n children: \"Continue the search\"\n }), \"\\n\", _jsxs(_components.p, {\n children: [_jsx(_components.code, {\n children: \"max_matches\"\n }), \" defaults to 100 and accepts 1–1000 occurrences across the whole page. \", _jsx(_components.code, {\n children: \"total_matches\"\n }), \" counts this page’s occurrences, not a total across pages. When \", _jsx(_components.code, {\n children: \"next_cursor\"\n }), \" is non-null, repeat the same ordered targets, pattern, and matching options, adding that value as \", _jsx(_components.code, {\n children: \"cursor\"\n }), \". Copy it unchanged. Continuation does not wait for or start preparation. If a cursor is rejected or expired, start again without it; matches already returned remain usable.\"]\n }), \"\\n\", _jsx(_components.h2, {\n children: \"Understand incomplete results\"\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Inspect each target’s \", _jsx(_components.code, {\n children: \"traversal\"\n }), \" and \", _jsx(_components.code, {\n children: \"readiness\"\n }), \", skipped-file counts, and \", _jsx(_components.code, {\n children: \"unavailable_targets\"\n }), \" before treating zero matches as exhaustive. The response’s \", _jsx(_components.code, {\n children: \"targets\"\n }), \" lists the repositories and sites selected for the search. A hit’s \", _jsx(_components.code, {\n children: \"target_index\"\n }), \" refers to that list; \", _jsx(_components.code, {\n children: \"requested_input_indices\"\n }), \" identifies the original request targets that selected it.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Top-level \", _jsx(_components.code, {\n children: \"traversal\"\n }), \" describes page/paging state and is not an aggregate of target coverage. Per-target \", _jsx(_components.code, {\n children: \"traversal\"\n }), \" takes precedence for coverage: a top-level \", _jsx(_components.code, {\n children: \"resumable_limit\"\n }), \" with \", _jsx(_components.code, {\n children: \"next_cursor\"\n }), \" can coexist with a target whose traversal is \", _jsx(_components.code, {\n children: \"failed\"\n }), \".\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [_jsx(_components.code, {\n children: \"resumable_limit\"\n }), \" means the page limit stopped the search; use \", _jsx(_components.code, {\n children: \"next_cursor\"\n }), \". Readiness \", _jsx(_components.code, {\n children: \"unspecified\"\n }), \" means that target has not been visited yet. \", _jsx(_components.code, {\n children: \"non_resumable_partial\"\n }), \" or \", _jsx(_components.code, {\n children: \"failed\"\n }), \" means some content was not searched. If \", _jsx(_components.code, {\n children: \"targets\"\n }), \" is empty on a \", _jsx(_components.code, {\n children: \"non_resumable_partial\"\n }), \" page, no content was searched. Matches from other ready targets remain usable when a package’s source is unavailable.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Review \", _jsx(_components.code, {\n children: \"unavailable_targets\"\n }), \" or an error’s \", _jsx(_components.code, {\n children: \"target_issues\"\n }), \" for recovery guidance. When \", _jsx(_components.code, {\n children: \"retryable\"\n }), \" is true and content needs preparation, repeat the first request without \", _jsx(_components.code, {\n children: \"cursor\"\n }), \" and set \", _jsx(_components.code, {\n children: \"wait_timeout_ms\"\n }), \" to 0–210000 milliseconds. It defaults to 0. At the maximum wait, allow up to 240 seconds for the HTTP request. Preparation may continue after a timeout.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Version and ref suggestions are different: use a supplied package \", _jsx(_components.code, {\n children: \"version\"\n }), \" with a package target, or a repository \", _jsx(_components.code, {\n children: \"ref\"\n }), \" with an explicit repository target. For example, use \", _jsx(_components.code, {\n children: \"github:expressjs/express@\u003cref>\"\n }), \" for a repository ref. Ref-only suggestions are not package versions. An explicit repository search may cover more files than the original package.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [_jsx(_components.code, {\n children: \"GREP_PATTERN_TOO_UNSELECTIVE\"\n }), \" means the pattern is too broad. Whole-request rejection returns HTTP 400 with this problem code. Rejection of only one target returns HTTP 200 with that target’s \", _jsx(_components.code, {\n children: \"traversal\"\n }), \" set to \", _jsx(_components.code, {\n children: \"failed\"\n }), \" and its error code set to \", _jsx(_components.code, {\n children: \"GREP_PATTERN_TOO_UNSELECTIVE\"\n }), \"; other targets and paging remain usable. Narrow the pattern or target scope.\"]\n }), \"\\n\", _jsx(_components.h2, {\n children: \"Grep error codes\"\n }), \"\\n\", _jsx(_components.p, {\n children: \"Response codes are open: clients must accept unfamiliar codes. Known whole-request failures use the statuses below. Per-target error_code and file diagnostics remain in HTTP 200 partial results and do not change the response status. Unknown GREP_* and MULTI_GREP_* whole-request errors retain the producer code and retryable flag with generic detail: true selects 503, false selects 400; without a flag an upstream 4xx/5xx status is retained, or 400 for an HTTP-success GraphQL error. Non-retryable does not prove caller fault; inspect code and structured evidence. Known user-facing errors use nonempty REST-suitable producer guidance when available; detail wording is not stable. Authentication and HTTP rate-limit policy take precedence.\"\n }), \"\\n\", _jsxs(_components.table, {\n children: [_jsx(_components.thead, {\n children: _jsxs(_components.tr, {\n children: [_jsx(_components.th, {\n children: \"Code\"\n }), _jsx(_components.th, {\n children: \"HTTP status\"\n }), _jsx(_components.th, {\n children: \"Meaning and recovery\"\n })]\n })\n }), _jsxs(_components.tbody, {\n children: [_jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"GREP_PATTERN_TOO_SHORT\"\n })\n }), _jsx(_components.td, {\n children: \"400\"\n }), _jsx(_components.td, {\n children: \"pattern must contain at least one UTF-8 byte.\"\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"GREP_PATTERN_TOO_LONG\"\n })\n }), _jsx(_components.td, {\n children: \"400\"\n }), _jsx(_components.td, {\n children: \"pattern exceeds 200 UTF-8 bytes; shorten it.\"\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"GREP_PATTERN_INVALID\"\n })\n }), _jsx(_components.td, {\n children: \"400\"\n }), _jsx(_components.td, {\n children: \"pattern contains invalid text or NUL bytes.\"\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"GREP_INVALID_REGEX\"\n })\n }), _jsx(_components.td, {\n children: \"400\"\n }), _jsx(_components.td, {\n children: \"pattern is not valid RE2 syntax; correct it or use literal matching.\"\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"GREP_UNSUPPORTED_PATTERN\"\n })\n }), _jsx(_components.td, {\n children: \"400\"\n }), _jsx(_components.td, {\n children: \"pattern uses unsupported regex features; use RE2 syntax or literal matching.\"\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"GREP_PATTERN_TOO_UNSELECTIVE\"\n })\n }), _jsx(_components.td, {\n children: \"400\"\n }), _jsx(_components.td, {\n children: \"pattern is too broad; add literal text or narrow the scope.\"\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"GREP_FILE_TOO_LARGE\"\n })\n }), _jsx(_components.td, {\n children: \"422\"\n }), _jsx(_components.td, {\n children: \"The selected file exceeds the source 5 MB limit.\"\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"GREP_INDEX_ABSENT\"\n })\n }), _jsx(_components.td, {\n children: \"503\"\n }), _jsx(_components.td, {\n children: \"The grep index is absent; retry when retryable is true.\"\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"GREP_INDEX_STALE\"\n })\n }), _jsx(_components.td, {\n children: \"503\"\n }), _jsx(_components.td, {\n children: \"The grep index is stale; retry when retryable is true.\"\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"GREP_INDEX_INCOMPLETE\"\n })\n }), _jsx(_components.td, {\n children: \"503\"\n }), _jsx(_components.td, {\n children: \"The grep index is incomplete; retry when retryable is true.\"\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"GREP_CAS_REQUIRED\"\n })\n }), _jsx(_components.td, {\n children: \"503\"\n }), _jsx(_components.td, {\n children: \"The index lacks required content-addressed metadata; retry when retryable is true.\"\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"GREP_SCOPE_REQUIRED\"\n })\n }), _jsx(_components.td, {\n children: \"400\"\n }), _jsx(_components.td, {\n children: \"The source requires a more specific target or path scope.\"\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"GREP_SELECTOR_INVALID\"\n })\n }), _jsx(_components.td, {\n children: \"400\"\n }), _jsx(_components.td, {\n children: \"A path selector is invalid; use a documented target-relative selector.\"\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"GREP_CURSOR_INVALID\"\n })\n }), _jsx(_components.td, {\n children: \"400\"\n }), _jsx(_components.td, {\n children: \"cursor is invalid for this request; start again without it.\"\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"GREP_CONTEXT_TOO_LARGE\"\n })\n }), _jsx(_components.td, {\n children: \"400\"\n }), _jsx(_components.td, {\n children: \"context_lines_before or context_lines_after exceeds 10.\"\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"GREP_CONTEXT_NEGATIVE\"\n })\n }), _jsx(_components.td, {\n children: \"400\"\n }), _jsx(_components.td, {\n children: \"context_lines_before and context_lines_after must be nonnegative.\"\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"GREP_MAX_MATCHES_TOO_LARGE\"\n })\n }), _jsx(_components.td, {\n children: \"400\"\n }), _jsx(_components.td, {\n children: \"max_matches exceeds 1000; lower the limit and paginate.\"\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"GREP_MAX_MATCHES_INVALID\"\n })\n }), _jsx(_components.td, {\n children: \"400\"\n }), _jsx(_components.td, {\n children: \"max_matches must be a positive integer.\"\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"GREP_SERVICE_UNAVAILABLE\"\n })\n }), _jsx(_components.td, {\n children: \"503\"\n }), _jsx(_components.td, {\n children: \"The grep service is unavailable; retry when retryable is true.\"\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"GREP_TIMEOUT\"\n })\n }), _jsx(_components.td, {\n children: \"504\"\n }), _jsx(_components.td, {\n children: \"The grep deadline expired; narrow the scope or retry. Preparation may continue.\"\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"GREP_INVALID_PATH_SELECTOR\"\n })\n }), _jsx(_components.td, {\n children: \"400\"\n }), _jsx(_components.td, {\n children: \"A path selector is invalid; use a documented target-relative selector.\"\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"MULTI_GREP_CURSOR_INVALID\"\n })\n }), _jsx(_components.td, {\n children: \"400\"\n }), _jsx(_components.td, {\n children: \"cursor is invalid for these targets or controls; start again without it.\"\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"MULTI_GREP_CURSOR_EXPIRED\"\n })\n }), _jsx(_components.td, {\n children: \"400\"\n }), _jsx(_components.td, {\n children: \"cursor expired; start again without it. Already returned matches remain usable.\"\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"GREP_BACKEND_ERROR\"\n })\n }), _jsx(_components.td, {\n children: \"502\"\n }), _jsx(_components.td, {\n children: \"The grep backend failed to provide usable evidence.\"\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"GREP_FAILED\"\n })\n }), _jsx(_components.td, {\n children: \"502\"\n }), _jsx(_components.td, {\n children: \"The grep operation failed to provide usable evidence.\"\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"GREP_BACKEND_PROTOCOL_ERROR\"\n })\n }), _jsx(_components.td, {\n children: \"503\"\n }), _jsx(_components.td, {\n children: \"The grep backend returned an invalid protocol result; retry when retryable is true.\"\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"GREP_FILE_INDEX_INCOMPLETE\"\n })\n }), _jsx(_components.td, {\n children: \"503\"\n }), _jsx(_components.td, {\n children: \"The file index is incomplete; retry when retryable is true.\"\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"GREP_FILE_INDEX_UNREADABLE\"\n })\n }), _jsx(_components.td, {\n children: \"503\"\n }), _jsx(_components.td, {\n children: \"The file index cannot be read; retry when retryable is true.\"\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"GREP_PATH_EXCLUDED\"\n })\n }), _jsx(_components.td, {\n children: \"422\"\n }), _jsx(_components.td, {\n children: \"The source excludes the selected path from its searchable index.\"\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"GREP_PATH_NOT_INDEXED\"\n })\n }), _jsx(_components.td, {\n children: \"404\"\n }), _jsx(_components.td, {\n children: \"The selected path is not present in the searchable index.\"\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"GREP_TARGET_PREPARATION_REQUIRED\"\n })\n }), _jsx(_components.td, {\n children: \"409\"\n }), _jsx(_components.td, {\n children: \"Content needs preparation or a different target; inspect target_issues and retryability.\"\n })]\n })]\n })]\n })]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\nfunction _missingMdxReference(id, component) {\n throw new Error(\"Expected \" + (component ? \"component\" : \"object\") + \" `\" + id + \"` to be defined: you likely forgot to import, pass, or provide it.\");\n}\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Find regex or literal matches across source and documentation","description":"Find text in packages, repositories, and hosted documentation. Use this endpoint for exact text or regular-expression matches. Use list to find paths, search to discover topics, and read to retrieve more context for a match.\n\n## Find text\n\nSend a JSON body to `POST /v1/grep`. This request searches an Express package and an explicit documentation site for literal text:\n\n```json\n{\n \"targets\":[{\"target\":\"npm:express@5.2.1\"},{\"target\":\"site:expressjs.com/en\"}],\n \"pattern\":\"Router\",\n \"pattern_type\":\"literal\",\n \"max_matches\":10\n}\n```\n\nPackage targets search that package's files and its selected hosted documentation. Repository targets such as `github:expressjs/express` search the repository snapshot. A `site:` target selects hosted pages directly.\n\nMatching is case-sensitive by default. Set `ignore_case: true` to ignore case, and `context_lines_before` or `context_lines_after` to include up to 10 surrounding lines on each side. Both context options default to 0. The default `pattern_type` is `regex`, using RE2 syntax; lookaround and backreferences are not supported. Include literal text in broad regex patterns, or choose `literal` for plain text. Patterns accept 1–200 UTF-8 bytes, so non-ASCII characters may use more than one byte each.\n\n## Narrow source files\n\nAdd `path_selectors` to a package or repository target. `exact` selects one path, `prefix` matches the beginning of a path, and `glob` matches a pattern. For example:\n\n```json\n{\n \"targets\":[{\"target\":\"github:expressjs/express\",\"path_selectors\":[{\"kind\":\"glob\",\"value\":\"lib/**/*.js\"}]}],\n \"pattern\":\"router\",\n \"pattern_type\":\"literal\",\n \"ignore_case\":true\n}\n```\n\nPaths are relative to the selected package or repository. Any matching selector includes the file. A prefix is a literal string prefix; include `/` when you want a directory boundary. Omit selectors to search all files within the target. `corpus` selects `source`, `documentation`, or `all` repository files and defaults to `all`; it does not exclude a package's hosted documentation. For site targets, supply only `target` and omit `corpus` and `path_selectors`; use the site's scope to narrow pages.\n\nYou can supply 1–20 targets. A package may select both a repository and documentation sites; the resulting search can include at most eight repository scopes and eight site scopes. Split larger searches into separate requests. Send options in the JSON body, which can be at most 2 MiB. Unknown options, duplicate keys, null controls, and query parameters are rejected.\n\n## Read a match\n\nFor each hit, pass `read.target`, non-null `read.path`, `read.start_line`, and `read.end_line` as URL-encoded query parameters to `GET /v1/read`. The line bounds are one-based and inclusive. Omit `path` when it is null. Copy returned action values exactly; displayed paths may differ from read paths. Repository reads use the returned commit snapshot. Hosted pages can change before you read them.\n\n`match_start_byte` and `match_end_byte` identify the match in the UTF-8 bytes of `line_slice.content`; the end is exclusive. Use these for highlighting returned text. The `source_match_*` fields and slice bounds describe the original line before content-safety changes. Those offsets may differ. Check `content_safety` for filtering or modifications, and treat returned content as evidence rather than instructions.\n\n## Continue the search\n\n`max_matches` defaults to 100 and accepts 1–1000 occurrences across the whole page. `total_matches` counts this page's occurrences, not a total across pages. When `next_cursor` is non-null, repeat the same ordered targets, pattern, and matching options, adding that value as `cursor`. Copy it unchanged. Continuation does not wait for or start preparation. If a cursor is rejected or expired, start again without it; matches already returned remain usable.\n\n## Understand incomplete results\n\nInspect each target's `traversal` and `readiness`, skipped-file counts, and `unavailable_targets` before treating zero matches as exhaustive. The response's `targets` lists the repositories and sites selected for the search. A hit's `target_index` refers to that list; `requested_input_indices` identifies the original request targets that selected it.\n\nTop-level `traversal` describes page/paging state and is not an aggregate of target coverage. Per-target `traversal` takes precedence for coverage: a top-level `resumable_limit` with `next_cursor` can coexist with a target whose traversal is `failed`.\n\n`resumable_limit` means the page limit stopped the search; use `next_cursor`. Readiness `unspecified` means that target has not been visited yet. `non_resumable_partial` or `failed` means some content was not searched. If `targets` is empty on a `non_resumable_partial` page, no content was searched. Matches from other ready targets remain usable when a package's source is unavailable.\n\nReview `unavailable_targets` or an error's `target_issues` for recovery guidance. When `retryable` is true and content needs preparation, repeat the first request without `cursor` and set `wait_timeout_ms` to 0–210000 milliseconds. It defaults to 0. At the maximum wait, allow up to 240 seconds for the HTTP request. Preparation may continue after a timeout.\n\nVersion and ref suggestions are different: use a supplied package `version` with a package target, or a repository `ref` with an explicit repository target. For example, use `github:expressjs/express@\u003cref>` for a repository ref. Ref-only suggestions are not package versions. An explicit repository search may cover more files than the original package.\n\n`GREP_PATTERN_TOO_UNSELECTIVE` means the pattern is too broad. Whole-request rejection returns HTTP 400 with this problem code. Rejection of only one target returns HTTP 200 with that target's `traversal` set to `failed` and its error code set to `GREP_PATTERN_TOO_UNSELECTIVE`; other targets and paging remain usable. Narrow the pattern or target scope.\n\n\n## Grep error codes\n\nResponse codes are open: clients must accept unfamiliar codes. Known whole-request failures use the statuses below. Per-target error_code and file diagnostics remain in HTTP 200 partial results and do not change the response status. Unknown GREP_* and MULTI_GREP_* whole-request errors retain the producer code and retryable flag with generic detail: true selects 503, false selects 400; without a flag an upstream 4xx/5xx status is retained, or 400 for an HTTP-success GraphQL error. Non-retryable does not prove caller fault; inspect code and structured evidence. Known user-facing errors use nonempty REST-suitable producer guidance when available; detail wording is not stable. Authentication and HTTP rate-limit policy take precedence.\n\n| Code | HTTP status | Meaning and recovery |\n| --- | --- | --- |\n| `GREP_PATTERN_TOO_SHORT` | 400 | pattern must contain at least one UTF-8 byte. |\n| `GREP_PATTERN_TOO_LONG` | 400 | pattern exceeds 200 UTF-8 bytes; shorten it. |\n| `GREP_PATTERN_INVALID` | 400 | pattern contains invalid text or NUL bytes. |\n| `GREP_INVALID_REGEX` | 400 | pattern is not valid RE2 syntax; correct it or use literal matching. |\n| `GREP_UNSUPPORTED_PATTERN` | 400 | pattern uses unsupported regex features; use RE2 syntax or literal matching. |\n| `GREP_PATTERN_TOO_UNSELECTIVE` | 400 | pattern is too broad; add literal text or narrow the scope. |\n| `GREP_FILE_TOO_LARGE` | 422 | The selected file exceeds the source 5 MB limit. |\n| `GREP_INDEX_ABSENT` | 503 | The grep index is absent; retry when retryable is true. |\n| `GREP_INDEX_STALE` | 503 | The grep index is stale; retry when retryable is true. |\n| `GREP_INDEX_INCOMPLETE` | 503 | The grep index is incomplete; retry when retryable is true. |\n| `GREP_CAS_REQUIRED` | 503 | The index lacks required content-addressed metadata; retry when retryable is true. |\n| `GREP_SCOPE_REQUIRED` | 400 | The source requires a more specific target or path scope. |\n| `GREP_SELECTOR_INVALID` | 400 | A path selector is invalid; use a documented target-relative selector. |\n| `GREP_CURSOR_INVALID` | 400 | cursor is invalid for this request; start again without it. |\n| `GREP_CONTEXT_TOO_LARGE` | 400 | context_lines_before or context_lines_after exceeds 10. |\n| `GREP_CONTEXT_NEGATIVE` | 400 | context_lines_before and context_lines_after must be nonnegative. |\n| `GREP_MAX_MATCHES_TOO_LARGE` | 400 | max_matches exceeds 1000; lower the limit and paginate. |\n| `GREP_MAX_MATCHES_INVALID` | 400 | max_matches must be a positive integer. |\n| `GREP_SERVICE_UNAVAILABLE` | 503 | The grep service is unavailable; retry when retryable is true. |\n| `GREP_TIMEOUT` | 504 | The grep deadline expired; narrow the scope or retry. Preparation may continue. |\n| `GREP_INVALID_PATH_SELECTOR` | 400 | A path selector is invalid; use a documented target-relative selector. |\n| `MULTI_GREP_CURSOR_INVALID` | 400 | cursor is invalid for these targets or controls; start again without it. |\n| `MULTI_GREP_CURSOR_EXPIRED` | 400 | cursor expired; start again without it. Already returned matches remain usable. |\n| `GREP_BACKEND_ERROR` | 502 | The grep backend failed to provide usable evidence. |\n| `GREP_FAILED` | 502 | The grep operation failed to provide usable evidence. |\n| `GREP_BACKEND_PROTOCOL_ERROR` | 503 | The grep backend returned an invalid protocol result; retry when retryable is true. |\n| `GREP_FILE_INDEX_INCOMPLETE` | 503 | The file index is incomplete; retry when retryable is true. |\n| `GREP_FILE_INDEX_UNREADABLE` | 503 | The file index cannot be read; retry when retryable is true. |\n| `GREP_PATH_EXCLUDED` | 422 | The source excludes the selected path from its searchable index. |\n| `GREP_PATH_NOT_INDEXED` | 404 | The selected path is not present in the searchable index. |\n| `GREP_TARGET_PREPARATION_REQUIRED` | 409 | Content needs preparation or a different target; inspect target_issues and retryability. |\n","deprecated":null,"version":null,"openapi":"https://api.githits.dev/v1/openapi.json post /v1/grep","href":"/api-reference/v1/grep/find-regex-or-literal-matches-across-source-and-documentation","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"description":"Find text in packages, repositories, and hosted documentation. Use this endpoint for exact text or regular-expression matches. Use list to find paths, search to discover topics, and read to retrieve more context for a match.\n\n## Find text\n\nSend a JSON body to `POST /v1/grep`. This request searches an Express package and an explicit documentation site for literal text:\n\n```json\n{\n \"targets\":[{\"target\":\"npm:express@5.2.1\"},{\"target\":\"site:expressjs.com/en\"}],\n \"pattern\":\"Router\",\n \"pattern_type\":\"literal\",\n \"max_matches\":10\n}\n```\n\nPackage targets search that package's files and its selected hosted documentation. Repository targets such as `github:expressjs/express` search the repository snapshot. A `site:` target selects hosted pages directly.\n\nMatching is case-sensitive by default. Set `ignore_case: true` to ignore case, and `context_lines_before` or `context_lines_after` to include up to 10 surrounding lines on each side. Both context options default to 0. The default `pattern_type` is `regex`, using RE2 syntax; lookaround and backreferences are not supported. Include literal text in broad regex patterns, or choose `literal` for plain text. Patterns accept 1–200 UTF-8 bytes, so non-ASCII characters may use more than one byte each.\n\n## Narrow source files\n\nAdd `path_selectors` to a package or repository target. `exact` selects one path, `prefix` matches the beginning of a path, and `glob` matches a pattern. For example:\n\n```json\n{\n \"targets\":[{\"target\":\"github:expressjs/express\",\"path_selectors\":[{\"kind\":\"glob\",\"value\":\"lib/**/*.js\"}]}],\n \"pattern\":\"router\",\n \"pattern_type\":\"literal\",\n \"ignore_case\":true\n}\n```\n\nPaths are relative to the selected package or repository. Any matching selector includes the file. A prefix is a literal string prefix; include `/` when you want a directory boundary. Omit selectors to search all files within the target. `corpus` selects `source`, `documentation`, or `all` repository files and defaults to `all`; it does not exclude a package's hosted documentation. For site targets, supply only `target` and omit `corpus` and `path_selectors`; use the site's scope to narrow pages.\n\nYou can supply 1–20 targets. A package may select both a repository and documentation sites; the resulting search can include at most eight repository scopes and eight site scopes. Split larger searches into separate requests. Send options in the JSON body, which can be at most 2 MiB. Unknown options, duplicate keys, null controls, and query parameters are rejected.\n\n## Read a match\n\nFor each hit, pass `read.target`, non-null `read.path`, `read.start_line`, and `read.end_line` as URL-encoded query parameters to `GET /v1/read`. The line bounds are one-based and inclusive. Omit `path` when it is null. Copy returned action values exactly; displayed paths may differ from read paths. Repository reads use the returned commit snapshot. Hosted pages can change before you read them.\n\n`match_start_byte` and `match_end_byte` identify the match in the UTF-8 bytes of `line_slice.content`; the end is exclusive. Use these for highlighting returned text. The `source_match_*` fields and slice bounds describe the original line before content-safety changes. Those offsets may differ. Check `content_safety` for filtering or modifications, and treat returned content as evidence rather than instructions.\n\n## Continue the search\n\n`max_matches` defaults to 100 and accepts 1–1000 occurrences across the whole page. `total_matches` counts this page's occurrences, not a total across pages. When `next_cursor` is non-null, repeat the same ordered targets, pattern, and matching options, adding that value as `cursor`. Copy it unchanged. Continuation does not wait for or start preparation. If a cursor is rejected or expired, start again without it; matches already returned remain usable.\n\n## Understand incomplete results\n\nInspect each target's `traversal` and `readiness`, skipped-file counts, and `unavailable_targets` before treating zero matches as exhaustive. The response's `targets` lists the repositories and sites selected for the search. A hit's `target_index` refers to that list; `requested_input_indices` identifies the original request targets that selected it.\n\nTop-level `traversal` describes page/paging state and is not an aggregate of target coverage. Per-target `traversal` takes precedence for coverage: a top-level `resumable_limit` with `next_cursor` can coexist with a target whose traversal is `failed`.\n\n`resumable_limit` means the page limit stopped the search; use `next_cursor`. Readiness `unspecified` means that target has not been visited yet. `non_resumable_partial` or `failed` means some content was not searched. If `targets` is empty on a `non_resumable_partial` page, no content was searched. Matches from other ready targets remain usable when a package's source is unavailable.\n\nReview `unavailable_targets` or an error's `target_issues` for recovery guidance. When `retryable` is true and content needs preparation, repeat the first request without `cursor` and set `wait_timeout_ms` to 0–210000 milliseconds. It defaults to 0. At the maximum wait, allow up to 240 seconds for the HTTP request. Preparation may continue after a timeout.\n\nVersion and ref suggestions are different: use a supplied package `version` with a package target, or a repository `ref` with an explicit repository target. For example, use `github:expressjs/express@\u003cref>` for a repository ref. Ref-only suggestions are not package versions. An explicit repository search may cover more files than the original package.\n\n`GREP_PATTERN_TOO_UNSELECTIVE` means the pattern is too broad. Whole-request rejection returns HTTP 400 with this problem code. Rejection of only one target returns HTTP 200 with that target's `traversal` set to `failed` and its error code set to `GREP_PATTERN_TOO_UNSELECTIVE`; other targets and paging remain usable. Narrow the pattern or target scope.\n\n\n## Grep error codes\n\nResponse codes are open: clients must accept unfamiliar codes. Known whole-request failures use the statuses below. Per-target error_code and file diagnostics remain in HTTP 200 partial results and do not change the response status. Unknown GREP_* and MULTI_GREP_* whole-request errors retain the producer code and retryable flag with generic detail: true selects 503, false selects 400; without a flag an upstream 4xx/5xx status is retained, or 400 for an HTTP-success GraphQL error. Non-retryable does not prove caller fault; inspect code and structured evidence. Known user-facing errors use nonempty REST-suitable producer guidance when available; detail wording is not stable. Authentication and HTTP rate-limit policy take precedence.\n\n| Code | HTTP status | Meaning and recovery |\n| --- | --- | --- |\n| `GREP_PATTERN_TOO_SHORT` | 400 | pattern must contain at least one UTF-8 byte. |\n| `GREP_PATTERN_TOO_LONG` | 400 | pattern exceeds 200 UTF-8 bytes; shorten it. |\n| `GREP_PATTERN_INVALID` | 400 | pattern contains invalid text or NUL bytes. |\n| `GREP_INVALID_REGEX` | 400 | pattern is not valid RE2 syntax; correct it or use literal matching. |\n| `GREP_UNSUPPORTED_PATTERN` | 400 | pattern uses unsupported regex features; use RE2 syntax or literal matching. |\n| `GREP_PATTERN_TOO_UNSELECTIVE` | 400 | pattern is too broad; add literal text or narrow the scope. |\n| `GREP_FILE_TOO_LARGE` | 422 | The selected file exceeds the source 5 MB limit. |\n| `GREP_INDEX_ABSENT` | 503 | The grep index is absent; retry when retryable is true. |\n| `GREP_INDEX_STALE` | 503 | The grep index is stale; retry when retryable is true. |\n| `GREP_INDEX_INCOMPLETE` | 503 | The grep index is incomplete; retry when retryable is true. |\n| `GREP_CAS_REQUIRED` | 503 | The index lacks required content-addressed metadata; retry when retryable is true. |\n| `GREP_SCOPE_REQUIRED` | 400 | The source requires a more specific target or path scope. |\n| `GREP_SELECTOR_INVALID` | 400 | A path selector is invalid; use a documented target-relative selector. |\n| `GREP_CURSOR_INVALID` | 400 | cursor is invalid for this request; start again without it. |\n| `GREP_CONTEXT_TOO_LARGE` | 400 | context_lines_before or context_lines_after exceeds 10. |\n| `GREP_CONTEXT_NEGATIVE` | 400 | context_lines_before and context_lines_after must be nonnegative. |\n| `GREP_MAX_MATCHES_TOO_LARGE` | 400 | max_matches exceeds 1000; lower the limit and paginate. |\n| `GREP_MAX_MATCHES_INVALID` | 400 | max_matches must be a positive integer. |\n| `GREP_SERVICE_UNAVAILABLE` | 503 | The grep service is unavailable; retry when retryable is true. |\n| `GREP_TIMEOUT` | 504 | The grep deadline expired; narrow the scope or retry. Preparation may continue. |\n| `GREP_INVALID_PATH_SELECTOR` | 400 | A path selector is invalid; use a documented target-relative selector. |\n| `MULTI_GREP_CURSOR_INVALID` | 400 | cursor is invalid for these targets or controls; start again without it. |\n| `MULTI_GREP_CURSOR_EXPIRED` | 400 | cursor expired; start again without it. Already returned matches remain usable. |\n| `GREP_BACKEND_ERROR` | 502 | The grep backend failed to provide usable evidence. |\n| `GREP_FAILED` | 502 | The grep operation failed to provide usable evidence. |\n| `GREP_BACKEND_PROTOCOL_ERROR` | 503 | The grep backend returned an invalid protocol result; retry when retryable is true. |\n| `GREP_FILE_INDEX_INCOMPLETE` | 503 | The file index is incomplete; retry when retryable is true. |\n| `GREP_FILE_INDEX_UNREADABLE` | 503 | The file index cannot be read; retry when retryable is true. |\n| `GREP_PATH_EXCLUDED` | 422 | The source excludes the selected path from its searchable index. |\n| `GREP_PATH_NOT_INDEXED` | 404 | The selected path is not present in the searchable index. |\n| `GREP_TARGET_PREPARATION_REQUIRED` | 409 | Content needs preparation or a different target; inspect target_issues and retryability. |\n","operationId":"post_grep","parameters":["7547c4f1-12f0-424b-8d98-5031525b6787","81ac8fa6-fcfe-4e76-8873-f4063bc944b0","72a15549-a891-4726-9e74-79b311effeaa","045de523-64a8-4b28-833c-100015f58b3d"],"requestBody":"13679159-c5a6-457c-994f-a16ea84a6e0d","responses":{"200":"fcb10b9e-9b89-491c-bcec-2e969b6a6cba","400":"4faa8ffb-3154-4a4d-9975-e4e385697524","401":"3f9506c8-5cca-4e9e-852c-252ad317d934","403":"6eec04ff-42ab-4ffd-9319-0beeb795f6f6","404":"9b585525-13d2-44d0-8b8b-2975098d4618","405":"17c38781-6adb-46ca-941a-8684517842e6","409":"daa84783-28cb-42f0-be23-30d31e72752a","422":"b4a36ce6-7b7e-444e-a225-e5b6d59f773f","429":"82f52506-2f42-4dcd-a609-ef64e0e7f89f","500":"108c82ad-15a3-42af-871c-9163d10efd99","502":"224ae30f-4637-42d5-9eac-47a383d57833","503":"0ab8150a-b017-4e76-8bd7-8daf69344a9e","504":"158f9b15-fc9c-4f7b-9d45-c9669fec6cb3"},"security":["c1fad00d-0570-41c7-88e3-28015b5cf6bd"],"summary":"Find regex or literal matches across source and documentation","tags":["Grep"],"x-codeSamples":[{"label":"Find literal text in source and hosted docs","lang":"HTTP","source":"POST /v1/grep HTTP/1.1\nHost: api.githits.dev\nAuthorization: Bearer \u003ctoken>\nContent-Type: application/json\n\n{\"targets\":[{\"target\":\"npm:express@5.2.1\"},{\"target\":\"site:expressjs.com/en\"}],\"pattern\":\"Router\",\"pattern_type\":\"literal\",\"max_matches\":10}"}],"x-githits-cost":1,"x-githits-mcp-tool":"grep","method":"post","type":"path","servers":["1a2882b3-fedc-4756-bc8a-01bc0f383fda"],"path":"/v1/grep","baseUrlOptions":["https://api.githits.dev"],"title":"Find regex or literal matches across source and documentation","codeSamples":[{"label":"Find literal text in source and hosted docs","lang":"HTTP","source":"POST /v1/grep HTTP/1.1\nHost: api.githits.dev\nAuthorization: Bearer \u003ctoken>\nContent-Type: application/json\n\n{\"targets\":[{\"target\":\"npm:express@5.2.1\"},{\"target\":\"site:expressjs.com/en\"}],\"pattern\":\"Router\",\"pattern_type\":\"literal\",\"max_matches\":10}"}],"requiredOnlyExamples":false,"requestExampleType":"codeSamples","responseExampleType":"generated","disableProxy":true},"dependencies":{"parameters":{"7547c4f1-12f0-424b-8d98-5031525b6787":{"description":"Optional client attribution: trimmed printable ASCII, at most 80 bytes. Invalid optional values are dropped.","in":"header","name":"X-GitHits-Client-Name","required":false,"schema":{"type":"string","isRequired":false,"description":"Optional client attribution: trimmed printable ASCII, at most 80 bytes. Invalid optional values are dropped.","uniqueKey":"","typeLabel":"string"}},"81ac8fa6-fcfe-4e76-8873-f4063bc944b0":{"description":"Optional client-version attribution: trimmed printable ASCII, at most 80 bytes. Invalid optional values are dropped.","in":"header","name":"X-GitHits-Client-Version","required":false,"schema":{"type":"string","isRequired":false,"description":"Optional client-version attribution: trimmed printable ASCII, at most 80 bytes. Invalid optional values are dropped.","uniqueKey":"","typeLabel":"string"}},"72a15549-a891-4726-9e74-79b311effeaa":{"description":"Optional agent attribution: trimmed printable ASCII, at most 160 bytes. Invalid optional values are dropped.","in":"header","name":"X-GitHits-Agent","required":false,"schema":{"type":"string","isRequired":false,"description":"Optional agent attribution: trimmed printable ASCII, at most 160 bytes. Invalid optional values are dropped.","uniqueKey":"","typeLabel":"string"}},"045de523-64a8-4b28-833c-100015f58b3d":{"description":"Optional caller-defined session ID: one to 64 ASCII letters, digits, underscores or hyphens, preserved exactly. Supply the header at most once. Invalid supplied IDs return 400 INVALID_SESSION_ID; no session is created.","in":"header","name":"X-GitHits-Session-ID","required":false,"schema":{"maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9_-]{1,64}$","type":"string","isRequired":false,"description":"Optional caller-defined session ID: one to 64 ASCII letters, digits, underscores or hyphens, preserved exactly. Supply the header at most once. Invalid supplied IDs return 400 INVALID_SESSION_ID; no session is created.","uniqueKey":"","typeLabel":"string"}}},"requestBody":{"content":{"application/json":{"examples":{"continuation":{"title":"continuation","value":{"cursor":"opaque-cursor","max_matches":1,"pattern":"Router","pattern_type":"literal","targets":[{"target":"site:expressjs.com/en"}]}},"literal_context":{"title":"literal_context","value":{"context_lines_after":2,"context_lines_before":2,"ignore_case":true,"pattern":"router","pattern_type":"literal","targets":[{"path_selectors":[{"kind":"glob","value":"lib/**/*.js"}],"target":"github:expressjs/express"}]}},"mixed":{"title":"mixed","value":{"pattern":"Router","targets":[{"target":"npm:express@5.2.1"},{"target":"site:expressjs.com/en"}]}}},"schema":{"additionalProperties":false,"description":"One bounded grep page. Unknown, duplicate and null controls are rejected.","properties":{"pattern":{"description":"Text or regex to match, 1–200 UTF-8 bytes, without NUL. Whitespace is part of the pattern. Non-ASCII characters may occupy more than one byte.","maxLength":200,"minLength":1,"type":"string","isRequired":true,"uniqueKey":"pattern","typeLabel":"string"},"targets":{"description":"Targets to search, in order; 1 through 20. A package can select both repository files and hosted docs. The combined search supports at most eight repository scopes and eight site scopes; split larger searches into separate requests.","items":{"additionalProperties":false,"description":"One ordered package, repository, or explicit site target.","properties":{"target":{"description":"Package, repository, or documentation site, such as npm:express@5.2.1, github:expressjs/express, or site:expressjs.com/en.","minLength":1,"type":"string","isRequired":true,"uniqueKey":"targets.items.[INDEX].target","typeLabel":"string"},"corpus":{"type":"string","description":"Source-only corpus, default all. Omit for site targets.","default":"all","enum":["source","documentation","all"],"uniqueKey":"targets.items.[INDEX].corpus","typeLabel":"enum\u003cstring>"},"path_selectors":{"description":"Source-only selector union; at most 1000. Empty or omitted means no filter.","items":{"additionalProperties":false,"description":"One path filter for a package or repository.","properties":{"kind":{"description":"How to match value. A prefix is a literal string prefix; include / to select a directory boundary. A glob determines its own depth.","enum":["exact","prefix","glob"],"type":"string","isRequired":true,"uniqueKey":"targets.items.[INDEX].path_selectors.items.[INDEX].kind","typeLabel":"enum\u003cstring>"},"value":{"description":"Path or pattern relative to the package or repository. Must not be blank or contain NUL.","minLength":1,"type":"string","isRequired":true,"uniqueKey":"targets.items.[INDEX].path_selectors.items.[INDEX].value","typeLabel":"string"}},"required":["kind","value"],"type":"object","uniqueKey":"targets.items.[INDEX].path_selectors.items.[INDEX]","typeLabel":"object"},"maxItems":1000,"type":"array","uniqueKey":"targets.items.[INDEX].path_selectors","typeLabel":"object[]"}},"required":["target"],"type":"object","uniqueKey":"targets.items.[INDEX]","typeLabel":"object"},"maxItems":20,"minItems":1,"type":"array","isRequired":true,"uniqueKey":"targets","typeLabel":"object[]"},"context_lines_after":{"default":0,"description":"Independent following context count, 0 through 10; default 0.","format":"int32","maximum":10,"minimum":0,"type":"integer","uniqueKey":"context_lines_after","typeLabel":"integer\u003cint32>"},"context_lines_before":{"default":0,"description":"Independent preceding context count, 0 through 10; default 0.","format":"int32","maximum":10,"minimum":0,"type":"integer","uniqueKey":"context_lines_before","typeLabel":"integer\u003cint32>"},"cursor":{"description":"Opaque continuation; repeat identical targets in the same order and matching controls. Blank starts page one.","type":"string","uniqueKey":"cursor","typeLabel":"string"},"ignore_case":{"default":false,"description":"Whether to ignore case using Unicode case folding; default false (case-sensitive).","type":"boolean","uniqueKey":"ignore_case","typeLabel":"boolean"},"max_matches":{"default":100,"description":"Page-wide occurrence budget, 1 through 1000, default 100.","format":"int32","maximum":1000,"minimum":1,"type":"integer","uniqueKey":"max_matches","typeLabel":"integer\u003cint32>"},"pattern_type":{"type":"string","description":"Default regex uses RE2 with a literal anchor; set literal for plain text.","default":"regex","enum":["regex","literal"],"uniqueKey":"pattern_type","typeLabel":"enum\u003cstring>"},"wait_timeout_ms":{"default":0,"description":"First-page preparation wait, 0 through 210000 ms, default 0. Continuation never waits. Timeout does not stop preparation.","format":"int32","maximum":210000,"minimum":0,"type":"integer","uniqueKey":"wait_timeout_ms","typeLabel":"integer\u003cint32>"}},"required":["targets","pattern"],"type":"object","uniqueKey":"","typeLabel":"object"},"exampleType":"examples"}},"required":true,"exampleType":"examples"},"responses":{"fcb10b9e-9b89-491c-bcec-2e969b6a6cba":{"content":{"application/json":{"examples":{"empty_partial":{"title":"empty_partial","summary":"No content searched; retry first-page preparation when appropriate","value":{"hits":[],"next_cursor":null,"targets":[],"total_matches":0,"traversal":"non_resumable_partial","unavailable_targets":[{"available_refs":null,"available_versions":null,"input_index":0,"message":null,"progress_ref":"opaque-progress","reason":"documentation_publishing","repo_url":null,"requested_version":null,"retryable":true,"suggested_refs":null,"suggested_site_targets":[],"target":"npm:express@5.2.1"}]}},"mixed":{"title":"mixed","summary":"Repository and site matches linked to the requested targets","value":{"hits":[{"commit_sha":"0123456789abcdef0123456789abcdef01234567","content_safety":{"filtered":false,"modifications":[]},"context_after_slices":[],"context_before_slices":[],"file_path":"application.js","kind":"repository","line":16,"line_content":"var Router = require(\"router\");","line_slice":{"content":"var Router = require(\"router\");","end_byte":31,"original_line_bytes":31,"start_byte":0},"match_end_byte":10,"match_start_byte":4,"read":{"end_line":16,"path":"lib/application.js","start_line":16,"target":"github:expressjs/express@0123456789abcdef0123456789abcdef01234567"},"repo_url":"https://github.com/expressjs/express","repository_file_path":"lib/application.js","source_match_end_byte":10,"source_match_start_byte":4,"target_index":0},{"content_safety":{"filtered":false,"modifications":[]},"context_after_slices":[],"context_before_slices":[],"kind":"site","line":3,"line_content":"Router handles routes.","line_slice":{"content":"Router handles routes.","end_byte":22,"original_line_bytes":22,"start_byte":0},"match_end_byte":6,"match_start_byte":0,"page_url":"https://expressjs.com/en/guide/routing.html","read":{"end_line":3,"path":null,"start_line":3,"target":"https://expressjs.com/en/guide/routing.html"},"source_match_end_byte":6,"source_match_start_byte":0,"target_index":1}],"next_cursor":null,"targets":[{"binary_files_skipped":0,"canonical_site":null,"commit_sha":"0123456789abcdef0123456789abcdef01234567","corpus":"all","error_code":null,"file_issues":[],"file_issues_omitted":0,"files_in_scope":1,"files_scanned":1,"files_too_large_skipped":0,"kind":"repository","public_message":null,"readiness":"current","repo_url":"https://github.com/expressjs/express","requested_input_indices":[0],"requested_ref":"v5.2.1","retryable":false,"target":"npm:express@5.2.1","target_index":0,"traversal":"complete","url_prefixes":[]},{"binary_files_skipped":null,"canonical_site":"https://expressjs.com/en/","commit_sha":null,"corpus":null,"error_code":null,"file_issues":null,"file_issues_omitted":null,"files_in_scope":null,"files_scanned":null,"files_too_large_skipped":null,"kind":"site","public_message":null,"readiness":"current","repo_url":null,"requested_input_indices":[0,1],"requested_ref":null,"retryable":false,"target":"site:expressjs.com/en","target_index":1,"traversal":"complete","url_prefixes":["https://expressjs.com/en/"]}],"total_matches":2,"traversal":"complete","unavailable_targets":[]}},"site":{"title":"site","summary":"Documentation match with an action to read the page","value":{"hits":[{"content_safety":{"filtered":false,"modifications":[]},"context_after_slices":[],"context_before_slices":[],"kind":"site","line":3,"line_content":"Router handles routes.","line_slice":{"content":"Router handles routes.","end_byte":22,"original_line_bytes":22,"start_byte":0},"match_end_byte":6,"match_start_byte":0,"page_url":"https://expressjs.com/en/guide/routing.html","read":{"end_line":3,"path":null,"start_line":3,"target":"https://expressjs.com/en/guide/routing.html"},"source_match_end_byte":6,"source_match_start_byte":0,"target_index":0}],"next_cursor":null,"targets":[{"binary_files_skipped":null,"canonical_site":"https://expressjs.com/en/","commit_sha":null,"corpus":null,"error_code":null,"file_issues":null,"file_issues_omitted":null,"files_in_scope":null,"files_scanned":null,"files_too_large_skipped":null,"kind":"site","public_message":null,"readiness":"current","repo_url":null,"requested_input_indices":[0],"requested_ref":null,"retryable":false,"target":"site:expressjs.com/en","target_index":0,"traversal":"complete","url_prefixes":["https://expressjs.com/en/"]}],"total_matches":1,"traversal":"complete","unavailable_targets":[]}},"source":{"title":"source","summary":"Source match with an action to read the same commit","value":{"hits":[{"commit_sha":"0123456789abcdef0123456789abcdef01234567","content_safety":{"filtered":false,"modifications":[]},"context_after_slices":[],"context_before_slices":[],"file_path":"application.js","kind":"repository","line":16,"line_content":"var Router = require(\"router\");","line_slice":{"content":"var Router = require(\"router\");","end_byte":31,"original_line_bytes":31,"start_byte":0},"match_end_byte":10,"match_start_byte":4,"read":{"end_line":16,"path":"lib/application.js","start_line":16,"target":"github:expressjs/express@0123456789abcdef0123456789abcdef01234567"},"repo_url":"https://github.com/expressjs/express","repository_file_path":"lib/application.js","source_match_end_byte":10,"source_match_start_byte":4,"target_index":0}],"next_cursor":null,"targets":[{"binary_files_skipped":0,"canonical_site":null,"commit_sha":"0123456789abcdef0123456789abcdef01234567","corpus":"all","error_code":null,"file_issues":[],"file_issues_omitted":0,"files_in_scope":1,"files_scanned":1,"files_too_large_skipped":0,"kind":"repository","public_message":null,"readiness":"current","repo_url":"https://github.com/expressjs/express","requested_input_indices":[0],"requested_ref":"v5.2.1","retryable":false,"target":"npm:express@5.2.1","target_index":0,"traversal":"complete","url_prefixes":[]}],"total_matches":1,"traversal":"complete","unavailable_targets":[]}},"source_omission":{"title":"source_omission","summary":"Package source unavailable; documentation matches and retry suggestions remain available","value":{"hits":[{"content_safety":{"filtered":false,"modifications":[]},"context_after_slices":[],"context_before_slices":[],"kind":"site","line":3,"line_content":"Router handles routes.","line_slice":{"content":"Router handles routes.","end_byte":22,"original_line_bytes":22,"start_byte":0},"match_end_byte":6,"match_start_byte":0,"page_url":"https://expressjs.com/en/guide/routing.html","read":{"end_line":3,"path":null,"start_line":3,"target":"https://expressjs.com/en/guide/routing.html"},"source_match_end_byte":6,"source_match_start_byte":0,"target_index":0}],"next_cursor":null,"targets":[{"binary_files_skipped":null,"canonical_site":"https://expressjs.com/en/","commit_sha":null,"corpus":null,"error_code":null,"file_issues":null,"file_issues_omitted":null,"files_in_scope":null,"files_scanned":null,"files_too_large_skipped":null,"kind":"site","public_message":null,"readiness":"current","repo_url":null,"requested_input_indices":[1],"requested_ref":null,"retryable":false,"target":"site:expressjs.com/en","target_index":0,"traversal":"complete","url_prefixes":["https://expressjs.com/en/"]}],"total_matches":1,"traversal":"non_resumable_partial","unavailable_targets":[{"available_refs":[],"available_versions":[{"ref":"v5.2.1","version":"5.2.1"}],"input_index":0,"message":"This package’s source was not searched. Review its source-resolution guidance; matches from other ready scopes remain usable.","progress_ref":null,"reason":"repository_ref_not_found","repo_url":"https://github.com/expressjs/express","requested_version":"5.2.1","retryable":false,"suggested_refs":[{"ref":"main","version":null}],"suggested_site_targets":null,"target":"npm:express@5.2.1"}]}},"unvisited":{"title":"unvisited","summary":"Scope not yet visited; continue with identical controls","value":{"hits":[{"commit_sha":"0123456789abcdef0123456789abcdef01234567","content_safety":{"filtered":false,"modifications":[]},"context_after_slices":[],"context_before_slices":[],"file_path":"application.js","kind":"repository","line":16,"line_content":"var Router = require(\"router\");","line_slice":{"content":"var Router = require(\"router\");","end_byte":31,"original_line_bytes":31,"start_byte":0},"match_end_byte":10,"match_start_byte":4,"read":{"end_line":16,"path":"lib/application.js","start_line":16,"target":"github:expressjs/express@0123456789abcdef0123456789abcdef01234567"},"repo_url":"https://github.com/expressjs/express","repository_file_path":"lib/application.js","source_match_end_byte":10,"source_match_start_byte":4,"target_index":0}],"next_cursor":"opaque-next","targets":[{"binary_files_skipped":0,"canonical_site":null,"commit_sha":"0123456789abcdef0123456789abcdef01234567","corpus":"all","error_code":null,"file_issues":[],"file_issues_omitted":0,"files_in_scope":1,"files_scanned":1,"files_too_large_skipped":0,"kind":"repository","public_message":null,"readiness":"current","repo_url":"https://github.com/expressjs/express","requested_input_indices":[0],"requested_ref":"v5.2.1","retryable":false,"target":"npm:express@5.2.1","target_index":0,"traversal":"complete","url_prefixes":[]},{"binary_files_skipped":null,"canonical_site":"https://expressjs.com/en/","commit_sha":null,"corpus":null,"error_code":null,"file_issues":null,"file_issues_omitted":null,"files_in_scope":null,"files_scanned":null,"files_too_large_skipped":null,"kind":"site","public_message":null,"readiness":"unspecified","repo_url":null,"requested_input_indices":[0,1],"requested_ref":null,"retryable":false,"target":"site:expressjs.com/en","target_index":1,"traversal":"resumable_limit","url_prefixes":["https://expressjs.com/en/"]}],"total_matches":1,"traversal":"resumable_limit","unavailable_targets":[]}},"zero_matches":{"title":"zero_matches","summary":"Search finished with no matches","value":{"hits":[],"next_cursor":null,"targets":[{"binary_files_skipped":0,"canonical_site":null,"commit_sha":"0123456789abcdef0123456789abcdef01234567","corpus":"all","error_code":null,"file_issues":[],"file_issues_omitted":0,"files_in_scope":1,"files_scanned":1,"files_too_large_skipped":0,"kind":"repository","public_message":null,"readiness":"current","repo_url":"https://github.com/expressjs/express","requested_input_indices":[0],"requested_ref":"v5.2.1","retryable":false,"target":"npm:express@5.2.1","target_index":0,"traversal":"complete","url_prefixes":[]}],"total_matches":0,"traversal":"complete","unavailable_targets":[]}}},"schema":{"description":"One page of text matches, with read actions and information about searched or unavailable content.","properties":{"hits":{"description":"Occurrences on this page, tagged as repository or site evidence.","items":{"oneOf":[{"type":"object","description":"A text match in repository files (kind repository) or hosted documentation (kind site).","required":["kind","repo_url","commit_sha","file_path","repository_file_path","target_index","line","line_content","line_slice","context_before_slices","context_after_slices","match_start_byte","match_end_byte","source_match_start_byte","source_match_end_byte","read","content_safety"],"properties":{"content_safety":{"description":"Safety filtering and modifications applied to returned evidence.","properties":{"filtered":{"description":"Whether safety normalization filtered content.","type":"boolean","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.0.content_safety.filtered","typeLabel":"boolean"},"modifications":{"description":"Safety transformations applied to the returned text.","items":{"description":"Content changes applied to remove unsafe links, hidden controls, HTML comments, or images. Response values can evolve: accept values you do not recognise. A value the API does not yet recognise is returned as unknown. Known values include: invisible_controls_stripped, html_comments_stripped, images_replaced, unsafe_links_neutralized, unknown.","type":"string","uniqueKey":"hits.items.[INDEX].oneOf.0.content_safety.modifications.items.[INDEX]","typeLabel":"string"},"type":"array","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.0.content_safety.modifications","typeLabel":"string[]"}},"required":["filtered","modifications"],"type":"object","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.0.content_safety","typeLabel":"object"},"context_after_slices":{"description":"Following normalized lines, bounded by `context_lines_after`.","items":{"description":"Safety-normalized content with original source-line byte bounds.","properties":{"content":{"description":"Safety-normalized display content; its length can differ from the original byte span.","type":"string","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.0.context_after_slices.items.[INDEX].content","typeLabel":"string"},"end_byte":{"description":"Exclusive original byte end, bounded by `original_line_bytes`.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.0.context_after_slices.items.[INDEX].end_byte","typeLabel":"integer\u003cint64>"},"original_line_bytes":{"description":"Original line length in bytes.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.0.context_after_slices.items.[INDEX].original_line_bytes","typeLabel":"integer\u003cint64>"},"start_byte":{"description":"First original byte in the source line; unrelated to normalized content length.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.0.context_after_slices.items.[INDEX].start_byte","typeLabel":"integer\u003cint64>"}},"required":["content","start_byte","end_byte","original_line_bytes"],"type":"object","uniqueKey":"hits.items.[INDEX].oneOf.0.context_after_slices.items.[INDEX]","typeLabel":"object"},"type":"array","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.0.context_after_slices","typeLabel":"object[]"},"context_before_slices":{"description":"Preceding normalized lines, bounded by `context_lines_before`.","items":{"description":"Safety-normalized content with original source-line byte bounds.","properties":{"content":{"description":"Safety-normalized display content; its length can differ from the original byte span.","type":"string","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.0.context_before_slices.items.[INDEX].content","typeLabel":"string"},"end_byte":{"description":"Exclusive original byte end, bounded by `original_line_bytes`.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.0.context_before_slices.items.[INDEX].end_byte","typeLabel":"integer\u003cint64>"},"original_line_bytes":{"description":"Original line length in bytes.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.0.context_before_slices.items.[INDEX].original_line_bytes","typeLabel":"integer\u003cint64>"},"start_byte":{"description":"First original byte in the source line; unrelated to normalized content length.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.0.context_before_slices.items.[INDEX].start_byte","typeLabel":"integer\u003cint64>"}},"required":["content","start_byte","end_byte","original_line_bytes"],"type":"object","uniqueKey":"hits.items.[INDEX].oneOf.0.context_before_slices.items.[INDEX]","typeLabel":"object"},"type":"array","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.0.context_before_slices","typeLabel":"object[]"},"line":{"description":"Positive one-based source line containing the occurrence.","format":"int64","minimum":1,"type":"integer","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.0.line","typeLabel":"integer\u003cint64>"},"line_content":{"description":"Returned match-line text after content-safety changes. Use `line_slice` and `source_match_*` for original byte positions.","type":"string","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.0.line_content","typeLabel":"string"},"line_slice":{"description":"Normalized match-line content with original byte bounds.","properties":{"content":{"description":"Safety-normalized display content; its length can differ from the original byte span.","type":"string","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.0.line_slice.content","typeLabel":"string"},"end_byte":{"description":"Exclusive original byte end, bounded by `original_line_bytes`.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.0.line_slice.end_byte","typeLabel":"integer\u003cint64>"},"original_line_bytes":{"description":"Original line length in bytes.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.0.line_slice.original_line_bytes","typeLabel":"integer\u003cint64>"},"start_byte":{"description":"First original byte in the source line; unrelated to normalized content length.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.0.line_slice.start_byte","typeLabel":"integer\u003cint64>"}},"required":["content","start_byte","end_byte","original_line_bytes"],"type":"object","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.0.line_slice","typeLabel":"object"},"match_end_byte":{"description":"Exclusive end in normalized UTF-8 `line_slice.content`.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.0.match_end_byte","typeLabel":"integer\u003cint64>"},"match_start_byte":{"description":"Zero-based start in normalized UTF-8 `line_slice.content`; zero-width matches are valid.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.0.match_start_byte","typeLabel":"integer\u003cint64>"},"read":{"description":"Exact read action; URL-encode its values and omit a null path.","properties":{"end_line":{"description":"Positive one-based inclusive last line to read.","format":"int64","minimum":1,"type":"integer","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.0.read.end_line","typeLabel":"integer\u003cint64>"},"path":{"oneOf":[{"description":"Exact repository path; null on site hits.","type":"string","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.0.read.path.oneOf.0","typeLabel":"string"},{"description":"Exact repository path; null on site hits.","type":"null","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.0.read.path.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.0.read.path","typeLabel":"string | null"},"start_line":{"description":"Positive one-based inclusive first line to read.","format":"int64","minimum":1,"type":"integer","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.0.read.start_line","typeLabel":"integer\u003cint64>"},"target":{"description":"Target for this content. Copy unchanged when making a follow-up request.","type":"string","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.0.read.target","typeLabel":"string"}},"required":["target","path","start_line","end_line"],"type":"object","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.0.read","typeLabel":"object"},"source_match_end_byte":{"description":"Exclusive match end in the original source line.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.0.source_match_end_byte","typeLabel":"integer\u003cint64>"},"source_match_start_byte":{"description":"Zero-based match start in the original source line.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.0.source_match_start_byte","typeLabel":"integer\u003cint64>"},"target_index":{"description":"Zero-based index into the response targets list; not an index into the request targets.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.0.target_index","typeLabel":"integer\u003cint64>"},"commit_sha":{"description":"Exact served 40-hex snapshot commit.","type":"string","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.0.commit_sha","typeLabel":"string"},"file_path":{"description":"Target-relative display path; use read.path for follow-up reads.","type":"string","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.0.file_path","typeLabel":"string"},"repo_url":{"description":"Credential-free supported repository URL.","type":"string","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.0.repo_url","typeLabel":"string"},"repository_file_path":{"description":"Repository-root source path, distinct from a package-relative display path.","type":"string","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.0.repository_file_path","typeLabel":"string"},"kind":{"enum":["repository"],"type":"string","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.0.kind","typeLabel":"enum\u003cstring>"}},"uniqueKey":"hits.items.[INDEX].oneOf.0","typeLabel":"object"},{"type":"object","description":"A text match in repository files (kind repository) or hosted documentation (kind site).","required":["kind","page_url","target_index","line","line_content","line_slice","context_before_slices","context_after_slices","match_start_byte","match_end_byte","source_match_start_byte","source_match_end_byte","read","content_safety"],"properties":{"content_safety":{"description":"Safety filtering and modifications applied to returned evidence.","properties":{"filtered":{"description":"Whether safety normalization filtered content.","type":"boolean","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.1.content_safety.filtered","typeLabel":"boolean"},"modifications":{"description":"Safety transformations applied to the returned text.","items":{"description":"Content changes applied to remove unsafe links, hidden controls, HTML comments, or images. Response values can evolve: accept values you do not recognise. A value the API does not yet recognise is returned as unknown. Known values include: invisible_controls_stripped, html_comments_stripped, images_replaced, unsafe_links_neutralized, unknown.","type":"string","uniqueKey":"hits.items.[INDEX].oneOf.1.content_safety.modifications.items.[INDEX]","typeLabel":"string"},"type":"array","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.1.content_safety.modifications","typeLabel":"string[]"}},"required":["filtered","modifications"],"type":"object","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.1.content_safety","typeLabel":"object"},"context_after_slices":{"description":"Following normalized lines, bounded by `context_lines_after`.","items":{"description":"Safety-normalized content with original source-line byte bounds.","properties":{"content":{"description":"Safety-normalized display content; its length can differ from the original byte span.","type":"string","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.1.context_after_slices.items.[INDEX].content","typeLabel":"string"},"end_byte":{"description":"Exclusive original byte end, bounded by `original_line_bytes`.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.1.context_after_slices.items.[INDEX].end_byte","typeLabel":"integer\u003cint64>"},"original_line_bytes":{"description":"Original line length in bytes.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.1.context_after_slices.items.[INDEX].original_line_bytes","typeLabel":"integer\u003cint64>"},"start_byte":{"description":"First original byte in the source line; unrelated to normalized content length.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.1.context_after_slices.items.[INDEX].start_byte","typeLabel":"integer\u003cint64>"}},"required":["content","start_byte","end_byte","original_line_bytes"],"type":"object","uniqueKey":"hits.items.[INDEX].oneOf.1.context_after_slices.items.[INDEX]","typeLabel":"object"},"type":"array","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.1.context_after_slices","typeLabel":"object[]"},"context_before_slices":{"description":"Preceding normalized lines, bounded by `context_lines_before`.","items":{"description":"Safety-normalized content with original source-line byte bounds.","properties":{"content":{"description":"Safety-normalized display content; its length can differ from the original byte span.","type":"string","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.1.context_before_slices.items.[INDEX].content","typeLabel":"string"},"end_byte":{"description":"Exclusive original byte end, bounded by `original_line_bytes`.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.1.context_before_slices.items.[INDEX].end_byte","typeLabel":"integer\u003cint64>"},"original_line_bytes":{"description":"Original line length in bytes.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.1.context_before_slices.items.[INDEX].original_line_bytes","typeLabel":"integer\u003cint64>"},"start_byte":{"description":"First original byte in the source line; unrelated to normalized content length.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.1.context_before_slices.items.[INDEX].start_byte","typeLabel":"integer\u003cint64>"}},"required":["content","start_byte","end_byte","original_line_bytes"],"type":"object","uniqueKey":"hits.items.[INDEX].oneOf.1.context_before_slices.items.[INDEX]","typeLabel":"object"},"type":"array","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.1.context_before_slices","typeLabel":"object[]"},"line":{"description":"Positive one-based source line containing the occurrence.","format":"int64","minimum":1,"type":"integer","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.1.line","typeLabel":"integer\u003cint64>"},"line_content":{"description":"Returned match-line text after content-safety changes. Use `line_slice` and `source_match_*` for original byte positions.","type":"string","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.1.line_content","typeLabel":"string"},"line_slice":{"description":"Normalized match-line content with original byte bounds.","properties":{"content":{"description":"Safety-normalized display content; its length can differ from the original byte span.","type":"string","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.1.line_slice.content","typeLabel":"string"},"end_byte":{"description":"Exclusive original byte end, bounded by `original_line_bytes`.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.1.line_slice.end_byte","typeLabel":"integer\u003cint64>"},"original_line_bytes":{"description":"Original line length in bytes.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.1.line_slice.original_line_bytes","typeLabel":"integer\u003cint64>"},"start_byte":{"description":"First original byte in the source line; unrelated to normalized content length.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.1.line_slice.start_byte","typeLabel":"integer\u003cint64>"}},"required":["content","start_byte","end_byte","original_line_bytes"],"type":"object","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.1.line_slice","typeLabel":"object"},"match_end_byte":{"description":"Exclusive end in normalized UTF-8 `line_slice.content`.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.1.match_end_byte","typeLabel":"integer\u003cint64>"},"match_start_byte":{"description":"Zero-based start in normalized UTF-8 `line_slice.content`; zero-width matches are valid.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.1.match_start_byte","typeLabel":"integer\u003cint64>"},"read":{"description":"Exact read action; URL-encode its values and omit a null path.","properties":{"end_line":{"description":"Positive one-based inclusive last line to read.","format":"int64","minimum":1,"type":"integer","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.1.read.end_line","typeLabel":"integer\u003cint64>"},"path":{"oneOf":[{"description":"Exact repository path; null on site hits.","type":"string","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.1.read.path.oneOf.0","typeLabel":"string"},{"description":"Exact repository path; null on site hits.","type":"null","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.1.read.path.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.1.read.path","typeLabel":"string | null"},"start_line":{"description":"Positive one-based inclusive first line to read.","format":"int64","minimum":1,"type":"integer","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.1.read.start_line","typeLabel":"integer\u003cint64>"},"target":{"description":"Target for this content. Copy unchanged when making a follow-up request.","type":"string","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.1.read.target","typeLabel":"string"}},"required":["target","path","start_line","end_line"],"type":"object","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.1.read","typeLabel":"object"},"source_match_end_byte":{"description":"Exclusive match end in the original source line.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.1.source_match_end_byte","typeLabel":"integer\u003cint64>"},"source_match_start_byte":{"description":"Zero-based match start in the original source line.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.1.source_match_start_byte","typeLabel":"integer\u003cint64>"},"target_index":{"description":"Zero-based index into the response targets list; not an index into the request targets.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.1.target_index","typeLabel":"integer\u003cint64>"},"page_url":{"description":"Hosted page URL; use the emitted read action for exact follow-up.","type":"string","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.1.page_url","typeLabel":"string"},"kind":{"enum":["site"],"type":"string","isRequired":true,"uniqueKey":"hits.items.[INDEX].oneOf.1.kind","typeLabel":"enum\u003cstring>"}},"uniqueKey":"hits.items.[INDEX].oneOf.1","typeLabel":"object"}],"uniqueKey":"hits.items.[INDEX]","typeLabel":"object"},"type":"array","isRequired":true,"uniqueKey":"hits","typeLabel":"object[]"},"next_cursor":{"oneOf":[{"description":"Opaque continuation. Repeat identical ordered targets and matching controls.","type":"string","isRequired":true,"uniqueKey":"next_cursor.oneOf.0","typeLabel":"string"},{"description":"Opaque continuation. Repeat identical ordered targets and matching controls.","type":"null","isRequired":true,"uniqueKey":"next_cursor.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"next_cursor","typeLabel":"string | null"},"targets":{"description":"Selected repositories and documentation sites, including those not yet visited. Hits refer to this list using `target_index`.","items":{"description":"Search progress for a selected repository or site, including which request targets selected it.","properties":{"binary_files_skipped":{"oneOf":[{"description":"Skipped binary repository files; check before treating matches as exhaustive.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"targets.items.[INDEX].binary_files_skipped.oneOf.0","typeLabel":"integer\u003cint64>"},{"description":"Skipped binary repository files; check before treating matches as exhaustive.","format":"int64","minimum":0,"type":"null","isRequired":true,"uniqueKey":"targets.items.[INDEX].binary_files_skipped.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"targets.items.[INDEX].binary_files_skipped","typeLabel":"integer\u003cint64> | null"},"canonical_site":{"oneOf":[{"description":"Canonical hosted-site identity, or null for repository scopes.","type":"string","isRequired":true,"uniqueKey":"targets.items.[INDEX].canonical_site.oneOf.0","typeLabel":"string"},{"description":"Canonical hosted-site identity, or null for repository scopes.","type":"null","isRequired":true,"uniqueKey":"targets.items.[INDEX].canonical_site.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"targets.items.[INDEX].canonical_site","typeLabel":"string | null"},"commit_sha":{"oneOf":[{"description":"Exact served 40-hex snapshot commit; null when unavailable.","type":"string","isRequired":true,"uniqueKey":"targets.items.[INDEX].commit_sha.oneOf.0","typeLabel":"string"},{"description":"Exact served 40-hex snapshot commit; null when unavailable.","type":"null","isRequired":true,"uniqueKey":"targets.items.[INDEX].commit_sha.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"targets.items.[INDEX].commit_sha","typeLabel":"string | null"},"corpus":{"oneOf":[{"type":"null","isRequired":true,"uniqueKey":"targets.items.[INDEX].corpus.oneOf.0","typeLabel":"null"},{"type":"string","description":"Repository file selection only; package-selected hosted docs are unaffected.","isRequired":true,"uniqueKey":"targets.items.[INDEX].corpus.oneOf.1","typeLabel":"string"}],"isRequired":true,"uniqueKey":"targets.items.[INDEX].corpus","typeLabel":"null | string"},"error_code":{"oneOf":[{"description":"Scope failure code, or null when no scope error was reported.","type":"string","isRequired":true,"uniqueKey":"targets.items.[INDEX].error_code.oneOf.0","typeLabel":"string"},{"description":"Scope failure code, or null when no scope error was reported.","type":"null","isRequired":true,"uniqueKey":"targets.items.[INDEX].error_code.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"targets.items.[INDEX].error_code","typeLabel":"string | null"},"file_issues":{"oneOf":[{"description":"Selected file-level failure or safety evidence; null is distinct from an empty list.","items":{"description":"An affected source occurrence or aggregate file issue, including safety evidence.","properties":{"code":{"description":"Code identifying a skipped match, file failure, or content-safety issue.","type":"string","isRequired":true,"uniqueKey":"targets.items.[INDEX].file_issues.oneOf.0.items.[INDEX].code","typeLabel":"string"},"content_safety":{"description":"Safety filtering and modifications applied to returned evidence.","properties":{"filtered":{"description":"Whether safety normalization filtered content.","type":"boolean","isRequired":true,"uniqueKey":"targets.items.[INDEX].file_issues.oneOf.0.items.[INDEX].content_safety.filtered","typeLabel":"boolean"},"modifications":{"description":"Safety transformations applied to the returned text.","items":{"description":"Content changes applied to remove unsafe links, hidden controls, HTML comments, or images. Response values can evolve: accept values you do not recognise. A value the API does not yet recognise is returned as unknown. Known values include: invisible_controls_stripped, html_comments_stripped, images_replaced, unsafe_links_neutralized, unknown.","type":"string","uniqueKey":"targets.items.[INDEX].file_issues.oneOf.0.items.[INDEX].content_safety.modifications.items.[INDEX]","typeLabel":"string"},"type":"array","isRequired":true,"uniqueKey":"targets.items.[INDEX].file_issues.oneOf.0.items.[INDEX].content_safety.modifications","typeLabel":"string[]"}},"required":["filtered","modifications"],"type":"object","isRequired":true,"uniqueKey":"targets.items.[INDEX].file_issues.oneOf.0.items.[INDEX].content_safety","typeLabel":"object"},"file_path":{"description":"Safety-normalized target-relative issue path; not an exact read locator.","type":"string","isRequired":true,"uniqueKey":"targets.items.[INDEX].file_issues.oneOf.0.items.[INDEX].file_path","typeLabel":"string"},"line":{"description":"Positive one-based source line containing the occurrence.","format":"int64","minimum":1,"type":"integer","isRequired":true,"uniqueKey":"targets.items.[INDEX].file_issues.oneOf.0.items.[INDEX].line","typeLabel":"integer\u003cint64>"},"line_bytes":{"description":"Original line length in bytes; zero denotes an aggregate file issue.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"targets.items.[INDEX].file_issues.oneOf.0.items.[INDEX].line_bytes","typeLabel":"integer\u003cint64>"},"match_end_byte":{"oneOf":[{"description":"Exclusive omitted occurrence end in the original line; null for aggregate issues.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"targets.items.[INDEX].file_issues.oneOf.0.items.[INDEX].match_end_byte.oneOf.0","typeLabel":"integer\u003cint64>"},{"description":"Exclusive omitted occurrence end in the original line; null for aggregate issues.","format":"int64","minimum":0,"type":"null","isRequired":true,"uniqueKey":"targets.items.[INDEX].file_issues.oneOf.0.items.[INDEX].match_end_byte.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"targets.items.[INDEX].file_issues.oneOf.0.items.[INDEX].match_end_byte","typeLabel":"integer\u003cint64> | null"},"match_start_byte":{"oneOf":[{"description":"Zero-based omitted occurrence start in the original line; null for aggregate issues.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"targets.items.[INDEX].file_issues.oneOf.0.items.[INDEX].match_start_byte.oneOf.0","typeLabel":"integer\u003cint64>"},{"description":"Zero-based omitted occurrence start in the original line; null for aggregate issues.","format":"int64","minimum":0,"type":"null","isRequired":true,"uniqueKey":"targets.items.[INDEX].file_issues.oneOf.0.items.[INDEX].match_start_byte.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"targets.items.[INDEX].file_issues.oneOf.0.items.[INDEX].match_start_byte","typeLabel":"integer\u003cint64> | null"}},"required":["file_path","content_safety","code","line","line_bytes","match_start_byte","match_end_byte"],"type":"object","uniqueKey":"targets.items.[INDEX].file_issues.oneOf.0.items.[INDEX]","typeLabel":"object"},"type":"array","isRequired":true,"uniqueKey":"targets.items.[INDEX].file_issues.oneOf.0","typeLabel":"object[]"},{"description":"Selected file-level failure or safety evidence; null is distinct from an empty list.","items":{"description":"An affected source occurrence or aggregate file issue, including safety evidence.","properties":{"code":{"description":"Code identifying a skipped match, file failure, or content-safety issue.","type":"string"},"content_safety":{"description":"Safety filtering and modifications applied to returned evidence.","properties":{"filtered":{"description":"Whether safety normalization filtered content.","type":"boolean"},"modifications":{"description":"Safety transformations applied to the returned text.","items":{"description":"Content changes applied to remove unsafe links, hidden controls, HTML comments, or images. Response values can evolve: accept values you do not recognise. A value the API does not yet recognise is returned as unknown. Known values include: invisible_controls_stripped, html_comments_stripped, images_replaced, unsafe_links_neutralized, unknown.","type":"string"},"type":"array"}},"required":["filtered","modifications"],"type":"object"},"file_path":{"description":"Safety-normalized target-relative issue path; not an exact read locator.","type":"string"},"line":{"description":"Positive one-based source line containing the occurrence.","format":"int64","minimum":1,"type":"integer"},"line_bytes":{"description":"Original line length in bytes; zero denotes an aggregate file issue.","format":"int64","minimum":0,"type":"integer"},"match_end_byte":{"oneOf":[{"description":"Exclusive omitted occurrence end in the original line; null for aggregate issues.","format":"int64","minimum":0,"type":"integer"},{"description":"Exclusive omitted occurrence end in the original line; null for aggregate issues.","format":"int64","minimum":0,"type":"null"}]},"match_start_byte":{"oneOf":[{"description":"Zero-based omitted occurrence start in the original line; null for aggregate issues.","format":"int64","minimum":0,"type":"integer"},{"description":"Zero-based omitted occurrence start in the original line; null for aggregate issues.","format":"int64","minimum":0,"type":"null"}]}},"required":["file_path","content_safety","code","line","line_bytes","match_start_byte","match_end_byte"],"type":"object"},"type":"null","isRequired":true,"uniqueKey":"targets.items.[INDEX].file_issues.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"targets.items.[INDEX].file_issues","typeLabel":"object[] | null"},"file_issues_omitted":{"oneOf":[{"description":"Number of additional file issues not included in `file_issues`. Zero means none omitted; null means unknown or not applicable.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"targets.items.[INDEX].file_issues_omitted.oneOf.0","typeLabel":"integer\u003cint64>"},{"description":"Number of additional file issues not included in `file_issues`. Zero means none omitted; null means unknown or not applicable.","format":"int64","minimum":0,"type":"null","isRequired":true,"uniqueKey":"targets.items.[INDEX].file_issues_omitted.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"targets.items.[INDEX].file_issues_omitted","typeLabel":"integer\u003cint64> | null"},"files_in_scope":{"oneOf":[{"description":"Repository files selected by scope; null when unavailable or inapplicable.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"targets.items.[INDEX].files_in_scope.oneOf.0","typeLabel":"integer\u003cint64>"},{"description":"Repository files selected by scope; null when unavailable or inapplicable.","format":"int64","minimum":0,"type":"null","isRequired":true,"uniqueKey":"targets.items.[INDEX].files_in_scope.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"targets.items.[INDEX].files_in_scope","typeLabel":"integer\u003cint64> | null"},"files_scanned":{"oneOf":[{"description":"Repository files scanned on this page; null when unavailable or inapplicable.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"targets.items.[INDEX].files_scanned.oneOf.0","typeLabel":"integer\u003cint64>"},{"description":"Repository files scanned on this page; null when unavailable or inapplicable.","format":"int64","minimum":0,"type":"null","isRequired":true,"uniqueKey":"targets.items.[INDEX].files_scanned.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"targets.items.[INDEX].files_scanned","typeLabel":"integer\u003cint64> | null"},"files_too_large_skipped":{"oneOf":[{"description":"Repository files skipped for size; null when unavailable or inapplicable.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"targets.items.[INDEX].files_too_large_skipped.oneOf.0","typeLabel":"integer\u003cint64>"},{"description":"Repository files skipped for size; null when unavailable or inapplicable.","format":"int64","minimum":0,"type":"null","isRequired":true,"uniqueKey":"targets.items.[INDEX].files_too_large_skipped.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"targets.items.[INDEX].files_too_large_skipped","typeLabel":"integer\u003cint64> | null"},"kind":{"description":"Repository or hosted-site scope.","type":"string","isRequired":true,"uniqueKey":"targets.items.[INDEX].kind","typeLabel":"string"},"public_message":{"oneOf":[{"description":"Explanation of this scope's availability or failure, with guidance when available.","type":"string","isRequired":true,"uniqueKey":"targets.items.[INDEX].public_message.oneOf.0","typeLabel":"string"},{"description":"Explanation of this scope's availability or failure, with guidance when available.","type":"null","isRequired":true,"uniqueKey":"targets.items.[INDEX].public_message.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"targets.items.[INDEX].public_message","typeLabel":"string | null"},"readiness":{"description":"Observed artifact readiness; unspecified means this scope was not visited.","type":"string","isRequired":true,"uniqueKey":"targets.items.[INDEX].readiness","typeLabel":"string"},"repo_url":{"oneOf":[{"description":"Credential-free supported repository URL; null when inapplicable.","type":"string","isRequired":true,"uniqueKey":"targets.items.[INDEX].repo_url.oneOf.0","typeLabel":"string"},{"description":"Credential-free supported repository URL; null when inapplicable.","type":"null","isRequired":true,"uniqueKey":"targets.items.[INDEX].repo_url.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"targets.items.[INDEX].repo_url","typeLabel":"string | null"},"requested_input_indices":{"description":"Zero-based indices into the request targets array that selected this scope. Several inputs can select the same scope.","items":{"format":"int64","minimum":0,"type":"integer","uniqueKey":"targets.items.[INDEX].requested_input_indices.items.[INDEX]","typeLabel":"integer\u003cint64>"},"type":"array","isRequired":true,"uniqueKey":"targets.items.[INDEX].requested_input_indices","typeLabel":"integer\u003cint64>[]"},"requested_ref":{"oneOf":[{"description":"Requested repository ref, distinct from the served commit; null on sites.","type":"string","isRequired":true,"uniqueKey":"targets.items.[INDEX].requested_ref.oneOf.0","typeLabel":"string"},{"description":"Requested repository ref, distinct from the served commit; null on sites.","type":"null","isRequired":true,"uniqueKey":"targets.items.[INDEX].requested_ref.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"targets.items.[INDEX].requested_ref","typeLabel":"string | null"},"retryable":{"description":"Whether this condition can be retried. For content needing preparation, start a new request with `wait_timeout_ms`.","type":"boolean","isRequired":true,"uniqueKey":"targets.items.[INDEX].retryable","typeLabel":"boolean"},"target":{"description":"Target for this content. Copy unchanged when making a follow-up request.","type":"string","isRequired":true,"uniqueKey":"targets.items.[INDEX].target","typeLabel":"string"},"target_index":{"description":"Zero-based index into the response targets list; not an index into the request targets.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"targets.items.[INDEX].target_index","typeLabel":"integer\u003cint64>"},"traversal":{"description":"Coverage state; inspect readiness and skipped content before concluding no matches.","type":"string","isRequired":true,"uniqueKey":"targets.items.[INDEX].traversal","typeLabel":"string"},"url_prefixes":{"description":"Selected hosted URL prefixes; empty on repository scopes.","items":{"type":"string","uniqueKey":"targets.items.[INDEX].url_prefixes.items.[INDEX]","typeLabel":"string"},"type":"array","isRequired":true,"uniqueKey":"targets.items.[INDEX].url_prefixes","typeLabel":"string[]"}},"required":["target_index","requested_input_indices","kind","target","traversal","readiness","error_code","retryable","public_message","repo_url","requested_ref","commit_sha","corpus","canonical_site","url_prefixes","files_scanned","files_in_scope","binary_files_skipped","files_too_large_skipped","file_issues","file_issues_omitted"],"type":"object","uniqueKey":"targets.items.[INDEX]","typeLabel":"object"},"type":"array","isRequired":true,"uniqueKey":"targets","typeLabel":"object[]"},"total_matches":{"description":"Number of occurrences returned on this page, not a total across pages.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"total_matches","typeLabel":"integer\u003cint64>"},"traversal":{"description":"Coverage state; inspect readiness and skipped content before concluding no matches.","type":"string","isRequired":true,"uniqueKey":"traversal","typeLabel":"string"},"unavailable_targets":{"description":"Requested inputs omitted from searched scopes, with recovery guidance.","items":{"description":"Requested input omitted from searched scopes with bounded recovery evidence.","properties":{"available_refs":{"oneOf":[{"description":"Available repository ref candidates; ref-only candidates require repository addressing.","items":{"description":"An opaque repository ref and optional package version; never substitute one for the other.","properties":{"ref":{"description":"Opaque repository ref, preserved exactly.","type":"string","isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].available_refs.oneOf.0.items.[INDEX].ref","typeLabel":"string"},"version":{"oneOf":[{"description":"Package version to use in a new package request. When null, use an explicit repository target with ref instead.","type":"string","isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].available_refs.oneOf.0.items.[INDEX].version.oneOf.0","typeLabel":"string"},{"description":"Package version to use in a new package request. When null, use an explicit repository target with ref instead.","type":"null","isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].available_refs.oneOf.0.items.[INDEX].version.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].available_refs.oneOf.0.items.[INDEX].version","typeLabel":"string | null"}},"required":["ref","version"],"type":"object","uniqueKey":"unavailable_targets.items.[INDEX].available_refs.oneOf.0.items.[INDEX]","typeLabel":"object"},"maxItems":10,"type":"array","isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].available_refs.oneOf.0","typeLabel":"object[]"},{"description":"Available repository ref candidates; ref-only candidates require repository addressing.","items":{"description":"An opaque repository ref and optional package version; never substitute one for the other.","properties":{"ref":{"description":"Opaque repository ref, preserved exactly.","type":"string"},"version":{"oneOf":[{"description":"Package version to use in a new package request. When null, use an explicit repository target with ref instead.","type":"string"},{"description":"Package version to use in a new package request. When null, use an explicit repository target with ref instead.","type":"null"}]}},"required":["ref","version"],"type":"object"},"maxItems":10,"type":"null","isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].available_refs.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].available_refs","typeLabel":"object[] | null"},"available_versions":{"oneOf":[{"description":"Available package-version candidates paired with their repository refs.","items":{"description":"An opaque repository ref and optional package version; never substitute one for the other.","properties":{"ref":{"description":"Opaque repository ref, preserved exactly.","type":"string","isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].available_versions.oneOf.0.items.[INDEX].ref","typeLabel":"string"},"version":{"oneOf":[{"description":"Package version to use in a new package request. When null, use an explicit repository target with ref instead.","type":"string","isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].available_versions.oneOf.0.items.[INDEX].version.oneOf.0","typeLabel":"string"},{"description":"Package version to use in a new package request. When null, use an explicit repository target with ref instead.","type":"null","isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].available_versions.oneOf.0.items.[INDEX].version.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].available_versions.oneOf.0.items.[INDEX].version","typeLabel":"string | null"}},"required":["ref","version"],"type":"object","uniqueKey":"unavailable_targets.items.[INDEX].available_versions.oneOf.0.items.[INDEX]","typeLabel":"object"},"maxItems":10,"type":"array","isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].available_versions.oneOf.0","typeLabel":"object[]"},{"description":"Available package-version candidates paired with their repository refs.","items":{"description":"An opaque repository ref and optional package version; never substitute one for the other.","properties":{"ref":{"description":"Opaque repository ref, preserved exactly.","type":"string"},"version":{"oneOf":[{"description":"Package version to use in a new package request. When null, use an explicit repository target with ref instead.","type":"string"},{"description":"Package version to use in a new package request. When null, use an explicit repository target with ref instead.","type":"null"}]}},"required":["ref","version"],"type":"object"},"maxItems":10,"type":"null","isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].available_versions.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].available_versions","typeLabel":"object[] | null"},"input_index":{"description":"Original zero-based requested input index.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].input_index","typeLabel":"integer\u003cint64>"},"message":{"oneOf":[{"description":"Explanation of unavailable content or suggested recovery, when available.","type":"string","isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].message.oneOf.0","typeLabel":"string"},{"description":"Explanation of unavailable content or suggested recovery, when available.","type":"null","isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].message.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].message","typeLabel":"string | null"},"progress_ref":{"oneOf":[{"description":"Opaque preparation progress reference, or null when none is available.","type":"string","isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].progress_ref.oneOf.0","typeLabel":"string"},{"description":"Opaque preparation progress reference, or null when none is available.","type":"null","isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].progress_ref.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].progress_ref","typeLabel":"string | null"},"reason":{"description":"Reason the content could not be prepared or its requested version or ref could not be selected.","type":"string","isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].reason","typeLabel":"string"},"repo_url":{"oneOf":[{"description":"Credential-free supported repository URL; null when inapplicable.","type":"string","isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].repo_url.oneOf.0","typeLabel":"string"},{"description":"Credential-free supported repository URL; null when inapplicable.","type":"null","isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].repo_url.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].repo_url","typeLabel":"string | null"},"requested_version":{"oneOf":[{"description":"Selected package release; not a proven repository ref.","type":"string","isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].requested_version.oneOf.0","typeLabel":"string"},{"description":"Selected package release; not a proven repository ref.","type":"null","isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].requested_version.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].requested_version","typeLabel":"string | null"},"retryable":{"description":"Whether this condition can be retried. For content needing preparation, start a new request with `wait_timeout_ms`.","type":"boolean","isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].retryable","typeLabel":"boolean"},"suggested_refs":{"oneOf":[{"description":"Suggested repository refs with nullable package versions; never substitute a ref for a version.","items":{"description":"An opaque repository ref and optional package version; never substitute one for the other.","properties":{"ref":{"description":"Opaque repository ref, preserved exactly.","type":"string","isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].suggested_refs.oneOf.0.items.[INDEX].ref","typeLabel":"string"},"version":{"oneOf":[{"description":"Package version to use in a new package request. When null, use an explicit repository target with ref instead.","type":"string","isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].suggested_refs.oneOf.0.items.[INDEX].version.oneOf.0","typeLabel":"string"},{"description":"Package version to use in a new package request. When null, use an explicit repository target with ref instead.","type":"null","isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].suggested_refs.oneOf.0.items.[INDEX].version.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].suggested_refs.oneOf.0.items.[INDEX].version","typeLabel":"string | null"}},"required":["ref","version"],"type":"object","uniqueKey":"unavailable_targets.items.[INDEX].suggested_refs.oneOf.0.items.[INDEX]","typeLabel":"object"},"maxItems":10,"type":"array","isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].suggested_refs.oneOf.0","typeLabel":"object[]"},{"description":"Suggested repository refs with nullable package versions; never substitute a ref for a version.","items":{"description":"An opaque repository ref and optional package version; never substitute one for the other.","properties":{"ref":{"description":"Opaque repository ref, preserved exactly.","type":"string"},"version":{"oneOf":[{"description":"Package version to use in a new package request. When null, use an explicit repository target with ref instead.","type":"string"},{"description":"Package version to use in a new package request. When null, use an explicit repository target with ref instead.","type":"null"}]}},"required":["ref","version"],"type":"object"},"maxItems":10,"type":"null","isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].suggested_refs.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].suggested_refs","typeLabel":"object[] | null"},"suggested_site_targets":{"oneOf":[{"description":"Site targets suggested for a new request. Null means no suggestion information; [] means no known candidates.","items":{"type":"string","uniqueKey":"unavailable_targets.items.[INDEX].suggested_site_targets.oneOf.0.items.[INDEX]","typeLabel":"string"},"type":"array","isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].suggested_site_targets.oneOf.0","typeLabel":"string[]"},{"description":"Site targets suggested for a new request. Null means no suggestion information; [] means no known candidates.","items":{"type":"string"},"type":"null","isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].suggested_site_targets.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].suggested_site_targets","typeLabel":"string[] | null"},"target":{"description":"Target for this content. Copy unchanged when making a follow-up request.","type":"string","isRequired":true,"uniqueKey":"unavailable_targets.items.[INDEX].target","typeLabel":"string"}},"required":["input_index","target","reason","retryable","progress_ref","suggested_site_targets","message","repo_url","requested_version","suggested_refs","available_refs","available_versions"],"type":"object","uniqueKey":"unavailable_targets.items.[INDEX]","typeLabel":"object"},"type":"array","isRequired":true,"uniqueKey":"unavailable_targets","typeLabel":"object[]"}},"required":["hits","targets","unavailable_targets","traversal","next_cursor","total_matches"],"type":"object","uniqueKey":"","typeLabel":"object"},"exampleType":"examples"}},"description":"One page of text matches with read actions and search progress","headers":{"Cache-Control":{"schema":{"enum":["no-store"],"type":"string"}},"X-RateLimit-Limit":{"description":"Maximum requests in the authenticated usage window shared across operations. Optional: supplied only when usage metadata is available.","schema":{"pattern":"^[0-9]+$","type":"string"}},"X-RateLimit-Remaining":{"description":"Requests remaining in that usage window after admission. Advisory snapshot; concurrent requests can consume quota. Optional when usage metadata is unavailable.","schema":{"pattern":"^[0-9]+$","type":"string"}},"X-RateLimit-Reset":{"description":"Usage window reset time as Unix epoch seconds (UTC), rounded up to the next whole second. This is an absolute timestamp, not a delay. Optional when usage metadata is unavailable. Honor Retry-After on 429 when present; other quotas can also reject requests.","schema":{"pattern":"^[0-9]+$","type":"string"}},"X-Request-ID":{"description":"Request trace ID for diagnostics; matches problem.instance on failures.","schema":{"type":"string"}}},"exampleType":"examples"},"4faa8ffb-3154-4a4d-9975-e4e385697524":{"content":{"application/problem+json":{"examples":{"expired_cursor":{"title":"expired_cursor","value":{"code":"MULTI_GREP_CURSOR_EXPIRED","detail":"The cursor expired. Start a new request without it; results already returned remain usable.","instance":"fixture-request","retryable":true,"status":400,"title":"Grep request failed","type":"about:blank"}},"invalid_cursor":{"title":"invalid_cursor","value":{"code":"MULTI_GREP_CURSOR_INVALID","detail":"This cursor cannot continue the request. Start a new request without cursor, using the same targets and controls.","instance":"fixture-request","retryable":true,"status":400,"title":"Grep request failed","type":"about:blank"}},"invalid_session_id":{"title":"invalid_session_id","value":{"code":"INVALID_SESSION_ID","detail":"X-GitHits-Session-ID must occur once and match [A-Za-z0-9_-]{1,64}.","instance":"4bf92f3577b34da6a3ce929d0e0e4736","status":400,"title":"Invalid session ID","type":"about:blank"}},"validation":{"title":"validation","value":{"code":"VALIDATION_ERROR","detail":"max_matches: Set max_matches to an integer from 1 through 1000; it limits the whole page.","instance":"fixture-request","status":400,"title":"Validation error","type":"about:blank"}}},"schema":{"type":"object","description":"Search error with a stable code, explanation, request ID, and retry guidance when available.","required":["type","title","status","detail","instance","code"],"properties":{"code":{"description":"The stable uppercase API error code.","type":"string","isRequired":true,"uniqueKey":"code","typeLabel":"string"},"detail":{"description":"Human-readable explanation. Wording can change; use code and structured fields for program logic. Validation errors identify the first invalid field (including zero-based array indices) and a reason; version errors can include canonical-version guidance.","type":"string","isRequired":true,"uniqueKey":"detail","typeLabel":"string"},"instance":{"description":"Request ID matching the X-Request-ID response header; include it when seeking support.","type":"string","isRequired":true,"uniqueKey":"instance","typeLabel":"string"},"status":{"description":"The HTTP status returned with this problem.","format":"int32","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"status","typeLabel":"integer\u003cint32>"},"title":{"description":"A short, stable title for the error.","type":"string","isRequired":true,"uniqueKey":"title","typeLabel":"string"},"type":{"description":"The generic RFC 9457 problem type.","type":"string","isRequired":true,"uniqueKey":"type","typeLabel":"string"},"acceptance_url":{"description":"Link for accepting the required terms, when provided.","type":"string","uniqueKey":"acceptance_url","typeLabel":"string"},"limit":{"description":"Allowance in the exhausted pool's units for `QUOTA_EXCEEDED` when supplied.","format":"int64","minimum":0,"type":"integer","uniqueKey":"limit","typeLabel":"integer\u003cint64>"},"pool":{"description":"Exhausted allowance pool for `QUOTA_EXCEEDED` when supplied. Known values include `analysis` and `requests`. Clients must accept new values.","type":"string","uniqueKey":"pool","typeLabel":"string"},"resets_at":{"description":"Time when the exhausted allowance resets for `QUOTA_EXCEEDED` when supplied.","format":"date-time","type":"string","uniqueKey":"resets_at","typeLabel":"string\u003cdate-time>"},"retryable":{"type":"boolean","description":"Whether this condition can be retried, when known. An expired cursor requires a fresh request without cursor.","uniqueKey":"retryable","typeLabel":"boolean"},"terms_url":{"description":"Link to the terms that require acceptance, when provided.","type":"string","uniqueKey":"terms_url","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"exampleType":"examples"}},"description":"GREP_PATTERN_TOO_UNSELECTIVE rejects the whole request when the pattern is too broad; narrow it or the scope. Check matching controls. For an invalid or expired cursor, start a new request without it. INVALID_SESSION_ID: a supplied session header is invalid or duplicated. VALIDATION_ERROR details identify the first invalid field and a reason when available. Array indices are zero-based; submitted values and unknown keys are not echoed.","headers":{"Cache-Control":{"schema":{"enum":["no-store"],"type":"string"}},"X-Request-ID":{"description":"Request trace ID for diagnostics; matches problem.instance on failures.","schema":{"type":"string"}}},"exampleType":"examples"},"3f9506c8-5cca-4e9e-852c-252ad317d934":{"content":{"application/problem+json":{"example":{"code":"AUTHENTICATION_REQUIRED","detail":"A bearer credential is required.","instance":"fixture-request","status":401,"title":"Authentication required","type":"about:blank"},"schema":{"type":"object","description":"Search error with a stable code, explanation, request ID, and retry guidance when available.","required":["type","title","status","detail","instance","code"],"properties":{"code":{"description":"The stable uppercase API error code.","type":"string","isRequired":true,"uniqueKey":"code","typeLabel":"string"},"detail":{"description":"Human-readable explanation. Wording can change; use code and structured fields for program logic. Validation errors identify the first invalid field (including zero-based array indices) and a reason; version errors can include canonical-version guidance.","type":"string","isRequired":true,"uniqueKey":"detail","typeLabel":"string"},"instance":{"description":"Request ID matching the X-Request-ID response header; include it when seeking support.","type":"string","isRequired":true,"uniqueKey":"instance","typeLabel":"string"},"status":{"description":"The HTTP status returned with this problem.","format":"int32","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"status","typeLabel":"integer\u003cint32>"},"title":{"description":"A short, stable title for the error.","type":"string","isRequired":true,"uniqueKey":"title","typeLabel":"string"},"type":{"description":"The generic RFC 9457 problem type.","type":"string","isRequired":true,"uniqueKey":"type","typeLabel":"string"},"acceptance_url":{"description":"Link for accepting the required terms, when provided.","type":"string","uniqueKey":"acceptance_url","typeLabel":"string"},"limit":{"description":"Allowance in the exhausted pool's units for `QUOTA_EXCEEDED` when supplied.","format":"int64","minimum":0,"type":"integer","uniqueKey":"limit","typeLabel":"integer\u003cint64>"},"pool":{"description":"Exhausted allowance pool for `QUOTA_EXCEEDED` when supplied. Known values include `analysis` and `requests`. Clients must accept new values.","type":"string","uniqueKey":"pool","typeLabel":"string"},"resets_at":{"description":"Time when the exhausted allowance resets for `QUOTA_EXCEEDED` when supplied.","format":"date-time","type":"string","uniqueKey":"resets_at","typeLabel":"string\u003cdate-time>"},"retryable":{"type":"boolean","description":"Whether this condition can be retried, when known. An expired cursor requires a fresh request without cursor.","uniqueKey":"retryable","typeLabel":"boolean"},"terms_url":{"description":"Link to the terms that require acceptance, when provided.","type":"string","uniqueKey":"terms_url","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"code":"AUTHENTICATION_REQUIRED","detail":"A bearer credential is required.","instance":"fixture-request","status":401,"title":"Authentication required","type":"about:blank"}}},"exampleType":"examples"}},"description":"Supply a valid bearer credential.","headers":{"Cache-Control":{"schema":{"enum":["no-store"],"type":"string"}},"WWW-Authenticate":{"schema":{"type":"string"}},"X-Request-ID":{"description":"Request trace ID for diagnostics; matches problem.instance on failures.","schema":{"type":"string"}}},"exampleType":"examples"},"6eec04ff-42ab-4ffd-9319-0beeb795f6f6":{"content":{"application/problem+json":{"example":{"code":"FORBIDDEN","detail":"The caller is not allowed to access this resource.","instance":"fixture-request","status":403,"title":"Forbidden","type":"about:blank"},"schema":{"type":"object","description":"Search error with a stable code, explanation, request ID, and retry guidance when available.","required":["type","title","status","detail","instance","code"],"properties":{"code":{"description":"The stable uppercase API error code.","type":"string","isRequired":true,"uniqueKey":"code","typeLabel":"string"},"detail":{"description":"Human-readable explanation. Wording can change; use code and structured fields for program logic. Validation errors identify the first invalid field (including zero-based array indices) and a reason; version errors can include canonical-version guidance.","type":"string","isRequired":true,"uniqueKey":"detail","typeLabel":"string"},"instance":{"description":"Request ID matching the X-Request-ID response header; include it when seeking support.","type":"string","isRequired":true,"uniqueKey":"instance","typeLabel":"string"},"status":{"description":"The HTTP status returned with this problem.","format":"int32","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"status","typeLabel":"integer\u003cint32>"},"title":{"description":"A short, stable title for the error.","type":"string","isRequired":true,"uniqueKey":"title","typeLabel":"string"},"type":{"description":"The generic RFC 9457 problem type.","type":"string","isRequired":true,"uniqueKey":"type","typeLabel":"string"},"acceptance_url":{"description":"Link for accepting the required terms, when provided.","type":"string","uniqueKey":"acceptance_url","typeLabel":"string"},"limit":{"description":"Allowance in the exhausted pool's units for `QUOTA_EXCEEDED` when supplied.","format":"int64","minimum":0,"type":"integer","uniqueKey":"limit","typeLabel":"integer\u003cint64>"},"pool":{"description":"Exhausted allowance pool for `QUOTA_EXCEEDED` when supplied. Known values include `analysis` and `requests`. Clients must accept new values.","type":"string","uniqueKey":"pool","typeLabel":"string"},"resets_at":{"description":"Time when the exhausted allowance resets for `QUOTA_EXCEEDED` when supplied.","format":"date-time","type":"string","uniqueKey":"resets_at","typeLabel":"string\u003cdate-time>"},"retryable":{"type":"boolean","description":"Whether this condition can be retried, when known. An expired cursor requires a fresh request without cursor.","uniqueKey":"retryable","typeLabel":"boolean"},"terms_url":{"description":"Link to the terms that require acceptance, when provided.","type":"string","uniqueKey":"terms_url","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"code":"FORBIDDEN","detail":"The caller is not allowed to access this resource.","instance":"fixture-request","status":403,"title":"Forbidden","type":"about:blank"}}},"exampleType":"examples"}},"description":"Account, capability or terms restrictions prevent this request.","headers":{"Cache-Control":{"schema":{"enum":["no-store"],"type":"string"}},"X-Request-ID":{"description":"Request trace ID for diagnostics; matches problem.instance on failures.","schema":{"type":"string"}}},"exampleType":"examples"},"9b585525-13d2-44d0-8b8b-2975098d4618":{"content":{"application/problem+json":{"example":{"code":"GREP_PATH_NOT_INDEXED","detail":"The selected path is absent from the searchable index.","instance":"fixture-request","status":404,"title":"Grep request failed","type":"about:blank"},"schema":{"type":"object","description":"Search error with a stable code, explanation, request ID, and retry guidance when available.","required":["type","title","status","detail","instance","code"],"properties":{"code":{"description":"The stable uppercase API error code.","type":"string","isRequired":true,"uniqueKey":"code","typeLabel":"string"},"detail":{"description":"Human-readable explanation. Wording can change; use code and structured fields for program logic. Validation errors identify the first invalid field (including zero-based array indices) and a reason; version errors can include canonical-version guidance.","type":"string","isRequired":true,"uniqueKey":"detail","typeLabel":"string"},"instance":{"description":"Request ID matching the X-Request-ID response header; include it when seeking support.","type":"string","isRequired":true,"uniqueKey":"instance","typeLabel":"string"},"status":{"description":"The HTTP status returned with this problem.","format":"int32","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"status","typeLabel":"integer\u003cint32>"},"title":{"description":"A short, stable title for the error.","type":"string","isRequired":true,"uniqueKey":"title","typeLabel":"string"},"type":{"description":"The generic RFC 9457 problem type.","type":"string","isRequired":true,"uniqueKey":"type","typeLabel":"string"},"acceptance_url":{"description":"Link for accepting the required terms, when provided.","type":"string","uniqueKey":"acceptance_url","typeLabel":"string"},"limit":{"description":"Allowance in the exhausted pool's units for `QUOTA_EXCEEDED` when supplied.","format":"int64","minimum":0,"type":"integer","uniqueKey":"limit","typeLabel":"integer\u003cint64>"},"pool":{"description":"Exhausted allowance pool for `QUOTA_EXCEEDED` when supplied. Known values include `analysis` and `requests`. Clients must accept new values.","type":"string","uniqueKey":"pool","typeLabel":"string"},"resets_at":{"description":"Time when the exhausted allowance resets for `QUOTA_EXCEEDED` when supplied.","format":"date-time","type":"string","uniqueKey":"resets_at","typeLabel":"string\u003cdate-time>"},"retryable":{"type":"boolean","description":"Whether this condition can be retried, when known. An expired cursor requires a fresh request without cursor.","uniqueKey":"retryable","typeLabel":"boolean"},"terms_url":{"description":"Link to the terms that require acceptance, when provided.","type":"string","uniqueKey":"terms_url","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"code":"GREP_PATH_NOT_INDEXED","detail":"The selected path is absent from the searchable index.","instance":"fixture-request","status":404,"title":"Grep request failed","type":"about:blank"}}},"exampleType":"examples"}},"description":"GREP_PATH_NOT_INDEXED: selected path is absent from the searchable index.","headers":{"Cache-Control":{"schema":{"enum":["no-store"],"type":"string"}},"X-Request-ID":{"description":"Request trace ID for diagnostics; matches problem.instance on failures.","schema":{"type":"string"}}},"exampleType":"examples"},"17c38781-6adb-46ca-941a-8684517842e6":{"content":{"application/problem+json":{"example":{"code":"METHOD_NOT_ALLOWED","detail":"The requested method is not supported for this route.","instance":"4bf92f3577b34da6a3ce929d0e0e4736","status":405,"title":"Method not allowed","type":"about:blank"},"schema":{"description":"The stable problem document returned for an unsuccessful public API request.","properties":{"code":{"description":"The stable uppercase API error code.","type":"string","isRequired":true,"uniqueKey":"code","typeLabel":"string"},"detail":{"description":"Human-readable explanation. Wording can change; use code and structured fields for program logic. Validation errors identify the first invalid field (including zero-based array indices) and a reason; version errors can include canonical-version guidance.","type":"string","isRequired":true,"uniqueKey":"detail","typeLabel":"string"},"instance":{"description":"Request ID matching the X-Request-ID response header; include it when seeking support.","type":"string","isRequired":true,"uniqueKey":"instance","typeLabel":"string"},"status":{"description":"The HTTP status returned with this problem.","format":"int32","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"status","typeLabel":"integer\u003cint32>"},"title":{"description":"A short, stable title for the error.","type":"string","isRequired":true,"uniqueKey":"title","typeLabel":"string"},"type":{"description":"The generic RFC 9457 problem type.","type":"string","isRequired":true,"uniqueKey":"type","typeLabel":"string"},"acceptance_url":{"description":"Link for accepting the required terms, when provided.","type":"string","uniqueKey":"acceptance_url","typeLabel":"string"},"limit":{"description":"Allowance in the exhausted pool's units for `QUOTA_EXCEEDED` when supplied.","format":"int64","minimum":0,"type":"integer","uniqueKey":"limit","typeLabel":"integer\u003cint64>"},"pool":{"description":"Exhausted allowance pool for `QUOTA_EXCEEDED` when supplied. Known values include `analysis` and `requests`. Clients must accept new values.","type":"string","uniqueKey":"pool","typeLabel":"string"},"resets_at":{"description":"Time when the exhausted allowance resets for `QUOTA_EXCEEDED` when supplied.","format":"date-time","type":"string","uniqueKey":"resets_at","typeLabel":"string\u003cdate-time>"},"retryable":{"description":"Whether retrying later may help, when supplied. Follow this flag for lookup/provider outcomes and temporary daily-allowance failures; malformed evidence can be nonretryable.","type":"boolean","uniqueKey":"retryable","typeLabel":"boolean"},"terms_url":{"description":"Link to the terms that require acceptance, when provided.","type":"string","uniqueKey":"terms_url","typeLabel":"string"}},"required":["type","title","status","detail","instance","code"],"type":"object","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"code":"METHOD_NOT_ALLOWED","detail":"The requested method is not supported for this route.","instance":"4bf92f3577b34da6a3ce929d0e0e4736","status":405,"title":"Method not allowed","type":"about:blank"}}},"exampleType":"examples"}},"description":"METHOD_NOT_ALLOWED: the route does not support this HTTP method.","headers":{"Allow":{"description":"Supported methods: POST.","schema":{"type":"string"}},"Cache-Control":{"schema":{"enum":["no-store"],"type":"string"}},"X-Request-ID":{"description":"Request trace ID for diagnostics; matches problem.instance on failures.","schema":{"type":"string"}}},"exampleType":"examples"},"daa84783-28cb-42f0-be23-30d31e72752a":{"content":{"application/problem+json":{"example":{"code":"GREP_TARGET_PREPARATION_REQUIRED","detail":"Some requested content cannot be searched. Review target_issues. For retryable preparation, repeat the first request with wait_timeout_ms and omit cursor. For source identity failures, choose a supported target, package version or repository ref.","instance":"fixture-request","retryable":false,"status":409,"target_issues":[{"available_refs":null,"available_versions":null,"input_index":null,"message":null,"progress_ref":null,"reason":"no_grep_scopes","repo_url":null,"requested_version":null,"retryable":false,"suggested_refs":null,"suggested_site_targets":null,"target":null}],"title":"Grep request failed","type":"about:blank"},"schema":{"type":"object","description":"Content could not be prepared for search. Review `target_issues` for reasons and next steps.","required":["retryable","target_issues","type","title","status","detail","instance","code"],"properties":{"code":{"description":"The stable uppercase API error code.","type":"string","isRequired":true,"uniqueKey":"code","typeLabel":"string"},"detail":{"description":"Human-readable explanation. Wording can change; use code and structured fields for program logic. Validation errors identify the first invalid field (including zero-based array indices) and a reason; version errors can include canonical-version guidance.","type":"string","isRequired":true,"uniqueKey":"detail","typeLabel":"string"},"instance":{"description":"Request ID matching the X-Request-ID response header; include it when seeking support.","type":"string","isRequired":true,"uniqueKey":"instance","typeLabel":"string"},"retryable":{"type":"boolean","description":"Whether the preparation condition can be retried.","isRequired":true,"uniqueKey":"retryable","typeLabel":"boolean"},"status":{"description":"The HTTP status returned with this problem.","format":"int32","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"status","typeLabel":"integer\u003cint32>"},"title":{"description":"A short, stable title for the error.","type":"string","isRequired":true,"uniqueKey":"title","typeLabel":"string"},"type":{"description":"The generic RFC 9457 problem type.","type":"string","isRequired":true,"uniqueKey":"type","typeLabel":"string"},"target_issues":{"description":"Reasons requested content could not be searched. An issue affecting the whole request has null `input_index` and target.","items":{"description":"A typed preparation failure; a request-wide issue can have no input index or target.","properties":{"available_refs":{"oneOf":[{"description":"Available repository ref candidates; ref-only candidates require repository addressing.","items":{"description":"An opaque repository ref and optional package version; never substitute one for the other.","properties":{"ref":{"description":"Opaque repository ref, preserved exactly.","type":"string","isRequired":true,"uniqueKey":"target_issues.items.[INDEX].available_refs.oneOf.0.items.[INDEX].ref","typeLabel":"string"},"version":{"oneOf":[{"description":"Package version to use in a new package request. When null, use an explicit repository target with ref instead.","type":"string","isRequired":true,"uniqueKey":"target_issues.items.[INDEX].available_refs.oneOf.0.items.[INDEX].version.oneOf.0","typeLabel":"string"},{"description":"Package version to use in a new package request. When null, use an explicit repository target with ref instead.","type":"null","isRequired":true,"uniqueKey":"target_issues.items.[INDEX].available_refs.oneOf.0.items.[INDEX].version.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"target_issues.items.[INDEX].available_refs.oneOf.0.items.[INDEX].version","typeLabel":"string | null"}},"required":["ref","version"],"type":"object","uniqueKey":"target_issues.items.[INDEX].available_refs.oneOf.0.items.[INDEX]","typeLabel":"object"},"maxItems":10,"type":"array","isRequired":true,"uniqueKey":"target_issues.items.[INDEX].available_refs.oneOf.0","typeLabel":"object[]"},{"description":"Available repository ref candidates; ref-only candidates require repository addressing.","items":{"description":"An opaque repository ref and optional package version; never substitute one for the other.","properties":{"ref":{"description":"Opaque repository ref, preserved exactly.","type":"string"},"version":{"oneOf":[{"description":"Package version to use in a new package request. When null, use an explicit repository target with ref instead.","type":"string"},{"description":"Package version to use in a new package request. When null, use an explicit repository target with ref instead.","type":"null"}]}},"required":["ref","version"],"type":"object"},"maxItems":10,"type":"null","isRequired":true,"uniqueKey":"target_issues.items.[INDEX].available_refs.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"target_issues.items.[INDEX].available_refs","typeLabel":"object[] | null"},"available_versions":{"oneOf":[{"description":"Available package-version candidates paired with their repository refs.","items":{"description":"An opaque repository ref and optional package version; never substitute one for the other.","properties":{"ref":{"description":"Opaque repository ref, preserved exactly.","type":"string","isRequired":true,"uniqueKey":"target_issues.items.[INDEX].available_versions.oneOf.0.items.[INDEX].ref","typeLabel":"string"},"version":{"oneOf":[{"description":"Package version to use in a new package request. When null, use an explicit repository target with ref instead.","type":"string","isRequired":true,"uniqueKey":"target_issues.items.[INDEX].available_versions.oneOf.0.items.[INDEX].version.oneOf.0","typeLabel":"string"},{"description":"Package version to use in a new package request. When null, use an explicit repository target with ref instead.","type":"null","isRequired":true,"uniqueKey":"target_issues.items.[INDEX].available_versions.oneOf.0.items.[INDEX].version.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"target_issues.items.[INDEX].available_versions.oneOf.0.items.[INDEX].version","typeLabel":"string | null"}},"required":["ref","version"],"type":"object","uniqueKey":"target_issues.items.[INDEX].available_versions.oneOf.0.items.[INDEX]","typeLabel":"object"},"maxItems":10,"type":"array","isRequired":true,"uniqueKey":"target_issues.items.[INDEX].available_versions.oneOf.0","typeLabel":"object[]"},{"description":"Available package-version candidates paired with their repository refs.","items":{"description":"An opaque repository ref and optional package version; never substitute one for the other.","properties":{"ref":{"description":"Opaque repository ref, preserved exactly.","type":"string"},"version":{"oneOf":[{"description":"Package version to use in a new package request. When null, use an explicit repository target with ref instead.","type":"string"},{"description":"Package version to use in a new package request. When null, use an explicit repository target with ref instead.","type":"null"}]}},"required":["ref","version"],"type":"object"},"maxItems":10,"type":"null","isRequired":true,"uniqueKey":"target_issues.items.[INDEX].available_versions.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"target_issues.items.[INDEX].available_versions","typeLabel":"object[] | null"},"input_index":{"oneOf":[{"description":"Original zero-based input index; null only for a request-wide preparation issue.","format":"int64","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"target_issues.items.[INDEX].input_index.oneOf.0","typeLabel":"integer\u003cint64>"},{"description":"Original zero-based input index; null only for a request-wide preparation issue.","format":"int64","minimum":0,"type":"null","isRequired":true,"uniqueKey":"target_issues.items.[INDEX].input_index.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"target_issues.items.[INDEX].input_index","typeLabel":"integer\u003cint64> | null"},"message":{"oneOf":[{"description":"Explanation of unavailable content or suggested recovery, when available.","type":"string","isRequired":true,"uniqueKey":"target_issues.items.[INDEX].message.oneOf.0","typeLabel":"string"},{"description":"Explanation of unavailable content or suggested recovery, when available.","type":"null","isRequired":true,"uniqueKey":"target_issues.items.[INDEX].message.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"target_issues.items.[INDEX].message","typeLabel":"string | null"},"progress_ref":{"oneOf":[{"description":"Opaque preparation progress reference, or null when none is available.","type":"string","isRequired":true,"uniqueKey":"target_issues.items.[INDEX].progress_ref.oneOf.0","typeLabel":"string"},{"description":"Opaque preparation progress reference, or null when none is available.","type":"null","isRequired":true,"uniqueKey":"target_issues.items.[INDEX].progress_ref.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"target_issues.items.[INDEX].progress_ref","typeLabel":"string | null"},"reason":{"description":"Reason the content could not be prepared or its requested version or ref could not be selected.","type":"string","isRequired":true,"uniqueKey":"target_issues.items.[INDEX].reason","typeLabel":"string"},"repo_url":{"oneOf":[{"description":"Credential-free supported repository URL; null when inapplicable.","type":"string","isRequired":true,"uniqueKey":"target_issues.items.[INDEX].repo_url.oneOf.0","typeLabel":"string"},{"description":"Credential-free supported repository URL; null when inapplicable.","type":"null","isRequired":true,"uniqueKey":"target_issues.items.[INDEX].repo_url.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"target_issues.items.[INDEX].repo_url","typeLabel":"string | null"},"requested_version":{"oneOf":[{"description":"Selected package release; not a proven repository ref.","type":"string","isRequired":true,"uniqueKey":"target_issues.items.[INDEX].requested_version.oneOf.0","typeLabel":"string"},{"description":"Selected package release; not a proven repository ref.","type":"null","isRequired":true,"uniqueKey":"target_issues.items.[INDEX].requested_version.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"target_issues.items.[INDEX].requested_version","typeLabel":"string | null"},"retryable":{"description":"Whether this condition can be retried. For content needing preparation, start a new request with `wait_timeout_ms`.","type":"boolean","isRequired":true,"uniqueKey":"target_issues.items.[INDEX].retryable","typeLabel":"boolean"},"suggested_refs":{"oneOf":[{"description":"Suggested repository refs with nullable package versions; never substitute a ref for a version.","items":{"description":"An opaque repository ref and optional package version; never substitute one for the other.","properties":{"ref":{"description":"Opaque repository ref, preserved exactly.","type":"string","isRequired":true,"uniqueKey":"target_issues.items.[INDEX].suggested_refs.oneOf.0.items.[INDEX].ref","typeLabel":"string"},"version":{"oneOf":[{"description":"Package version to use in a new package request. When null, use an explicit repository target with ref instead.","type":"string","isRequired":true,"uniqueKey":"target_issues.items.[INDEX].suggested_refs.oneOf.0.items.[INDEX].version.oneOf.0","typeLabel":"string"},{"description":"Package version to use in a new package request. When null, use an explicit repository target with ref instead.","type":"null","isRequired":true,"uniqueKey":"target_issues.items.[INDEX].suggested_refs.oneOf.0.items.[INDEX].version.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"target_issues.items.[INDEX].suggested_refs.oneOf.0.items.[INDEX].version","typeLabel":"string | null"}},"required":["ref","version"],"type":"object","uniqueKey":"target_issues.items.[INDEX].suggested_refs.oneOf.0.items.[INDEX]","typeLabel":"object"},"maxItems":10,"type":"array","isRequired":true,"uniqueKey":"target_issues.items.[INDEX].suggested_refs.oneOf.0","typeLabel":"object[]"},{"description":"Suggested repository refs with nullable package versions; never substitute a ref for a version.","items":{"description":"An opaque repository ref and optional package version; never substitute one for the other.","properties":{"ref":{"description":"Opaque repository ref, preserved exactly.","type":"string"},"version":{"oneOf":[{"description":"Package version to use in a new package request. When null, use an explicit repository target with ref instead.","type":"string"},{"description":"Package version to use in a new package request. When null, use an explicit repository target with ref instead.","type":"null"}]}},"required":["ref","version"],"type":"object"},"maxItems":10,"type":"null","isRequired":true,"uniqueKey":"target_issues.items.[INDEX].suggested_refs.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"target_issues.items.[INDEX].suggested_refs","typeLabel":"object[] | null"},"suggested_site_targets":{"oneOf":[{"description":"Site targets suggested for a new request. Null means no suggestion information; [] means no known candidates.","items":{"type":"string","uniqueKey":"target_issues.items.[INDEX].suggested_site_targets.oneOf.0.items.[INDEX]","typeLabel":"string"},"type":"array","isRequired":true,"uniqueKey":"target_issues.items.[INDEX].suggested_site_targets.oneOf.0","typeLabel":"string[]"},{"description":"Site targets suggested for a new request. Null means no suggestion information; [] means no known candidates.","items":{"type":"string"},"type":"null","isRequired":true,"uniqueKey":"target_issues.items.[INDEX].suggested_site_targets.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"target_issues.items.[INDEX].suggested_site_targets","typeLabel":"string[] | null"},"target":{"oneOf":[{"description":"Target for this content. Copy unchanged when making a follow-up request.","type":"string","isRequired":true,"uniqueKey":"target_issues.items.[INDEX].target.oneOf.0","typeLabel":"string"},{"description":"Target for this content. Copy unchanged when making a follow-up request.","type":"null","isRequired":true,"uniqueKey":"target_issues.items.[INDEX].target.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"target_issues.items.[INDEX].target","typeLabel":"string | null"}},"required":["input_index","target","reason","retryable","progress_ref","suggested_site_targets","message","repo_url","requested_version","suggested_refs","available_refs","available_versions"],"type":"object","uniqueKey":"target_issues.items.[INDEX]","typeLabel":"object"},"maxItems":20,"minItems":1,"type":"array","isRequired":true,"uniqueKey":"target_issues","typeLabel":"object[]"},"acceptance_url":{"description":"Link for accepting the required terms, when provided.","type":"string","uniqueKey":"acceptance_url","typeLabel":"string"},"limit":{"description":"Allowance in the exhausted pool's units for `QUOTA_EXCEEDED` when supplied.","format":"int64","minimum":0,"type":"integer","uniqueKey":"limit","typeLabel":"integer\u003cint64>"},"pool":{"description":"Exhausted allowance pool for `QUOTA_EXCEEDED` when supplied. Known values include `analysis` and `requests`. Clients must accept new values.","type":"string","uniqueKey":"pool","typeLabel":"string"},"resets_at":{"description":"Time when the exhausted allowance resets for `QUOTA_EXCEEDED` when supplied.","format":"date-time","type":"string","uniqueKey":"resets_at","typeLabel":"string\u003cdate-time>"},"terms_url":{"description":"Link to the terms that require acceptance, when provided.","type":"string","uniqueKey":"terms_url","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"code":"GREP_TARGET_PREPARATION_REQUIRED","detail":"Some requested content cannot be searched. Review target_issues. For retryable preparation, repeat the first request with wait_timeout_ms and omit cursor. For source identity failures, choose a supported target, package version or repository ref.","instance":"fixture-request","retryable":false,"status":409,"target_issues":[{"available_refs":null,"available_versions":null,"input_index":null,"message":null,"progress_ref":null,"reason":"no_grep_scopes","repo_url":null,"requested_version":null,"retryable":false,"suggested_refs":null,"suggested_site_targets":null,"target":null}],"title":"Grep request failed","type":"about:blank"}}},"exampleType":"examples"}},"description":"Review target_issues. For retryable preparation, repeat the first request with wait_timeout_ms and no cursor. For version or ref problems, choose one of the supplied target suggestions.","headers":{"Cache-Control":{"schema":{"enum":["no-store"],"type":"string"}},"X-Request-ID":{"description":"Request trace ID for diagnostics; matches problem.instance on failures.","schema":{"type":"string"}}},"exampleType":"examples"},"b4a36ce6-7b7e-444e-a225-e5b6d59f773f":{"content":{"application/problem+json":{"example":{"code":"GREP_FILE_TOO_LARGE","detail":"The selected file exceeds the source 5 MB limit.","instance":"fixture-request","status":422,"title":"Grep request failed","type":"about:blank"},"schema":{"type":"object","description":"Search error with a stable code, explanation, request ID, and retry guidance when available.","required":["type","title","status","detail","instance","code"],"properties":{"code":{"description":"The stable uppercase API error code.","type":"string","isRequired":true,"uniqueKey":"code","typeLabel":"string"},"detail":{"description":"Human-readable explanation. Wording can change; use code and structured fields for program logic. Validation errors identify the first invalid field (including zero-based array indices) and a reason; version errors can include canonical-version guidance.","type":"string","isRequired":true,"uniqueKey":"detail","typeLabel":"string"},"instance":{"description":"Request ID matching the X-Request-ID response header; include it when seeking support.","type":"string","isRequired":true,"uniqueKey":"instance","typeLabel":"string"},"status":{"description":"The HTTP status returned with this problem.","format":"int32","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"status","typeLabel":"integer\u003cint32>"},"title":{"description":"A short, stable title for the error.","type":"string","isRequired":true,"uniqueKey":"title","typeLabel":"string"},"type":{"description":"The generic RFC 9457 problem type.","type":"string","isRequired":true,"uniqueKey":"type","typeLabel":"string"},"acceptance_url":{"description":"Link for accepting the required terms, when provided.","type":"string","uniqueKey":"acceptance_url","typeLabel":"string"},"limit":{"description":"Allowance in the exhausted pool's units for `QUOTA_EXCEEDED` when supplied.","format":"int64","minimum":0,"type":"integer","uniqueKey":"limit","typeLabel":"integer\u003cint64>"},"pool":{"description":"Exhausted allowance pool for `QUOTA_EXCEEDED` when supplied. Known values include `analysis` and `requests`. Clients must accept new values.","type":"string","uniqueKey":"pool","typeLabel":"string"},"resets_at":{"description":"Time when the exhausted allowance resets for `QUOTA_EXCEEDED` when supplied.","format":"date-time","type":"string","uniqueKey":"resets_at","typeLabel":"string\u003cdate-time>"},"retryable":{"type":"boolean","description":"Whether this condition can be retried, when known. An expired cursor requires a fresh request without cursor.","uniqueKey":"retryable","typeLabel":"boolean"},"terms_url":{"description":"Link to the terms that require acceptance, when provided.","type":"string","uniqueKey":"terms_url","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"code":"GREP_FILE_TOO_LARGE","detail":"The selected file exceeds the source 5 MB limit.","instance":"fixture-request","status":422,"title":"Grep request failed","type":"about:blank"}}},"exampleType":"examples"}},"description":"The selected file exceeds the size limit or the path is excluded from search.","headers":{"Cache-Control":{"schema":{"enum":["no-store"],"type":"string"}},"X-Request-ID":{"description":"Request trace ID for diagnostics; matches problem.instance on failures.","schema":{"type":"string"}}},"exampleType":"examples"},"82f52506-2f42-4dcd-a609-ef64e0e7f89f":{"content":{"application/problem+json":{"example":{"code":"RATE_LIMITED","detail":"The request was rate limited.","instance":"fixture-request","status":429,"title":"Rate limited","type":"about:blank"},"schema":{"type":"object","description":"Search error with a stable code, explanation, request ID, and retry guidance when available.","required":["type","title","status","detail","instance","code"],"properties":{"code":{"description":"The stable uppercase API error code.","type":"string","isRequired":true,"uniqueKey":"code","typeLabel":"string"},"detail":{"description":"Human-readable explanation. Wording can change; use code and structured fields for program logic. Validation errors identify the first invalid field (including zero-based array indices) and a reason; version errors can include canonical-version guidance.","type":"string","isRequired":true,"uniqueKey":"detail","typeLabel":"string"},"instance":{"description":"Request ID matching the X-Request-ID response header; include it when seeking support.","type":"string","isRequired":true,"uniqueKey":"instance","typeLabel":"string"},"status":{"description":"The HTTP status returned with this problem.","format":"int32","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"status","typeLabel":"integer\u003cint32>"},"title":{"description":"A short, stable title for the error.","type":"string","isRequired":true,"uniqueKey":"title","typeLabel":"string"},"type":{"description":"The generic RFC 9457 problem type.","type":"string","isRequired":true,"uniqueKey":"type","typeLabel":"string"},"acceptance_url":{"description":"Link for accepting the required terms, when provided.","type":"string","uniqueKey":"acceptance_url","typeLabel":"string"},"limit":{"description":"Allowance in the exhausted pool's units for `QUOTA_EXCEEDED` when supplied.","format":"int64","minimum":0,"type":"integer","uniqueKey":"limit","typeLabel":"integer\u003cint64>"},"pool":{"description":"Exhausted allowance pool for `QUOTA_EXCEEDED` when supplied. Known values include `analysis` and `requests`. Clients must accept new values.","type":"string","uniqueKey":"pool","typeLabel":"string"},"resets_at":{"description":"Time when the exhausted allowance resets for `QUOTA_EXCEEDED` when supplied.","format":"date-time","type":"string","uniqueKey":"resets_at","typeLabel":"string\u003cdate-time>"},"retryable":{"type":"boolean","description":"Whether this condition can be retried, when known. An expired cursor requires a fresh request without cursor.","uniqueKey":"retryable","typeLabel":"boolean"},"terms_url":{"description":"Link to the terms that require acceptance, when provided.","type":"string","uniqueKey":"terms_url","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"code":"RATE_LIMITED","detail":"The request was rate limited.","instance":"fixture-request","status":429,"title":"Rate limited","type":"about:blank"}}},"exampleType":"examples"}},"description":"Respect Retry-After when present.\n\nQUOTA_EXCEEDED means a usage allowance is exhausted. When supplied, pool identifies the allowance (analysis for monthly analysis or requests for daily requests), limit gives its size, and resets_at gives its RFC 3339 reset time. When Retry-After is supplied, wait until that delay or HTTP date before trying again.","headers":{"Cache-Control":{"schema":{"enum":["no-store"],"type":"string"}},"Retry-After":{"schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Maximum requests in the authenticated usage window shared across operations. Optional: supplied only when usage metadata is available.","schema":{"pattern":"^[0-9]+$","type":"string"}},"X-RateLimit-Remaining":{"description":"Requests remaining in that usage window after admission. Advisory snapshot; concurrent requests can consume quota. Optional when usage metadata is unavailable.","schema":{"pattern":"^[0-9]+$","type":"string"}},"X-RateLimit-Reset":{"description":"Usage window reset time as Unix epoch seconds (UTC), rounded up to the next whole second. This is an absolute timestamp, not a delay. Optional when usage metadata is unavailable. Honor Retry-After on 429 when present; other quotas can also reject requests.","schema":{"pattern":"^[0-9]+$","type":"string"}},"X-Request-ID":{"description":"Request trace ID for diagnostics; matches problem.instance on failures.","schema":{"type":"string"}}},"exampleType":"examples"},"108c82ad-15a3-42af-871c-9163d10efd99":{"description":"A request ID could not be assigned. The response has an empty body and no X-Request-ID or problem object; try again later.","headers":{"Cache-Control":{"schema":{"enum":["no-store"],"type":"string"}}},"x-githits-empty-identity-failure":true,"content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"224ae30f-4637-42d5-9eac-47a383d57833":{"content":{"application/problem+json":{"example":{"code":"UPSTREAM_ERROR","detail":"The upstream service failed to provide a response.","instance":"fixture-request","status":502,"title":"Upstream error","type":"about:blank"},"schema":{"type":"object","description":"Search error with a stable code, explanation, request ID, and retry guidance when available.","required":["type","title","status","detail","instance","code"],"properties":{"code":{"description":"The stable uppercase API error code.","type":"string","isRequired":true,"uniqueKey":"code","typeLabel":"string"},"detail":{"description":"Human-readable explanation. Wording can change; use code and structured fields for program logic. Validation errors identify the first invalid field (including zero-based array indices) and a reason; version errors can include canonical-version guidance.","type":"string","isRequired":true,"uniqueKey":"detail","typeLabel":"string"},"instance":{"description":"Request ID matching the X-Request-ID response header; include it when seeking support.","type":"string","isRequired":true,"uniqueKey":"instance","typeLabel":"string"},"status":{"description":"The HTTP status returned with this problem.","format":"int32","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"status","typeLabel":"integer\u003cint32>"},"title":{"description":"A short, stable title for the error.","type":"string","isRequired":true,"uniqueKey":"title","typeLabel":"string"},"type":{"description":"The generic RFC 9457 problem type.","type":"string","isRequired":true,"uniqueKey":"type","typeLabel":"string"},"acceptance_url":{"description":"Link for accepting the required terms, when provided.","type":"string","uniqueKey":"acceptance_url","typeLabel":"string"},"limit":{"description":"Allowance in the exhausted pool's units for `QUOTA_EXCEEDED` when supplied.","format":"int64","minimum":0,"type":"integer","uniqueKey":"limit","typeLabel":"integer\u003cint64>"},"pool":{"description":"Exhausted allowance pool for `QUOTA_EXCEEDED` when supplied. Known values include `analysis` and `requests`. Clients must accept new values.","type":"string","uniqueKey":"pool","typeLabel":"string"},"resets_at":{"description":"Time when the exhausted allowance resets for `QUOTA_EXCEEDED` when supplied.","format":"date-time","type":"string","uniqueKey":"resets_at","typeLabel":"string\u003cdate-time>"},"retryable":{"type":"boolean","description":"Whether this condition can be retried, when known. An expired cursor requires a fresh request without cursor.","uniqueKey":"retryable","typeLabel":"boolean"},"terms_url":{"description":"Link to the terms that require acceptance, when provided.","type":"string","uniqueKey":"terms_url","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"code":"UPSTREAM_ERROR","detail":"The upstream service failed to provide a response.","instance":"fixture-request","status":502,"title":"Upstream error","type":"about:blank"}}},"exampleType":"examples"}},"description":"The service could not provide a usable response. Include X-Request-ID when reporting the failure.","headers":{"Cache-Control":{"schema":{"enum":["no-store"],"type":"string"}},"X-Request-ID":{"description":"Request trace ID for diagnostics; matches problem.instance on failures.","schema":{"type":"string"}}},"exampleType":"examples"},"0ab8150a-b017-4e76-8bd7-8daf69344a9e":{"content":{"application/problem+json":{"example":{"code":"GREP_SERVICE_UNAVAILABLE","detail":"The grep service is unavailable. Retry when retryable is true.","instance":"fixture-request","retryable":true,"status":503,"title":"Grep request failed","type":"about:blank"},"schema":{"type":"object","description":"Search error with a stable code, explanation, request ID, and retry guidance when available.","required":["type","title","status","detail","instance","code"],"properties":{"code":{"description":"The stable uppercase API error code.","type":"string","isRequired":true,"uniqueKey":"code","typeLabel":"string"},"detail":{"description":"Human-readable explanation. Wording can change; use code and structured fields for program logic. Validation errors identify the first invalid field (including zero-based array indices) and a reason; version errors can include canonical-version guidance.","type":"string","isRequired":true,"uniqueKey":"detail","typeLabel":"string"},"instance":{"description":"Request ID matching the X-Request-ID response header; include it when seeking support.","type":"string","isRequired":true,"uniqueKey":"instance","typeLabel":"string"},"status":{"description":"The HTTP status returned with this problem.","format":"int32","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"status","typeLabel":"integer\u003cint32>"},"title":{"description":"A short, stable title for the error.","type":"string","isRequired":true,"uniqueKey":"title","typeLabel":"string"},"type":{"description":"The generic RFC 9457 problem type.","type":"string","isRequired":true,"uniqueKey":"type","typeLabel":"string"},"acceptance_url":{"description":"Link for accepting the required terms, when provided.","type":"string","uniqueKey":"acceptance_url","typeLabel":"string"},"limit":{"description":"Allowance in the exhausted pool's units for `QUOTA_EXCEEDED` when supplied.","format":"int64","minimum":0,"type":"integer","uniqueKey":"limit","typeLabel":"integer\u003cint64>"},"pool":{"description":"Exhausted allowance pool for `QUOTA_EXCEEDED` when supplied. Known values include `analysis` and `requests`. Clients must accept new values.","type":"string","uniqueKey":"pool","typeLabel":"string"},"resets_at":{"description":"Time when the exhausted allowance resets for `QUOTA_EXCEEDED` when supplied.","format":"date-time","type":"string","uniqueKey":"resets_at","typeLabel":"string\u003cdate-time>"},"retryable":{"type":"boolean","description":"Whether this condition can be retried, when known. An expired cursor requires a fresh request without cursor.","uniqueKey":"retryable","typeLabel":"boolean"},"terms_url":{"description":"Link to the terms that require acceptance, when provided.","type":"string","uniqueKey":"terms_url","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"code":"GREP_SERVICE_UNAVAILABLE","detail":"The grep service is unavailable. Retry when retryable is true.","instance":"fixture-request","retryable":true,"status":503,"title":"Grep request failed","type":"about:blank"}}},"exampleType":"examples"}},"description":"Search is unavailable. Retry when retryable is true. QUOTA_UNAVAILABLE: your daily allowance could not be checked. This is temporary; retry the same request later (retryable=true).","headers":{"Cache-Control":{"schema":{"enum":["no-store"],"type":"string"}},"X-Request-ID":{"description":"Request trace ID for diagnostics; matches problem.instance on failures.","schema":{"type":"string"}}},"exampleType":"examples"},"158f9b15-fc9c-4f7b-9d45-c9669fec6cb3":{"content":{"application/problem+json":{"example":{"code":"GREP_TIMEOUT","detail":"The grep deadline expired. Narrow the scope or retry; preparation may continue.","instance":"fixture-request","status":504,"title":"Grep request failed","type":"about:blank"},"schema":{"type":"object","description":"Search error with a stable code, explanation, request ID, and retry guidance when available.","required":["type","title","status","detail","instance","code"],"properties":{"code":{"description":"The stable uppercase API error code.","type":"string","isRequired":true,"uniqueKey":"code","typeLabel":"string"},"detail":{"description":"Human-readable explanation. Wording can change; use code and structured fields for program logic. Validation errors identify the first invalid field (including zero-based array indices) and a reason; version errors can include canonical-version guidance.","type":"string","isRequired":true,"uniqueKey":"detail","typeLabel":"string"},"instance":{"description":"Request ID matching the X-Request-ID response header; include it when seeking support.","type":"string","isRequired":true,"uniqueKey":"instance","typeLabel":"string"},"status":{"description":"The HTTP status returned with this problem.","format":"int32","minimum":0,"type":"integer","isRequired":true,"uniqueKey":"status","typeLabel":"integer\u003cint32>"},"title":{"description":"A short, stable title for the error.","type":"string","isRequired":true,"uniqueKey":"title","typeLabel":"string"},"type":{"description":"The generic RFC 9457 problem type.","type":"string","isRequired":true,"uniqueKey":"type","typeLabel":"string"},"acceptance_url":{"description":"Link for accepting the required terms, when provided.","type":"string","uniqueKey":"acceptance_url","typeLabel":"string"},"limit":{"description":"Allowance in the exhausted pool's units for `QUOTA_EXCEEDED` when supplied.","format":"int64","minimum":0,"type":"integer","uniqueKey":"limit","typeLabel":"integer\u003cint64>"},"pool":{"description":"Exhausted allowance pool for `QUOTA_EXCEEDED` when supplied. Known values include `analysis` and `requests`. Clients must accept new values.","type":"string","uniqueKey":"pool","typeLabel":"string"},"resets_at":{"description":"Time when the exhausted allowance resets for `QUOTA_EXCEEDED` when supplied.","format":"date-time","type":"string","uniqueKey":"resets_at","typeLabel":"string\u003cdate-time>"},"retryable":{"type":"boolean","description":"Whether this condition can be retried, when known. An expired cursor requires a fresh request without cursor.","uniqueKey":"retryable","typeLabel":"boolean"},"terms_url":{"description":"Link to the terms that require acceptance, when provided.","type":"string","uniqueKey":"terms_url","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"code":"GREP_TIMEOUT","detail":"The grep deadline expired. Narrow the scope or retry; preparation may continue.","instance":"fixture-request","status":504,"title":"Grep request failed","type":"about:blank"}}},"exampleType":"examples"}},"description":"The grep deadline expired. Preparation may continue.","headers":{"Cache-Control":{"schema":{"enum":["no-store"],"type":"string"}},"X-Request-ID":{"description":"Request trace ID for diagnostics; matches problem.instance on failures.","schema":{"type":"string"}}},"exampleType":"examples"}},"security":{"c1fad00d-0570-41c7-88e3-28015b5cf6bd":{"bearer_auth":{"scheme":"bearer","type":"http","scopes":[],"schemeName":"bearer_auth"}}},"servers":{"1a2882b3-fedc-4756-bc8a-01bc0f383fda":{"description":"Production","url":"https://api.githits.dev"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"scheme":"bearer","type":"http","scopes":[],"schemeName":"bearer_auth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Bearer authentication header of the form `Bearer \u003ctoken>`, where `\u003ctoken>` is your auth token.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearer_auth","name":"Authorization"}],"title":"bearer_auth"}]},"originalFileLocation":"https://api.githits.dev/v1/openapi.json"},"subdomain":"githits","siteName":"GitHits","title":"Find regex or literal matches across source and documentation - GitHits","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-19T09:50:44.761Z","originalFileLocation":"api-reference/v1/grep/find-regex-or-literal-matches-across-source-and-documentation.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Find text in packages, repositories, and hosted documentation. Use this endpoint for exact text or regular-expression matches. Use list to find paths, search to discover topics, and read to retrieve more context for a match. ## Find text Send a JSON body to POST /v1/grep. This request searches an Express package and an explicit documentation site for literal text: json { \u0026quot;targets\u0026quot;:[{\u0026quot;target\u0026quot;:\u0026quot;npm:express@5.2.1\u0026quot;},{\u0026quot;target\u0026quot;:\u0026quot;site:expressjs.com/en\u0026quot;}], \u0026quot;pattern\u0026quot;:\u0026quot;Router\u0026quot;, \u0026quot;pattern_type\u0026quot;:\u0026quot;literal\u0026quot;, \u0026quot;max_matches\u0026quot;:10 } Package targets search that package\u0026#x27;s files and its selected hosted documentation. Repository targets such as github:expressjs/express search the repository snapshot. A site: target selects hosted pages directly. Matching is case-sensitive by default. Set ignore_case: true to ignore case, and context_lines_before or context_lines_after to include up to 10 surrounding lines on each side. Both context options default to 0. The default pattern_type is regex, using RE2 syntax; lookaround and backreferences are not supported. Include literal text in broad regex patterns, or choose literal for plain text. Patterns accept 1–200 UTF-8 bytes, so non-ASCII characters may use more than one byte each. ## Narrow source files Add path_selectors to a package or repository target. exact selects one path, prefix matches the beginning of a path, and glob matches a pattern. For example: json { \u0026quot;targets\u0026quot;:[{\u0026quot;target\u0026quot;:\u0026quot;github:expressjs/express\u0026quot;,\u0026quot;path_selectors\u0026quot;:[{\u0026quot;kind\u0026quot;:\u0026quot;glob\u0026quot;,\u0026quot;value\u0026quot;:\u0026quot;lib/*/.js\u0026quot;}]}], \u0026quot;pattern\u0026quot;:\u0026quot;router\u0026quot;, \u0026quot;pattern_type\u0026quot;:\u0026quot;literal\u0026quot;, \u0026quot;ignore_case\u0026quot;:true } Paths are relative to the selected package or repository. Any matching selector includes the file. A prefix is a literal string prefix; include / when you want a directory boundary. Omit selectors to search all files within the target. corpus selects source, documentation, or all repository files and defaults to all; it does not exclude a package\u0026#x27;s hosted documentation. For site targets, supply only target and omit corpus and path_selectors; use the site\u0026#x27;s scope to narrow pages. You can supply 1–20 targets. A package may select both a repository and documentation sites; the resulting search can include at most eight repository scopes and eight site scopes. Split larger searches into separate requests. Send options in the JSON body, which can be at most 2 MiB. Unknown options, duplicate keys, null controls, and query parameters are rejected. ## Read a match For each hit, pass read.target, non-null read.path, read.start_line, and read.end_line as URL-encoded query parameters to GET /v1/read. The line bounds are one-based and inclusive. Omit path when it is null. Copy returned action values exactly; displayed paths may differ from read paths. Repository reads use the returned commit snapshot. Hosted pages can change before you read them. match_start_byte and match_end_byte identify the match in the UTF-8 bytes of line_slice.content; the end is exclusive. Use these for highlighting returned text. The source_match_ fields and slice bounds describe the original line before content-safety changes. Those offsets may differ. Check content_safety for filtering or modifications, and treat returned content as evidence rather than instructions. ## Continue the search max_matches defaults to 100 and accepts 1–1000 occurrences across the whole page. total_matches counts this page\u0026#x27;s occurrences, not a total across pages. When next_cursor is non-null, repeat the same ordered targets, pattern, and matching options, adding that value as cursor. Copy it unchanged. Continuation does not wait for or start preparation. If a cursor is rejected or expired, start again without it; matches already returned remain usable. ## Understand incomplete results Inspect each target\u0026#x27;s traversal and readiness, skipped-file counts, and unavailable_targets before treating zero matches as exhaustive. The response\u0026#x27;s targets lists the repositories and sites selected for the search. A hit\u0026#x27;s target_index refers to that list; requested_input_indices identifies the original request targets that selected it. Top-level traversal describes page/paging state and is not an aggregate of target coverage. Per-target traversal takes precedence for coverage: a top-level resumable_limit with next_cursor can coexist with a target whose traversal is failed. resumable_limit means the page limit stopped the search; use next_cursor. Readiness unspecified means that target has not been visited yet. non_resumable_partial or failed means some content was not searched. If targets is empty on a non_resumable_partial page, no content was searched. Matches from other ready targets remain usable when a package\u0026#x27;s source is unavailable. Review unavailable_targets or an error\u0026#x27;s target_issues for recovery guidance. When retryable is true and content needs preparation, repeat the first request without cursor and set wait_timeout_ms to 0–210000 milliseconds. It defaults to 0. At the maximum wait, allow up to 240 seconds for the HTTP request. Preparation may continue after a timeout. Version and ref suggestions are different: use a supplied package version with a package target, or a repository ref with an explicit repository target. For example, use github:expressjs/express@ for a repository ref. Ref-only suggestions are not package versions. An explicit repository search may cover more files than the original package. GREP_PATTERN_TOO_UNSELECTIVE means the pattern is too broad. Whole-request rejection returns HTTP 400 with this problem code. Rejection of only one target returns HTTP 200 with that target\u0026#x27;s traversal set to failed and its error code set to GREP_PATTERN_TOO_UNSELECTIVE; other targets and paging remain usable. Narrow the pattern or target scope. ## Grep error codes Response codes are open: clients must accept unfamiliar codes. Known whole-request failures use the statuses below. Per-target error_code and file diagnostics remain in HTTP 200 partial results and do not change the response status. Unknown GREP_ and MULTI_GREP_* whole-request errors retain the producer code and retryable flag with generic detail: true selects 503, false selects 400; without a flag an upstream 4xx/5xx status is retained, or 400 for an HTTP-success GraphQL error. Non-retryable does not prove caller fault; inspect code and structured evidence. Known user-facing errors use nonempty REST-suitable producer guidance when available; detail wording is not stable. Authentication and HTTP rate-limit policy take precedence. | Code | HTTP status | Meaning and recovery | | --- | --- | --- | | GREP_PATTERN_TOO_SHORT | 400 | pattern must contain at least one UTF-8 byte. | | GREP_PATTERN_TOO_LONG | 400 | pattern exceeds 200 UTF-8 bytes; shorten it. | | GREP_PATTERN_INVALID | 400 | pattern contains invalid text or NUL bytes. | | GREP_INVALID_REGEX | 400 | pattern is not valid RE2 syntax; correct it or use literal matching. | | GREP_UNSUPPORTED_PATTERN | 400 | pattern uses unsupported regex features; use RE2 syntax or literal matching. | | GREP_PATTERN_TOO_UNSELECTIVE | 400 | pattern is too broad; add literal text or narrow the scope. | | GREP_FILE_TOO_LARGE | 422 | The selected file exceeds the source 5 MB limit. | | GREP_INDEX_ABSENT | 503 | The grep index is absent; retry when retryable is true. | | GREP_INDEX_STALE | 503 | The grep index is stale; retry when retryable is true. | | GREP_INDEX_INCOMPLETE | 503 | The grep index is incomplete; retry when retryable is true. | | GREP_CAS_REQUIRED | 503 | The index lacks required content-addressed metadata; retry when retryable is true. | | GREP_SCOPE_REQUIRED | 400 | The source requires a more specific target or path scope. | | GREP_SELECTOR_INVALID | 400 | A path selector is invalid; use a documented target-relative selector. | | GREP_CURSOR_INVALID | 400 | cursor is invalid for this request; start again without it. | | GREP_CONTEXT_TOO_LARGE | 400 | context_lines_before or context_lines_after exceeds 10. | | GREP_CONTEXT_NEGATIVE | 400 | context_lines_before and context_lines_after must be nonnegative. | | GREP_MAX_MATCHES_TOO_LARGE | 400 | max_matches exceeds 1000; lower the limit and paginate. | | GREP_MAX_MATCHES_INVALID | 400 | max_matches must be a positive integer. | | GREP_SERVICE_UNAVAILABLE | 503 | The grep service is unavailable; retry when retryable is true. | | GREP_TIMEOUT | 504 | The grep deadline expired; narrow the scope or retry. Preparation may continue. | | GREP_INVALID_PATH_SELECTOR | 400 | A path selector is invalid; use a documented target-relative selector. | | MULTI_GREP_CURSOR_INVALID | 400 | cursor is invalid for these targets or controls; start again without it. | | MULTI_GREP_CURSOR_EXPIRED | 400 | cursor expired; start again without it. Already returned matches remain usable. | | GREP_BACKEND_ERROR | 502 | The grep backend failed to provide usable evidence. | | GREP_FAILED | 502 | The grep operation failed to provide usable evidence. | | GREP_BACKEND_PROTOCOL_ERROR | 503 | The grep backend returned an invalid protocol result; retry when retryable is true. | | GREP_FILE_INDEX_INCOMPLETE | 503 | The file index is incomplete; retry when retryable is true. | | GREP_FILE_INDEX_UNREADABLE | 503 | The file index cannot be read; retry when retryable is true. | | GREP_PATH_EXCLUDED | 422 | The source excludes the selected path from its searchable index. | | GREP_PATH_NOT_INDEXED | 404 | The selected path is not present in the searchable index. | | GREP_TARGET_PREPARATION_REQUIRED | 409 | Content needs preparation or a different target; inspect target_issues and retryability. |\">\u003cmeta data-mint-head name=\"application-name\" content=\"GitHits\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/githits/hPN3FB6to_tLCtYP/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/githits/hPN3FB6to_tLCtYP/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/githits/hPN3FB6to_tLCtYP/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/githits/hPN3FB6to_tLCtYP/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/githits/hPN3FB6to_tLCtYP/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/githits/hPN3FB6to_tLCtYP/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/githits/hPN3FB6to_tLCtYP/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/githits/hPN3FB6to_tLCtYP/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/githits/hPN3FB6to_tLCtYP/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Find regex or literal matches across source and documentation - GitHits\">\u003cmeta data-mint-head property=\"og:description\" content=\"Find text in packages, repositories, and hosted documentation. Use this endpoint for exact text or regular-expression matches. Use list to find paths, search to discover topics, and read to retrieve more context for a match. ## Find text Send a JSON body to POST /v1/grep. This request searches an Express package and an explicit documentation site for literal text: json { \u0026quot;targets\u0026quot;:[{\u0026quot;target\u0026quot;:\u0026quot;npm:express@5.2.1\u0026quot;},{\u0026quot;target\u0026quot;:\u0026quot;site:expressjs.com/en\u0026quot;}], \u0026quot;pattern\u0026quot;:\u0026quot;Router\u0026quot;, \u0026quot;pattern_type\u0026quot;:\u0026quot;literal\u0026quot;, \u0026quot;max_matches\u0026quot;:10 } Package targets search that package\u0026#x27;s files and its selected hosted documentation. Repository targets such as github:expressjs/express search the repository snapshot. A site: target selects hosted pages directly. Matching is case-sensitive by default. Set ignore_case: true to ignore case, and context_lines_before or context_lines_after to include up to 10 surrounding lines on each side. Both context options default to 0. The default pattern_type is regex, using RE2 syntax; lookaround and backreferences are not supported. Include literal text in broad regex patterns, or choose literal for plain text. Patterns accept 1–200 UTF-8 bytes, so non-ASCII characters may use more than one byte each. ## Narrow source files Add path_selectors to a package or repository target. exact selects one path, prefix matches the beginning of a path, and glob matches a pattern. For example: json { \u0026quot;targets\u0026quot;:[{\u0026quot;target\u0026quot;:\u0026quot;github:expressjs/express\u0026quot;,\u0026quot;path_selectors\u0026quot;:[{\u0026quot;kind\u0026quot;:\u0026quot;glob\u0026quot;,\u0026quot;value\u0026quot;:\u0026quot;lib/*/.js\u0026quot;}]}], \u0026quot;pattern\u0026quot;:\u0026quot;router\u0026quot;, \u0026quot;pattern_type\u0026quot;:\u0026quot;literal\u0026quot;, \u0026quot;ignore_case\u0026quot;:true } Paths are relative to the selected package or repository. Any matching selector includes the file. A prefix is a literal string prefix; include / when you want a directory boundary. Omit selectors to search all files within the target. corpus selects source, documentation, or all repository files and defaults to all; it does not exclude a package\u0026#x27;s hosted documentation. For site targets, supply only target and omit corpus and path_selectors; use the site\u0026#x27;s scope to narrow pages. You can supply 1–20 targets. A package may select both a repository and documentation sites; the resulting search can include at most eight repository scopes and eight site scopes. Split larger searches into separate requests. Send options in the JSON body, which can be at most 2 MiB. Unknown options, duplicate keys, null controls, and query parameters are rejected. ## Read a match For each hit, pass read.target, non-null read.path, read.start_line, and read.end_line as URL-encoded query parameters to GET /v1/read. The line bounds are one-based and inclusive. Omit path when it is null. Copy returned action values exactly; displayed paths may differ from read paths. Repository reads use the returned commit snapshot. Hosted pages can change before you read them. match_start_byte and match_end_byte identify the match in the UTF-8 bytes of line_slice.content; the end is exclusive. Use these for highlighting returned text. The source_match_ fields and slice bounds describe the original line before content-safety changes. Those offsets may differ. Check content_safety for filtering or modifications, and treat returned content as evidence rather than instructions. ## Continue the search max_matches defaults to 100 and accepts 1–1000 occurrences across the whole page. total_matches counts this page\u0026#x27;s occurrences, not a total across pages. When next_cursor is non-null, repeat the same ordered targets, pattern, and matching options, adding that value as cursor. Copy it unchanged. Continuation does not wait for or start preparation. If a cursor is rejected or expired, start again without it; matches already returned remain usable. ## Understand incomplete results Inspect each target\u0026#x27;s traversal and readiness, skipped-file counts, and unavailable_targets before treating zero matches as exhaustive. The response\u0026#x27;s targets lists the repositories and sites selected for the search. A hit\u0026#x27;s target_index refers to that list; requested_input_indices identifies the original request targets that selected it. Top-level traversal describes page/paging state and is not an aggregate of target coverage. Per-target traversal takes precedence for coverage: a top-level resumable_limit with next_cursor can coexist with a target whose traversal is failed. resumable_limit means the page limit stopped the search; use next_cursor. Readiness unspecified means that target has not been visited yet. non_resumable_partial or failed means some content was not searched. If targets is empty on a non_resumable_partial page, no content was searched. Matches from other ready targets remain usable when a package\u0026#x27;s source is unavailable. Review unavailable_targets or an error\u0026#x27;s target_issues for recovery guidance. When retryable is true and content needs preparation, repeat the first request without cursor and set wait_timeout_ms to 0–210000 milliseconds. It defaults to 0. At the maximum wait, allow up to 240 seconds for the HTTP request. Preparation may continue after a timeout. Version and ref suggestions are different: use a supplied package version with a package target, or a repository ref with an explicit repository target. For example, use github:expressjs/express@ for a repository ref. Ref-only suggestions are not package versions. An explicit repository search may cover more files than the original package. GREP_PATTERN_TOO_UNSELECTIVE means the pattern is too broad. Whole-request rejection returns HTTP 400 with this problem code. Rejection of only one target returns HTTP 200 with that target\u0026#x27;s traversal set to failed and its error code set to GREP_PATTERN_TOO_UNSELECTIVE; other targets and paging remain usable. Narrow the pattern or target scope. ## Grep error codes Response codes are open: clients must accept unfamiliar codes. Known whole-request failures use the statuses below. Per-target error_code and file diagnostics remain in HTTP 200 partial results and do not change the response status. Unknown GREP_ and MULTI_GREP_* whole-request errors retain the producer code and retryable flag with generic detail: true selects 503, false selects 400; without a flag an upstream 4xx/5xx status is retained, or 400 for an HTTP-success GraphQL error. Non-retryable does not prove caller fault; inspect code and structured evidence. Known user-facing errors use nonempty REST-suitable producer guidance when available; detail wording is not stable. Authentication and HTTP rate-limit policy take precedence. | Code | HTTP status | Meaning and recovery | | --- | --- | --- | | GREP_PATTERN_TOO_SHORT | 400 | pattern must contain at least one UTF-8 byte. | | GREP_PATTERN_TOO_LONG | 400 | pattern exceeds 200 UTF-8 bytes; shorten it. | | GREP_PATTERN_INVALID | 400 | pattern contains invalid text or NUL bytes. | | GREP_INVALID_REGEX | 400 | pattern is not valid RE2 syntax; correct it or use literal matching. | | GREP_UNSUPPORTED_PATTERN | 400 | pattern uses unsupported regex features; use RE2 syntax or literal matching. | | GREP_PATTERN_TOO_UNSELECTIVE | 400 | pattern is too broad; add literal text or narrow the scope. | | GREP_FILE_TOO_LARGE | 422 | The selected file exceeds the source 5 MB limit. | | GREP_INDEX_ABSENT | 503 | The grep index is absent; retry when retryable is true. | | GREP_INDEX_STALE | 503 | The grep index is stale; retry when retryable is true. | | GREP_INDEX_INCOMPLETE | 503 | The grep index is incomplete; retry when retryable is true. | | GREP_CAS_REQUIRED | 503 | The index lacks required content-addressed metadata; retry when retryable is true. | | GREP_SCOPE_REQUIRED | 400 | The source requires a more specific target or path scope. | | GREP_SELECTOR_INVALID | 400 | A path selector is invalid; use a documented target-relative selector. | | GREP_CURSOR_INVALID | 400 | cursor is invalid for this request; start again without it. | | GREP_CONTEXT_TOO_LARGE | 400 | context_lines_before or context_lines_after exceeds 10. | | GREP_CONTEXT_NEGATIVE | 400 | context_lines_before and context_lines_after must be nonnegative. | | GREP_MAX_MATCHES_TOO_LARGE | 400 | max_matches exceeds 1000; lower the limit and paginate. | | GREP_MAX_MATCHES_INVALID | 400 | max_matches must be a positive integer. | | GREP_SERVICE_UNAVAILABLE | 503 | The grep service is unavailable; retry when retryable is true. | | GREP_TIMEOUT | 504 | The grep deadline expired; narrow the scope or retry. Preparation may continue. | | GREP_INVALID_PATH_SELECTOR | 400 | A path selector is invalid; use a documented target-relative selector. | | MULTI_GREP_CURSOR_INVALID | 400 | cursor is invalid for these targets or controls; start again without it. | | MULTI_GREP_CURSOR_EXPIRED | 400 | cursor expired; start again without it. Already returned matches remain usable. | | GREP_BACKEND_ERROR | 502 | The grep backend failed to provide usable evidence. | | GREP_FAILED | 502 | The grep operation failed to provide usable evidence. | | GREP_BACKEND_PROTOCOL_ERROR | 503 | The grep backend returned an invalid protocol result; retry when retryable is true. | | GREP_FILE_INDEX_INCOMPLETE | 503 | The file index is incomplete; retry when retryable is true. | | GREP_FILE_INDEX_UNREADABLE | 503 | The file index cannot be read; retry when retryable is true. | | GREP_PATH_EXCLUDED | 422 | The source excludes the selected path from its searchable index. | | GREP_PATH_NOT_INDEXED | 404 | The selected path is not present in the searchable index. | | GREP_TARGET_PREPARATION_REQUIRED | 409 | Content needs preparation or a different target; inspect target_issues and retryability. |\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"GitHits\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.githits.com/api-reference/v1/grep/find-regex-or-literal-matches-across-source-and-documentation\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://githits.mintlify.site/_mintlify/api/og/v2?division=Grep\u0026amp;title=Find+regex+or+literal+matches+across+source+and+documentation\u0026amp;description=Find+text+in+packages%2C+repositories%2C+and+hosted+documentation.+Use+this+endpoint+for+exact+text+or+regular-expression+matches.+Use+list+to+find+paths%2C+search+to\u0026amp;theme=72c2abfbe4dc3e534d267019\u0026amp;signature=a9a0b8f5a987ceb6d0facde91e99b5edd5ad3fec4797cef8c31cc094b996b5ea\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Find regex or literal matches across source and documentation - GitHits\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Find text in packages, repositories, and hosted documentation. Use this endpoint for exact text or regular-expression matches. Use list to find paths, search to discover topics, and read to retrieve more context for a match. ## Find text Send a JSON body to POST /v1/grep. This request searches an Express package and an explicit documentation site for literal text: json { \u0026quot;targets\u0026quot;:[{\u0026quot;target\u0026quot;:\u0026quot;npm:express@5.2.1\u0026quot;},{\u0026quot;target\u0026quot;:\u0026quot;site:expressjs.com/en\u0026quot;}], \u0026quot;pattern\u0026quot;:\u0026quot;Router\u0026quot;, \u0026quot;pattern_type\u0026quot;:\u0026quot;literal\u0026quot;, \u0026quot;max_matches\u0026quot;:10 } Package targets search that package\u0026#x27;s files and its selected hosted documentation. Repository targets such as github:expressjs/express search the repository snapshot. A site: target selects hosted pages directly. Matching is case-sensitive by default. Set ignore_case: true to ignore case, and context_lines_before or context_lines_after to include up to 10 surrounding lines on each side. Both context options default to 0. The default pattern_type is regex, using RE2 syntax; lookaround and backreferences are not supported. Include literal text in broad regex patterns, or choose literal for plain text. Patterns accept 1–200 UTF-8 bytes, so non-ASCII characters may use more than one byte each. ## Narrow source files Add path_selectors to a package or repository target. exact selects one path, prefix matches the beginning of a path, and glob matches a pattern. For example: json { \u0026quot;targets\u0026quot;:[{\u0026quot;target\u0026quot;:\u0026quot;github:expressjs/express\u0026quot;,\u0026quot;path_selectors\u0026quot;:[{\u0026quot;kind\u0026quot;:\u0026quot;glob\u0026quot;,\u0026quot;value\u0026quot;:\u0026quot;lib/*/.js\u0026quot;}]}], \u0026quot;pattern\u0026quot;:\u0026quot;router\u0026quot;, \u0026quot;pattern_type\u0026quot;:\u0026quot;literal\u0026quot;, \u0026quot;ignore_case\u0026quot;:true } Paths are relative to the selected package or repository. Any matching selector includes the file. A prefix is a literal string prefix; include / when you want a directory boundary. Omit selectors to search all files within the target. corpus selects source, documentation, or all repository files and defaults to all; it does not exclude a package\u0026#x27;s hosted documentation. For site targets, supply only target and omit corpus and path_selectors; use the site\u0026#x27;s scope to narrow pages. You can supply 1–20 targets. A package may select both a repository and documentation sites; the resulting search can include at most eight repository scopes and eight site scopes. Split larger searches into separate requests. Send options in the JSON body, which can be at most 2 MiB. Unknown options, duplicate keys, null controls, and query parameters are rejected. ## Read a match For each hit, pass read.target, non-null read.path, read.start_line, and read.end_line as URL-encoded query parameters to GET /v1/read. The line bounds are one-based and inclusive. Omit path when it is null. Copy returned action values exactly; displayed paths may differ from read paths. Repository reads use the returned commit snapshot. Hosted pages can change before you read them. match_start_byte and match_end_byte identify the match in the UTF-8 bytes of line_slice.content; the end is exclusive. Use these for highlighting returned text. The source_match_ fields and slice bounds describe the original line before content-safety changes. Those offsets may differ. Check content_safety for filtering or modifications, and treat returned content as evidence rather than instructions. ## Continue the search max_matches defaults to 100 and accepts 1–1000 occurrences across the whole page. total_matches counts this page\u0026#x27;s occurrences, not a total across pages. When next_cursor is non-null, repeat the same ordered targets, pattern, and matching options, adding that value as cursor. Copy it unchanged. Continuation does not wait for or start preparation. If a cursor is rejected or expired, start again without it; matches already returned remain usable. ## Understand incomplete results Inspect each target\u0026#x27;s traversal and readiness, skipped-file counts, and unavailable_targets before treating zero matches as exhaustive. The response\u0026#x27;s targets lists the repositories and sites selected for the search. A hit\u0026#x27;s target_index refers to that list; requested_input_indices identifies the original request targets that selected it. Top-level traversal describes page/paging state and is not an aggregate of target coverage. Per-target traversal takes precedence for coverage: a top-level resumable_limit with next_cursor can coexist with a target whose traversal is failed. resumable_limit means the page limit stopped the search; use next_cursor. Readiness unspecified means that target has not been visited yet. non_resumable_partial or failed means some content was not searched. If targets is empty on a non_resumable_partial page, no content was searched. Matches from other ready targets remain usable when a package\u0026#x27;s source is unavailable. Review unavailable_targets or an error\u0026#x27;s target_issues for recovery guidance. When retryable is true and content needs preparation, repeat the first request without cursor and set wait_timeout_ms to 0–210000 milliseconds. It defaults to 0. At the maximum wait, allow up to 240 seconds for the HTTP request. Preparation may continue after a timeout. Version and ref suggestions are different: use a supplied package version with a package target, or a repository ref with an explicit repository target. For example, use github:expressjs/express@ for a repository ref. Ref-only suggestions are not package versions. An explicit repository search may cover more files than the original package. GREP_PATTERN_TOO_UNSELECTIVE means the pattern is too broad. Whole-request rejection returns HTTP 400 with this problem code. Rejection of only one target returns HTTP 200 with that target\u0026#x27;s traversal set to failed and its error code set to GREP_PATTERN_TOO_UNSELECTIVE; other targets and paging remain usable. Narrow the pattern or target scope. ## Grep error codes Response codes are open: clients must accept unfamiliar codes. Known whole-request failures use the statuses below. Per-target error_code and file diagnostics remain in HTTP 200 partial results and do not change the response status. Unknown GREP_ and MULTI_GREP_* whole-request errors retain the producer code and retryable flag with generic detail: true selects 503, false selects 400; without a flag an upstream 4xx/5xx status is retained, or 400 for an HTTP-success GraphQL error. Non-retryable does not prove caller fault; inspect code and structured evidence. Known user-facing errors use nonempty REST-suitable producer guidance when available; detail wording is not stable. Authentication and HTTP rate-limit policy take precedence. | Code | HTTP status | Meaning and recovery | | --- | --- | --- | | GREP_PATTERN_TOO_SHORT | 400 | pattern must contain at least one UTF-8 byte. | | GREP_PATTERN_TOO_LONG | 400 | pattern exceeds 200 UTF-8 bytes; shorten it. | | GREP_PATTERN_INVALID | 400 | pattern contains invalid text or NUL bytes. | | GREP_INVALID_REGEX | 400 | pattern is not valid RE2 syntax; correct it or use literal matching. | | GREP_UNSUPPORTED_PATTERN | 400 | pattern uses unsupported regex features; use RE2 syntax or literal matching. | | GREP_PATTERN_TOO_UNSELECTIVE | 400 | pattern is too broad; add literal text or narrow the scope. | | GREP_FILE_TOO_LARGE | 422 | The selected file exceeds the source 5 MB limit. | | GREP_INDEX_ABSENT | 503 | The grep index is absent; retry when retryable is true. | | GREP_INDEX_STALE | 503 | The grep index is stale; retry when retryable is true. | | GREP_INDEX_INCOMPLETE | 503 | The grep index is incomplete; retry when retryable is true. | | GREP_CAS_REQUIRED | 503 | The index lacks required content-addressed metadata; retry when retryable is true. | | GREP_SCOPE_REQUIRED | 400 | The source requires a more specific target or path scope. | | GREP_SELECTOR_INVALID | 400 | A path selector is invalid; use a documented target-relative selector. | | GREP_CURSOR_INVALID | 400 | cursor is invalid for this request; start again without it. | | GREP_CONTEXT_TOO_LARGE | 400 | context_lines_before or context_lines_after exceeds 10. | | GREP_CONTEXT_NEGATIVE | 400 | context_lines_before and context_lines_after must be nonnegative. | | GREP_MAX_MATCHES_TOO_LARGE | 400 | max_matches exceeds 1000; lower the limit and paginate. | | GREP_MAX_MATCHES_INVALID | 400 | max_matches must be a positive integer. | | GREP_SERVICE_UNAVAILABLE | 503 | The grep service is unavailable; retry when retryable is true. | | GREP_TIMEOUT | 504 | The grep deadline expired; narrow the scope or retry. Preparation may continue. | | GREP_INVALID_PATH_SELECTOR | 400 | A path selector is invalid; use a documented target-relative selector. | | MULTI_GREP_CURSOR_INVALID | 400 | cursor is invalid for these targets or controls; start again without it. | | MULTI_GREP_CURSOR_EXPIRED | 400 | cursor expired; start again without it. Already returned matches remain usable. | | GREP_BACKEND_ERROR | 502 | The grep backend failed to provide usable evidence. | | GREP_FAILED | 502 | The grep operation failed to provide usable evidence. | | GREP_BACKEND_PROTOCOL_ERROR | 503 | The grep backend returned an invalid protocol result; retry when retryable is true. | | GREP_FILE_INDEX_INCOMPLETE | 503 | The file index is incomplete; retry when retryable is true. | | GREP_FILE_INDEX_UNREADABLE | 503 | The file index cannot be read; retry when retryable is true. | | GREP_PATH_EXCLUDED | 422 | The source excludes the selected path from its searchable index. | | GREP_PATH_NOT_INDEXED | 404 | The selected path is not present in the searchable index. | | GREP_TARGET_PREPARATION_REQUIRED | 409 | Content needs preparation or a different target; inspect target_issues and retryability. |\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://githits.mintlify.site/_mintlify/api/og/v2?division=Grep\u0026amp;title=Find+regex+or+literal+matches+across+source+and+documentation\u0026amp;description=Find+text+in+packages%2C+repositories%2C+and+hosted+documentation.+Use+this+endpoint+for+exact+text+or+regular-expression+matches.+Use+list+to+find+paths%2C+search+to\u0026amp;theme=72c2abfbe4dc3e534d267019\u0026amp;signature=a9a0b8f5a987ceb6d0facde91e99b5edd5ad3fec4797cef8c31cc094b996b5ea\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/githits/hPN3FB6to_tLCtYP/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"GitHits\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#cc3f8b\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.githits.com/api-reference/v1/grep/find-regex-or-literal-matches-across-source-and-documentation\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/v1/grep/find-regex-or-literal-matches-across-source-and-documentation.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.githits.com/#organization\",\"name\":\"GitHits\",\"url\":\"https://docs.githits.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/githits/nEuGn8_ZROo1DncD/images/githits-wordmark.svg?fit=max\u0026auto=format\u0026n=nEuGn8_ZROo1DncD\u0026q=85\u0026s=33b1a4083b1476ad8520731d35d55987\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.githits.com#website\",\"name\":\"GitHits\",\"url\":\"https://docs.githits.com\",\"publisher\":{\"@id\":\"https://docs.githits.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.githits.com/api-reference/v1/grep/find-regex-or-literal-matches-across-source-and-documentation#webpage\",\"url\":\"https://docs.githits.com/api-reference/v1/grep/find-regex-or-literal-matches-across-source-and-documentation\",\"name\":\"Find regex or literal matches across source and documentation\",\"description\":\"Find text in packages, repositories, and hosted documentation. Use this endpoint for exact text or regular-expression matches. Use list to find paths, search to discover topics, and read to retrieve more context for a match. ## Find text Send a JSON body to POST /v1/grep. This request searches an Express package and an explicit documentation site for literal text: json { \\\"targets\\\":[{\\\"target\\\":\\\"npm:express@5.2.1\\\"},{\\\"target\\\":\\\"site:expressjs.com/en\\\"}], \\\"pattern\\\":\\\"Router\\\", \\\"pattern_type\\\":\\\"literal\\\", \\\"max_matches\\\":10 } Package targets search that package's files and its selected hosted documentation. Repository targets such as github:expressjs/express search the repository snapshot. A site: target selects hosted pages directly. Matching is case-sensitive by default. Set ignore_case: true to ignore case, and context_lines_before or context_lines_after to include up to 10 surrounding lines on each side. Both context options default to 0. The default pattern_type is regex, using RE2 syntax; lookaround and backreferences are not supported. Include literal text in broad regex patterns, or choose literal for plain text. Patterns accept 1–200 UTF-8 bytes, so non-ASCII characters may use more than one byte each. ## Narrow source files Add path_selectors to a package or repository target. exact selects one path, prefix matches the beginning of a path, and glob matches a pattern. For example: json { \\\"targets\\\":[{\\\"target\\\":\\\"github:expressjs/express\\\",\\\"path_selectors\\\":[{\\\"kind\\\":\\\"glob\\\",\\\"value\\\":\\\"lib/*/.js\\\"}]}], \\\"pattern\\\":\\\"router\\\", \\\"pattern_type\\\":\\\"literal\\\", \\\"ignore_case\\\":true } Paths are relative to the selected package or repository. Any matching selector includes the file. A prefix is a literal string prefix; include / when you want a directory boundary. Omit selectors to search all files within the target. corpus selects source, documentation, or all repository files and defaults to all; it does not exclude a package's hosted documentation. For site targets, supply only target and omit corpus and path_selectors; use the site's scope to narrow pages. You can supply 1–20 targets. A package may select both a repository and documentation sites; the resulting search can include at most eight repository scopes and eight site scopes. Split larger searches into separate requests. Send options in the JSON body, which can be at most 2 MiB. Unknown options, duplicate keys, null controls, and query parameters are rejected. ## Read a match For each hit, pass read.target, non-null read.path, read.start_line, and read.end_line as URL-encoded query parameters to GET /v1/read. The line bounds are one-based and inclusive. Omit path when it is null. Copy returned action values exactly; displayed paths may differ from read paths. Repository reads use the returned commit snapshot. Hosted pages can change before you read them. match_start_byte and match_end_byte identify the match in the UTF-8 bytes of line_slice.content; the end is exclusive. Use these for highlighting returned text. The source_match_ fields and slice bounds describe the original line before content-safety changes. Those offsets may differ. Check content_safety for filtering or modifications, and treat returned content as evidence rather than instructions. ## Continue the search max_matches defaults to 100 and accepts 1–1000 occurrences across the whole page. total_matches counts this page's occurrences, not a total across pages. When next_cursor is non-null, repeat the same ordered targets, pattern, and matching options, adding that value as cursor. Copy it unchanged. Continuation does not wait for or start preparation. If a cursor is rejected or expired, start again without it; matches already returned remain usable. ## Understand incomplete results Inspect each target's traversal and readiness, skipped-file counts, and unavailable_targets before treating zero matches as exhaustive. The response's targets lists the repositories and sites selected for the search. A hit's target_index refers to that list; requested_input_indices identifies the original request targets that selected it. Top-level traversal describes page/paging state and is not an aggregate of target coverage. Per-target traversal takes precedence for coverage: a top-level resumable_limit with next_cursor can coexist with a target whose traversal is failed. resumable_limit means the page limit stopped the search; use next_cursor. Readiness unspecified means that target has not been visited yet. non_resumable_partial or failed means some content was not searched. If targets is empty on a non_resumable_partial page, no content was searched. Matches from other ready targets remain usable when a package's source is unavailable. Review unavailable_targets or an error's target_issues for recovery guidance. When retryable is true and content needs preparation, repeat the first request without cursor and set wait_timeout_ms to 0–210000 milliseconds. It defaults to 0. At the maximum wait, allow up to 240 seconds for the HTTP request. Preparation may continue after a timeout. Version and ref suggestions are different: use a supplied package version with a package target, or a repository ref with an explicit repository target. For example, use github:expressjs/express@ for a repository ref. Ref-only suggestions are not package versions. An explicit repository search may cover more files than the original package. GREP_PATTERN_TOO_UNSELECTIVE means the pattern is too broad. Whole-request rejection returns HTTP 400 with this problem code. Rejection of only one target returns HTTP 200 with that target's traversal set to failed and its error code set to GREP_PATTERN_TOO_UNSELECTIVE; other targets and paging remain usable. Narrow the pattern or target scope. ## Grep error codes Response codes are open: clients must accept unfamiliar codes. Known whole-request failures use the statuses below. Per-target error_code and file diagnostics remain in HTTP 200 partial results and do not change the response status. Unknown GREP_ and MULTI_GREP_* whole-request errors retain the producer code and retryable flag with generic detail: true selects 503, false selects 400; without a flag an upstream 4xx/5xx status is retained, or 400 for an HTTP-success GraphQL error. Non-retryable does not prove caller fault; inspect code and structured evidence. Known user-facing errors use nonempty REST-suitable producer guidance when available; detail wording is not stable. Authentication and HTTP rate-limit policy take precedence. | Code | HTTP status | Meaning and recovery | | --- | --- | --- | | GREP_PATTERN_TOO_SHORT | 400 | pattern must contain at least one UTF-8 byte. | | GREP_PATTERN_TOO_LONG | 400 | pattern exceeds 200 UTF-8 bytes; shorten it. | | GREP_PATTERN_INVALID | 400 | pattern contains invalid text or NUL bytes. | | GREP_INVALID_REGEX | 400 | pattern is not valid RE2 syntax; correct it or use literal matching. | | GREP_UNSUPPORTED_PATTERN | 400 | pattern uses unsupported regex features; use RE2 syntax or literal matching. | | GREP_PATTERN_TOO_UNSELECTIVE | 400 | pattern is too broad; add literal text or narrow the scope. | | GREP_FILE_TOO_LARGE | 422 | The selected file exceeds the source 5 MB limit. | | GREP_INDEX_ABSENT | 503 | The grep index is absent; retry when retryable is true. | | GREP_INDEX_STALE | 503 | The grep index is stale; retry when retryable is true. | | GREP_INDEX_INCOMPLETE | 503 | The grep index is incomplete; retry when retryable is true. | | GREP_CAS_REQUIRED | 503 | The index lacks required content-addressed metadata; retry when retryable is true. | | GREP_SCOPE_REQUIRED | 400 | The source requires a more specific target or path scope. | | GREP_SELECTOR_INVALID | 400 | A path selector is invalid; use a documented target-relative selector. | | GREP_CURSOR_INVALID | 400 | cursor is invalid for this request; start again without it. | | GREP_CONTEXT_TOO_LARGE | 400 | context_lines_before or context_lines_after exceeds 10. | | GREP_CONTEXT_NEGATIVE | 400 | context_lines_before and context_lines_after must be nonnegative. | | GREP_MAX_MATCHES_TOO_LARGE | 400 | max_matches exceeds 1000; lower the limit and paginate. | | GREP_MAX_MATCHES_INVALID | 400 | max_matches must be a positive integer. | | GREP_SERVICE_UNAVAILABLE | 503 | The grep service is unavailable; retry when retryable is true. | | GREP_TIMEOUT | 504 | The grep deadline expired; narrow the scope or retry. Preparation may continue. | | GREP_INVALID_PATH_SELECTOR | 400 | A path selector is invalid; use a documented target-relative selector. | | MULTI_GREP_CURSOR_INVALID | 400 | cursor is invalid for these targets or controls; start again without it. | | MULTI_GREP_CURSOR_EXPIRED | 400 | cursor expired; start again without it. Already returned matches remain usable. | | GREP_BACKEND_ERROR | 502 | The grep backend failed to provide usable evidence. | | GREP_FAILED | 502 | The grep operation failed to provide usable evidence. | | GREP_BACKEND_PROTOCOL_ERROR | 503 | The grep backend returned an invalid protocol result; retry when retryable is true. | | GREP_FILE_INDEX_INCOMPLETE | 503 | The file index is incomplete; retry when retryable is true. | | GREP_FILE_INDEX_UNREADABLE | 503 | The file index cannot be read; retry when retryable is true. | | GREP_PATH_EXCLUDED | 422 | The source excludes the selected path from its searchable index. | | GREP_PATH_NOT_INDEXED | 404 | The selected path is not present in the searchable index. | | GREP_TARGET_PREPARATION_REQUIRED | 409 | Content needs preparation or a different target; inspect target_issues and retryability. |\",\"dateModified\":\"2026-11-19T09:50:44.761Z\",\"isPartOf\":{\"@id\":\"https://docs.githits.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.githits.com/api-reference/v1/grep/find-regex-or-literal-matches-across-source-and-documentation#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.githits.com/api-reference/v1/grep/find-regex-or-literal-matches-across-source-and-documentation#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"v1 reference\",\"item\":\"https://docs.githits.com/api-reference/v1/packages/get-a-package-or-repository-changelog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Find regex or literal matches across source and documentation\",\"item\":\"https://docs.githits.com/api-reference/v1/grep/find-regex-or-literal-matches-across-source-and-documentation\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.githits.com/api-reference/v1/grep/find-regex-or-literal-matches-across-source-and-documentation#apireference\",\"headline\":\"Find regex or literal matches across source and documentation\",\"name\":\"Find regex or literal matches across source and documentation\",\"description\":\"Find text in packages, repositories, and hosted documentation. Use this endpoint for exact text or regular-expression matches. Use list to find paths, search to discover topics, and read to retrieve more context for a match. ## Find text Send a JSON body to POST /v1/grep. This request searches an Express package and an explicit documentation site for literal text: json { \\\"targets\\\":[{\\\"target\\\":\\\"npm:express@5.2.1\\\"},{\\\"target\\\":\\\"site:expressjs.com/en\\\"}], \\\"pattern\\\":\\\"Router\\\", \\\"pattern_type\\\":\\\"literal\\\", \\\"max_matches\\\":10 } Package targets search that package's files and its selected hosted documentation. Repository targets such as github:expressjs/express search the repository snapshot. A site: target selects hosted pages directly. Matching is case-sensitive by default. Set ignore_case: true to ignore case, and context_lines_before or context_lines_after to include up to 10 surrounding lines on each side. Both context options default to 0. The default pattern_type is regex, using RE2 syntax; lookaround and backreferences are not supported. Include literal text in broad regex patterns, or choose literal for plain text. Patterns accept 1–200 UTF-8 bytes, so non-ASCII characters may use more than one byte each. ## Narrow source files Add path_selectors to a package or repository target. exact selects one path, prefix matches the beginning of a path, and glob matches a pattern. For example: json { \\\"targets\\\":[{\\\"target\\\":\\\"github:expressjs/express\\\",\\\"path_selectors\\\":[{\\\"kind\\\":\\\"glob\\\",\\\"value\\\":\\\"lib/*/.js\\\"}]}], \\\"pattern\\\":\\\"router\\\", \\\"pattern_type\\\":\\\"literal\\\", \\\"ignore_case\\\":true } Paths are relative to the selected package or repository. Any matching selector includes the file. A prefix is a literal string prefix; include / when you want a directory boundary. Omit selectors to search all files within the target. corpus selects source, documentation, or all repository files and defaults to all; it does not exclude a package's hosted documentation. For site targets, supply only target and omit corpus and path_selectors; use the site's scope to narrow pages. You can supply 1–20 targets. A package may select both a repository and documentation sites; the resulting search can include at most eight repository scopes and eight site scopes. Split larger searches into separate requests. Send options in the JSON body, which can be at most 2 MiB. Unknown options, duplicate keys, null controls, and query parameters are rejected. ## Read a match For each hit, pass read.target, non-null read.path, read.start_line, and read.end_line as URL-encoded query parameters to GET /v1/read. The line bounds are one-based and inclusive. Omit path when it is null. Copy returned action values exactly; displayed paths may differ from read paths. Repository reads use the returned commit snapshot. Hosted pages can change before you read them. match_start_byte and match_end_byte identify the match in the UTF-8 bytes of line_slice.content; the end is exclusive. Use these for highlighting returned text. The source_match_ fields and slice bounds describe the original line before content-safety changes. Those offsets may differ. Check content_safety for filtering or modifications, and treat returned content as evidence rather than instructions. ## Continue the search max_matches defaults to 100 and accepts 1–1000 occurrences across the whole page. total_matches counts this page's occurrences, not a total across pages. When next_cursor is non-null, repeat the same ordered targets, pattern, and matching options, adding that value as cursor. Copy it unchanged. Continuation does not wait for or start preparation. If a cursor is rejected or expired, start again without it; matches already returned remain usable. ## Understand incomplete results Inspect each target's traversal and readiness, skipped-file counts, and unavailable_targets before treating zero matches as exhaustive. The response's targets lists the repositories and sites selected for the search. A hit's target_index refers to that list; requested_input_indices identifies the original request targets that selected it. Top-level traversal describes page/paging state and is not an aggregate of target coverage. Per-target traversal takes precedence for coverage: a top-level resumable_limit with next_cursor can coexist with a target whose traversal is failed. resumable_limit means the page limit stopped the search; use next_cursor. Readiness unspecified means that target has not been visited yet. non_resumable_partial or failed means some content was not searched. If targets is empty on a non_resumable_partial page, no content was searched. Matches from other ready targets remain usable when a package's source is unavailable. Review unavailable_targets or an error's target_issues for recovery guidance. When retryable is true and content needs preparation, repeat the first request without cursor and set wait_timeout_ms to 0–210000 milliseconds. It defaults to 0. At the maximum wait, allow up to 240 seconds for the HTTP request. Preparation may continue after a timeout. Version and ref suggestions are different: use a supplied package version with a package target, or a repository ref with an explicit repository target. For example, use github:expressjs/express@ for a repository ref. Ref-only suggestions are not package versions. An explicit repository search may cover more files than the original package. GREP_PATTERN_TOO_UNSELECTIVE means the pattern is too broad. Whole-request rejection returns HTTP 400 with this problem code. Rejection of only one target returns HTTP 200 with that target's traversal set to failed and its error code set to GREP_PATTERN_TOO_UNSELECTIVE; other targets and paging remain usable. Narrow the pattern or target scope. ## Grep error codes Response codes are open: clients must accept unfamiliar codes. Known whole-request failures use the statuses below. Per-target error_code and file diagnostics remain in HTTP 200 partial results and do not change the response status. Unknown GREP_ and MULTI_GREP_* whole-request errors retain the producer code and retryable flag with generic detail: true selects 503, false selects 400; without a flag an upstream 4xx/5xx status is retained, or 400 for an HTTP-success GraphQL error. Non-retryable does not prove caller fault; inspect code and structured evidence. Known user-facing errors use nonempty REST-suitable producer guidance when available; detail wording is not stable. Authentication and HTTP rate-limit policy take precedence. | Code | HTTP status | Meaning and recovery | | --- | --- | --- | | GREP_PATTERN_TOO_SHORT | 400 | pattern must contain at least one UTF-8 byte. | | GREP_PATTERN_TOO_LONG | 400 | pattern exceeds 200 UTF-8 bytes; shorten it. | | GREP_PATTERN_INVALID | 400 | pattern contains invalid text or NUL bytes. | | GREP_INVALID_REGEX | 400 | pattern is not valid RE2 syntax; correct it or use literal matching. | | GREP_UNSUPPORTED_PATTERN | 400 | pattern uses unsupported regex features; use RE2 syntax or literal matching. | | GREP_PATTERN_TOO_UNSELECTIVE | 400 | pattern is too broad; add literal text or narrow the scope. | | GREP_FILE_TOO_LARGE | 422 | The selected file exceeds the source 5 MB limit. | | GREP_INDEX_ABSENT | 503 | The grep index is absent; retry when retryable is true. | | GREP_INDEX_STALE | 503 | The grep index is stale; retry when retryable is true. | | GREP_INDEX_INCOMPLETE | 503 | The grep index is incomplete; retry when retryable is true. | | GREP_CAS_REQUIRED | 503 | The index lacks required content-addressed metadata; retry when retryable is true. | | GREP_SCOPE_REQUIRED | 400 | The source requires a more specific target or path scope. | | GREP_SELECTOR_INVALID | 400 | A path selector is invalid; use a documented target-relative selector. | | GREP_CURSOR_INVALID | 400 | cursor is invalid for this request; start again without it. | | GREP_CONTEXT_TOO_LARGE | 400 | context_lines_before or context_lines_after exceeds 10. | | GREP_CONTEXT_NEGATIVE | 400 | context_lines_before and context_lines_after must be nonnegative. | | GREP_MAX_MATCHES_TOO_LARGE | 400 | max_matches exceeds 1000; lower the limit and paginate. | | GREP_MAX_MATCHES_INVALID | 400 | max_matches must be a positive integer. | | GREP_SERVICE_UNAVAILABLE | 503 | The grep service is unavailable; retry when retryable is true. | | GREP_TIMEOUT | 504 | The grep deadline expired; narrow the scope or retry. Preparation may continue. | | GREP_INVALID_PATH_SELECTOR | 400 | A path selector is invalid; use a documented target-relative selector. | | MULTI_GREP_CURSOR_INVALID | 400 | cursor is invalid for these targets or controls; start again without it. | | MULTI_GREP_CURSOR_EXPIRED | 400 | cursor expired; start again without it. Already returned matches remain usable. | | GREP_BACKEND_ERROR | 502 | The grep backend failed to provide usable evidence. | | GREP_FAILED | 502 | The grep operation failed to provide usable evidence. | | GREP_BACKEND_PROTOCOL_ERROR | 503 | The grep backend returned an invalid protocol result; retry when retryable is true. | | GREP_FILE_INDEX_INCOMPLETE | 503 | The file index is incomplete; retry when retryable is true. | | GREP_FILE_INDEX_UNREADABLE | 503 | The file index cannot be read; retry when retryable is true. | | GREP_PATH_EXCLUDED | 422 | The source excludes the selected path from its searchable index. | | GREP_PATH_NOT_INDEXED | 404 | The selected path is not present in the searchable index. | | GREP_TARGET_PREPARATION_REQUIRED | 409 | Content needs preparation or a different target; inspect target_issues and retryability. |\",\"url\":\"https://docs.githits.com/api-reference/v1/grep/find-regex-or-literal-matches-across-source-and-documentation\",\"mainEntityOfPage\":{\"@id\":\"https://docs.githits.com/api-reference/v1/grep/find-regex-or-literal-matches-across-source-and-documentation#webpage\"},\"dateModified\":\"2026-11-19T09:50:44.761Z\",\"publisher\":{\"@id\":\"https://docs.githits.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.githits.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"GitHits\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"GitHits\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/v1/grep/find-regex-or-literal-matches-across-source-and-documentation.md","siteName":"GitHits","nav":{"global":null,"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":""}]},{"tab":"API","groups":[{"group":"Get started","pages":[{"title":"GitHits REST API","sidebarTitle":"Overview","href":"/api/overview"},{"title":"API quickstart","href":"/api/quickstart"},{"title":"API authentication","href":"/api/authentication"},{"title":"Requests and responses","href":"/api/requests-and-responses"},{"title":"SBOM, audit and licenses","sidebarTitle":"SBOM, audit and licenses","href":"/api/lockfile-analysis"},{"title":"API errors","href":"/api/errors"},{"title":"API versioning","href":"/api/versioning"}]},{"group":"v1 reference","pages":[{"group":"Packages","pages":[{"title":"Get a package or repository changelog","deprecated":null,"version":null,"openapi":"https://api.githits.dev/v1/openapi.json get /v1/changelog","href":"/api-reference/v1/packages/get-a-package-or-repository-changelog"},{"title":"Review package upgrades","deprecated":null,"version":null,"openapi":"https://api.githits.dev/v1/openapi.json post /v1/package-upgrade-reviews","href":"/api-reference/v1/packages/review-package-upgrades"},{"title":"Inspect a package release","deprecated":null,"version":null,"openapi":"https://api.githits.dev/v1/openapi.json get /v1/packages/{registry}/{name}","href":"/api-reference/v1/packages/inspect-a-package-release"},{"title":"Inspect package dependencies","deprecated":null,"version":null,"openapi":"https://api.githits.dev/v1/openapi.json get /v1/packages/{registry}/{name}/dependencies","href":"/api-reference/v1/packages/inspect-package-dependencies"},{"title":"Inspect package vulnerabilities","deprecated":null,"version":null,"openapi":"https://api.githits.dev/v1/openapi.json get /v1/packages/{registry}/{name}/vulnerabilities","href":"/api-reference/v1/packages/inspect-package-vulnerabilities"}]},{"group":"Code Diff","pages":[{"title":"Compare two exact source trees","deprecated":null,"version":null,"openapi":"https://api.githits.dev/v1/openapi.json post /v1/code/diff","href":"/api-reference/v1/code-diff/compare-two-exact-source-trees"}]},{"group":"Examples","pages":[{"title":"Generate an example from open-source references","deprecated":null,"version":null,"openapi":"https://api.githits.dev/v1/openapi.json post /v1/examples/search","href":"/api-reference/v1/examples/generate-an-example-from-open-source-references"}]},{"group":"Experimental","pages":[{"title":"Compare two exact source trees","deprecated":true,"version":null,"openapi":"https://api.githits.dev/v1/openapi.json post /v1/experimental/code/diff","href":"/api-reference/v1/experimental/compare-two-exact-source-trees"},{"title":"Compare two dependency snapshots","deprecated":null,"version":null,"openapi":"https://api.githits.dev/v1/openapi.json post /v1/experimental/dependency-diffs","href":"/api-reference/v1/experimental/compare-two-dependency-snapshots"},{"title":"Preview a compact dependency-license report","deprecated":null,"version":null,"openapi":"https://api.githits.dev/v1/openapi.json post /v1/experimental/license-reports","href":"/api-reference/v1/experimental/preview-a-compact-dependency-license-report"},{"title":"Preview a compact report for a completed analysis","deprecated":null,"version":null,"openapi":"https://api.githits.dev/v1/openapi.json get /v1/experimental/license-reports/{id}","href":"/api-reference/v1/experimental/preview-a-compact-report-for-a-completed-analysis"},{"title":"Report dependency licenses from uploaded files","deprecated":null,"version":null,"openapi":"https://api.githits.dev/v1/openapi.json post /v1/experimental/licenses","href":"/api-reference/v1/experimental/report-dependency-licenses-from-uploaded-files"},{"title":"Get dependency licenses for a completed analysis","deprecated":null,"version":null,"openapi":"https://api.githits.dev/v1/openapi.json get /v1/experimental/licenses/{id}","href":"/api-reference/v1/experimental/get-dependency-licenses-for-a-completed-analysis"},{"title":"Submit a lockfile analysis job","deprecated":null,"version":null,"openapi":"https://api.githits.dev/v1/openapi.json post /v1/experimental/lockfile-jobs","href":"/api-reference/v1/experimental/submit-a-lockfile-analysis-job"},{"title":"Get lockfile analysis status","deprecated":null,"version":null,"openapi":"https://api.githits.dev/v1/openapi.json get /v1/experimental/lockfile-jobs/{id}","href":"/api-reference/v1/experimental/get-lockfile-analysis-status"},{"title":"Stream lockfile analysis progress","deprecated":null,"version":null,"openapi":"https://api.githits.dev/v1/openapi.json get /v1/experimental/lockfile-jobs/{id}/events","href":"/api-reference/v1/experimental/stream-lockfile-analysis-progress"},{"title":"Download a completed lockfile analysis","deprecated":null,"version":null,"openapi":"https://api.githits.dev/v1/openapi.json get /v1/experimental/lockfile-jobs/{id}/result","href":"/api-reference/v1/experimental/download-a-completed-lockfile-analysis"},{"title":"Research a question with cited sources","deprecated":null,"version":null,"openapi":"https://api.githits.dev/v1/openapi.json post /v1/experimental/research","href":"/api-reference/v1/experimental/research-a-question-with-cited-sources"},{"title":"Generate an SBOM from uploaded files","deprecated":null,"version":null,"openapi":"https://api.githits.dev/v1/openapi.json post /v1/experimental/sbom","href":"/api-reference/v1/experimental/generate-an-sbom-from-uploaded-files"},{"title":"Resolve a target name","deprecated":null,"version":null,"openapi":"https://api.githits.dev/v1/openapi.json post /v1/experimental/targets/resolve","href":"/api-reference/v1/experimental/resolve-a-target-name"}]},{"group":"Feedback","pages":[{"title":"Submit solution or session feedback","description":"Record whether a generated example or a session was useful, with optional written feedback. You can rate a saved example using its solution identifier or submit feedback for a session.\n\nEach successful submission saves a new feedback record.","deprecated":null,"version":null,"openapi":"https://api.githits.dev/v1/openapi.json post /v1/feedback","href":"/api-reference/v1/feedback/submit-solution-or-session-feedback"}]},{"group":"Grep","pages":[{"title":"Find regex or literal matches across source and documentation","deprecated":null,"version":null,"openapi":"https://api.githits.dev/v1/openapi.json post /v1/grep","href":"/api-reference/v1/grep/find-regex-or-literal-matches-across-source-and-documentation"}]},{"group":"Languages","pages":[{"title":"Search supported programming languages","description":"Find supported programming languages by name or alias. Results provide a canonical name, a display name, and aliases for each match, ordered by relevance.\n\nUse the canonical name when choosing a language for a generated code example.","deprecated":null,"version":null,"openapi":"https://api.githits.dev/v1/openapi.json get /v1/languages","href":"/api-reference/v1/languages/search-supported-programming-languages"}]},{"group":"List","pages":[{"title":"List files and documentation paths","deprecated":null,"version":null,"openapi":"https://api.githits.dev/v1/openapi.json post /v1/list","href":"/api-reference/v1/list/list-files-and-documentation-paths"}]},{"group":"Read","pages":[{"title":"Read documentation or source code","deprecated":null,"version":null,"openapi":"https://api.githits.dev/v1/openapi.json get /v1/read","href":"/api-reference/v1/read/read-documentation-or-source-code"}]},{"group":"Search","pages":[{"title":"Search documentation, code and symbols","deprecated":null,"version":null,"openapi":"https://api.githits.dev/v1/openapi.json post /v1/searches","href":"/api-reference/v1/search/search-documentation-code-and-symbols"},{"title":"Get search status and retained results","deprecated":null,"version":null,"openapi":"https://api.githits.dev/v1/openapi.json get /v1/searches/{search_ref}","href":"/api-reference/v1/search/get-search-status-and-retained-results"}]},{"group":"Vulnerabilities","pages":[{"title":"Look up a vulnerability and affected packages","deprecated":null,"version":null,"openapi":"https://api.githits.dev/v1/openapi.json get /v1/vulnerabilities/{id}","href":"/api-reference/v1/vulnerabilities/look-up-a-vulnerability-and-affected-packages"}]}]}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog/overview"}]}]},"basePath":"","title":"Find regex or literal matches across source and documentation - GitHits","deploymentId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","buildId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","dynamics":["c2aa737661","b0f84f53ff","a9bb46feb3","2b790eda92"],"chunks":["OpenApiReferenceProvider-CiUHMMOm.js","snippetPresets-BgfXU7Bw.js","utils-DWvOwgy_.js","style-to-object-BY3JEAdk.js","utils-BN7RXSMJ.js","v4-DIgz8zy6.js","addUniqueKeysToSchema-CFw8bq89.js","conditional-requirements-CFM0id0Q.js","cloneDeep-CAwdfOU2.js","_Uint8Array-BJr8e-ZL.js","isObject-FP1Yky1u.js","Page-CVJ-f_k1.js","CodeSnippet-D_HwgQO_.js","DynamicMarkdown-CQM9Bhbv.js","SectionHeading-DpbrP8nQ.js","icon-BPCgijHy.js","ApiExamples-XX0UgMZK.js","usePlaygroundInputsStore-DXDFSa1V.js","shallow-CdX5aREi.js","isEqual-CoOaxexF.js","CodeSnippets-Cg2wpzWm.js","getApiPlaygroundDisplay-CmCoerhe.js","MethodPill-GQ8DuY0c.js","getPastedJson-Cb5mT31m.js","Check2Icon-a7bUI6e8.js","axios-CsQoIw0U.js","Markdown-CX2QY19L.js","AssistantPageLink-CY3bFglh.js","dist-Dl6_zDnT.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}