CLI Reference

stac_check.cli.detect_api_response_type(file: str, headers: dict = None) → str | None[source]

Detect if a file or URL is a STAC API list response.

Parameters:
  • file – Path or URL to the file

  • headers – Optional HTTP headers for URL requests

Returns:

“item_collection” for a FeatureCollection with features, “collections” for a collections endpoint response, None otherwise

stac_check.cli.is_item_collection(file: str, headers: dict = None) → bool[source]

Detect if a file is an item collection (FeatureCollection with features).

Parameters:
  • file – Path or URL to the file

  • headers – Optional HTTP headers for URL requests

Returns:

True if the file is an item collection, False otherwise

stac-check

Main entry point for the stac-check CLI.

Args:

file: The STAC file or URL to validate collections: Validate a collections endpoint item_collection: Validate an item collection catalogs: Validate a catalogs endpoint (STAC API catalogs extension) pages: Number of pages to validate (for API endpoints) recursive: Recursively validate linked STAC objects max_depth: Maximum depth for recursive validation rps: Maximum remote requests per second during recursion items_limit: Items per page to request on remote items endpoints assets: Validate assets links: Validate links no_assets_urls: Disable URL validation for assets header: Additional HTTP headers pydantic: Use stac-pydantic for validation verbose: Show verbose output output: Save output to file (only with –collections, –item-collection, –catalogs, or –recursive) fast: Skip linting and geometry checks for maximum validation speed geometry: Enable geometry coordinate validation checks (off by default)

Usage

stac-check [OPTIONS] FILE

Options

--version

Show the version and exit.

--geometry

Enable geometry coordinate validation (coordinate order, bbox/geometry match, antimeridian formatting). Off by default.

--fast

Skip linting and geometry checks for maximum validation speed. Also applies to –recursive.

-v, --verbose

Show per-asset validation details; without it only a summary is printed.

--pydantic

Use pydantic validation (requires stac-pydantic to be installed).

--header <header>

HTTP header to include in the requests. Can be used multiple times.

--no-assets-urls

Disables the opening of href links when validating assets (enabled by default).

-o, --output <output>

Save output to the specified file. Only works with –collections, –item-collection, or –recursive.

-l, --links

Validate links for format and response.

-a, --assets

Validate assets for format and response.

--items-limit <items_limit>

Items per page to request on remote API items endpoints during –recursive (0 = auto-negotiate starting at 10000; negative = leave URLs unchanged).

Default:

100

--rps <rps>

Maximum remote requests per second during –recursive. Use to stay under API rate limits (e.g. 429 responses).

-m, --max-depth <max_depth>

Maximum depth to traverse when recursing. Omit this argument to get full recursion. Ignored if recursive == False or in fast mode.

-r, --recursive

Recursively validate all related stac objects. Can be combined with –fast for stac-valid FastValidator validation.

-p, --pages <pages>

Maximum number of pages to validate per paginated list — with –item-collection/–collections/–catalogs or –recursive (default: one page per list; 0 for all pages).

--catalogs

Validate catalogs endpoint response (STAC API catalogs extension). Can be combined with –pages. Defaults to one page.

--item-collection

Validate item collection response. Can be combined with –pages. Defaults to one page.

--collections

Validate collections endpoint response. Can be combined with –pages. Defaults to one page.

Arguments

FILE

Required argument