neosourceDocs
Search docs

Search the nixpkgs corpus by attribute prefix

GET/api/packages

searchNixPackages

Returns nixpkgs attributes whose name starts with `q`, grouped by attribute. Matching is PREFIX-only — a plain B-tree index, no trigram extension — so a typo does not match. An empty or absent `q` returns the alphabetical first page. Page size is bounded: `?limit=N` (1–200, default 50). SCOPE: the index currently covers only the attributes the toolchain catalog names, not all of nixpkgs, so an empty result does not mean the attribute does not exist upstream. This is the nixpkgs corpus, NOT the OCI registry — for packages this forge hosts see `/api/owners/{handle}/packages`.

Authentication is not described for this operation in the spec — that does not mean it is public. Check tokens and scopes.

curl

curl -X GET 'https://neosource.dev/api/packages'

fetch

fetch("https://neosource.dev/api/packages", {
  method: "GET",
});

Query parameters

q

Attribute-name **prefix**. Matching is prefix-only — a plain B-tree index with `text_pattern_ops`, no extension — so a typo does not match. Empty or absent returns the alphabetical first page.

string | null

limit

Page size, 1–200. Default 50.

integer | nullint64

Responses

200Matching attributes

application/json

NixPackageSearchResponse

object

A prefix-search result page.

index_version

integer | nullint64

Which load generation answered. `null` means the corpus has never been loaded — the designed state of a derived table before its first build, not an error.

packagesrequired

array

items

NixPackageSummary

object

One nixpkgs attribute matched by a prefix search. Grouped by attribute rather than per (attribute, version): the dominant query is someone typing a package name, and a per-version list would bury `python311` under a hundred rows of `python3`. There is deliberately no "latest version" field — see [`NixPackageVersionsResponse::versions`].

any_substitutablerequired

boolean

Whether *any* of them has bytes upstream — the cheap "is this usable at all?" signal, without shipping every row.

attrrequired

string

The nixpkgs attribute path, e.g. `python311`.

version_countrequired

integerint64

How many (version, system) rows the corpus carries for it.

Standard errors

Bodies documented once for the whole API — see standard errors.

  • 400Bad Request — one of: invalid_input
  • 429Rate limited — retry after the interval in the `Retry-After` header
  • 500Internal server error
  • 503Service temporarily unavailable / at capacity — retry after the `Retry-After` header
  • 504Gateway timeout — the request exceeded the server's handling budget