List package or repository code files
Browse the indexed files in a package or public repository. Filter by path, programming language, extension, or file purpose to find the parts of a codebase you need.
Use the returned file paths with GET /v1/code/read to read their contents, or use POST /v1/code/grep to search within them.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Optional client attribution: trimmed printable ASCII, at most 80 bytes. Invalid optional values are dropped.
Optional client-version attribution: trimmed printable ASCII, at most 80 bytes. Invalid optional values are dropped.
Optional agent attribution: trimmed printable ASCII, at most 160 bytes. Invalid optional values are dropped.
Optional session attribution: trimmed printable ASCII, at most 128 bytes. Invalid optional values are dropped; no session is created.
Query Parameters
Package registry, required with name; mutually exclusive with repo_url.
npm, pypi, hex, crates, vcpkg, zig, nuget, maven, packagist, rubygems, go, swift Package name (max 255 bytes), including encoded scoped names such as %40scope%2Fpackage.
1Optional package version (max 100 bytes); forbidden with repo_url. Omission retains latest release intent.
1Public GitHub, GitLab, or Codeberg repository root URL. HTTPS and git+https are supported on all three; GitHub also accepts http, git, ssh, and git+ssh. Use default transport ports and omit credentials, query strings, and fragments. GitLab nested groups are supported. Use HTTPS instead of scp-style shorthand.
1Repository-only branch, tag or SHA. Omission preserves default-branch intent; no implicit HEAD.
1Exact target-relative selector, OR-ed with path_prefix and globs.
1Literal target-relative prefix, OR-ed with path/globs. Root-only dot means omitted. Trailing slash retains directory boundary.
1Single inclusive intent; forbidden with file_intents.
production, test, benchmark, example, generated, fixture, build, vendor Exclude source-classified documentation after inclusive filtering.
Exclude source-classified tests after inclusive filtering.
Include dotfiles and files under dot-prefixed path segments (default false).
Maximum files per page: 1–1000, default 200. A smaller page does not reduce file enumeration work.
1 <= x <= 1000Nonnegative offset into all matching paths, default zero. Pin served artifact across pages.
0 <= x <= 2147483647Time to wait for indexing: 0–60000 milliseconds, default 20000. Zero returns immediately; if files are not ready, the response is 503 PACKAGE_INDEXING.
0 <= x <= 60000Repeatable OR-ed glob selectors; commas and braces remain literal glob text. At most 1000 path + globs selectors.
11Repeat for each case-insensitive extension, without leading dot. AND with inclusion selectors.
11Repeat for each source file-type filter; values within this family are OR-ed.
11Repeat for each source language filter; values within this family are OR-ed.
11Repeat for inclusive intents; forbidden with file_intent.
1production, test, benchmark, example, generated, fixture, build, vendor Repeat for intents excluded after inclusive filtering.
1production, test, benchmark, example, generated, fixture, build, vendor Response
Sorted matching file page
One source inventory page and the exact evidence qualification.
Freshness of the served code inventory.
current, stale, provisional Atomic rows sorted by target-relative path ascending.
Opaque active indexing reference, including refresh of stale or provisional evidence; null when absent.
Effective page cap, 1 through 1000 (default 200).
Requested nonnegative offset into the sorted filtered inventory.
Number of rows in this page.
x >= 0Canonical requested, resolved and served provenance reported by the source.
All matching files across every page.
x >= 0