The BTAA Geo API CLI provides terminal access to the same API contracts used by the frontend, QGIS plugin, MkDocs examples, and external integrations. The console command is:
btaa-geo-apiThe package also installs a shorter alias:
btaacd cli
python -m pip install -e ".[dev]"
btaa-geo-api --helpThe CLI resolves configuration in this order: command flags, environment variables, saved profile, defaults.
Useful environment variables:
BTAA_GEO_API_BASE_URL=https://lib-geoportal-prd-web-01.oit.umn.edu/api/v1
BTAA_GEO_API_KEY=your-api-key
BTAA_GEO_API_ANALYTICS=0
BTAA_GEO_API_OUTPUT=jsonAPI keys are sent as X-API-Key so backend analytics can record traffic by api_key_id and tier. Raw API keys are never written to CLI analytics payloads.
Simple search:
btaa-geo-api search "water"JSON output:
btaa-geo-api search "water" --output jsonStream every result page as JSON Lines:
btaa-geo-api search "water" --all --output jsonl
btaa-geo-api search "water" --streamPrint IDs or one dotted field path for shell pipelines:
btaa-geo-api search "water" --ids-only
btaa-geo-api search "water" --field attributes.ogm.dct_title_sRead search input from stdin:
printf "water\n" | btaa-geo-api search - --ids-only
cat places.txt | btaa-geo-api search --each --output jsonlField-directed search:
btaa-geo-api search "Transportation" --search-field dct_subject_smFaceted include search:
btaa-geo-api search "seattle" --include gbl_resourceClass_sm=MapsFaceted include and exclude search:
btaa-geo-api search "seattle" \
--include gbl_resourceClass_sm=Maps \
--include dct_spatial_sm=Washington \
--exclude schema_provider_s="Pennsylvania State University"Advanced search passes adv_q JSON through to the API:
btaa-geo-api search "" --adv-q '[{"op":"AND","f":"gbl_resourceClass_sm","q":"Maps"},{"op":"AND","f":"dct_title_s","q":"Island"},{"op":"NOT","f":"dct_title_s","q":"antarctica"}]'Discover searchable and facetable fields:
btaa-geo-api schema fields
btaa-geo-api schema facets
btaa-geo-api schema filters
btaa-geo-api schema search-paramsUse OGC schema endpoints:
btaa-geo-api schema queryables
btaa-geo-api schema sortablesList facet values:
btaa-geo-api facets dct_spatial_sm --q "water"
btaa-geo-api facets schema_provider_s --include dct_accessRights_s=Publicgrep is a Unix-friendly alias for resource discovery. It defaults to JSON Lines so it composes cleanly with jq, xargs, and other shell tools.
btaa-geo-api grep "railroad"
btaa-geo-api grep "soil survey" --state Iowa
btaa-geo-api grep "plat map" --ids-only | btaa-geo-api download --ids - --best --out ./databtaa-geo-api get RESOURCE_ID
btaa-geo-api metadata RESOURCE_ID --format ogm
btaa-geo-api cite RESOURCE_ID --format bibtex
btaa-geo-api downloads RESOURCE_ID
btaa-geo-api download RESOURCE_ID --best --out ./data
btaa-geo-api search "plat map" --ids-only | btaa-geo-api download --ids - --best --out ./data
btaa-geo-api thumbnail RESOURCE_ID --out thumbnail.png
btaa-geo-api static-map RESOURCE_ID --out static_map.pngGenerate compact Markdown or JSON context for notebooks, AI tools, and quick literature/resource scans:
btaa-geo-api context "Mississippi River maps"
btaa-geo-api context "University Avenue streetcar history" --format jsonValidate an OGM Aardvark JSON record before sharing or ingesting it:
btaa-geo-api validate record.json --output tableCrosswalk ISO 19139 or FGDC XML into Aardvark JSON:
btaa-geo-api crosswalk iso19139.xml --from iso --validate
btaa-geo-api crosswalk fgdc.xml --from fgdc --validateInspect the supported crosswalk table:
btaa-geo-api crosswalks --from iso
btaa-geo-api crosswalks --from fgdcThe crosswalks are modeled on GeoCombine's metadata transformation approach:
isoAardvark.xsl, iso2geoBL.xsl, and fgdc2geoBL.xsl map the same core
source families into discovery metadata fields, including title, abstract,
creators, publishers, provider, rights, resource class/type, subjects, places,
issued dates, bounding boxes, and references.
Print the resource URL, or resolve the first search result for a query:
btaa-geo-api open RESOURCE_ID
btaa-geo-api open "dakota county parcels"Use --browser to launch the URL with the operating system browser.
btaa-geo-api ogc collections
btaa-geo-api ogc queryables
btaa-geo-api ogc sortables
btaa-geo-api ogc items --q water --bbox -94,44,-92,45
btaa-geo-api ogc item RESOURCE_IDEvery request identifies the CLI with X-BTAA-Client-* headers. The backend usage log records endpoint traffic, status, response time, API key id, tier id, and client channel. The CLI also sends best-effort command events to /api/v1/analytics/events.
Disable command analytics:
btaa-geo-api --no-analytics search "water"
BTAA_GEO_API_ANALYTICS=0 btaa-geo-api search "water"
btaa-geo-api config set analytics.enabled falseA beginner-friendly notebook is available at docs/cli_colab_tutorial.ipynb. It starts with installation and help output, then builds from simple search to include/exclude faceting, advanced search, metadata, citation, and downloads.
Man page sources live in cli/docs/*.1.md, and generated man artifacts live in cli/man/.
make -C cli man
man cli/man/btaa-geo-api.1Typer provides shell completion for bash, zsh, fish, and PowerShell:
btaa-geo-api --show-completion zsh
btaa-geo-api --install-completion zshRun the CLI suite:
make cli-test
make -C cli testOther targets:
make cli-lint
make cli-format
make cli-build
make cli-man