
Security News
Happy Birthday, Shai-Hulud
It has been one year since Shai-Hulud made its first appearance on npm.
Command-line interface for the loc8n geographic data API.
Look up ZIP codes, demographics, boundaries, mortgage data, employment stats, migration flows, and more — directly from your terminal.
npm install -g loc8n
Requires Node.js 20+.
# Authenticate
loc8n auth login
# Look up a ZIP code
loc8n zip lookup 22903
# Search ZIPs by city
loc8n zip by-city -c Austin -s TX
# Get demographics
loc8n demographics lookup 22903 --category income
# Reverse geocode
loc8n geocode reverse --lat 38.0293 --lon -78.4767
# Pipe JSON to another tool
loc8n zip search --state VA --limit 100 --json | jq '.[].city'
loc8n auth login # Prompt for API key
loc8n auth login gd_mykey123 # Pass key directly
API key resolution order:
--api-key flagLOC8N_API_KEY environment variableConfig is stored at $XDG_CONFIG_HOME/loc8n/config.json (default ~/.config/loc8n/config.json).
loc8n auth login --profile staging # Create named profile
loc8n auth switch staging # Switch active profile
loc8n auth list # List all profiles
loc8n auth remove staging # Delete a profile
loc8n auth logout # Remove key from active profile
| Flag | Format | Default when |
|---|---|---|
| (none) | table | Interactive terminal |
| (none) | json | Piped / redirected |
--json | JSON | Explicit |
--csv | CSV | Explicit |
--geojson | GeoJSON | Explicit |
Format is also inferred from file extension when using -o:
loc8n zip search --state VA -o results.csv # Outputs CSV
loc8n zip search --state VA -o results.json # Outputs JSON
--fields zip,city,state # Select specific fields
--compact # Minified JSON
--no-header # Omit table/CSV header row
-q, --quiet # Data only, no metadata
-o, --output <file> # Write to file instead of stdout
ZIP code lookups, search, and distance tools.
loc8n zip lookup <code>
loc8n zip search [-s state] [-c city] [--county name] [--type standard|po_box|unique]
loc8n zip by-city -c <city> -s <state>
loc8n zip by-coords --lat <lat> --lon <lon> [--limit 5]
loc8n zip distance <from> <to> [--unit miles|kilometers] [--method haversine|vincenty]
loc8n zip radius <code> --radius <miles> [--unit miles|km] [--sort distance|zip] [--limit 100]
loc8n zip batch [codes...] [--file path]
loc8n zip matrix --origins <zips> --destinations <zips> [--unit miles|km]
Fields: zip, city, state, county, type, latitude, longitude, timezone, areaCode, landArea, waterArea
Demographic data by ZIP, area, or block group.
loc8n demographics lookup <zip> [--year] [--category population|income|housing|education|employment|households]
loc8n demographics area <type> <code> [--year] [--category]
loc8n demographics compare <codes...> [--type] [--year] [--category] # Max 10
loc8n demographics aggregate <zips...> [--method sum|average|weighted] # Max 100
loc8n demographics trend <code> [--type] [--start-year] [--end-year]
loc8n demographics changes <code> [--type] [--year]
loc8n demographics years
loc8n demographics block-group <geoid> # 12-digit GEOID
Fields: zip, geoid, areaType, name, year, population, medianAge, medianIncome, perCapitaIncome, medianHomeValue, medianRent, homeOwnershipRate, vacancyRate, povertyRate, bachelorsDegreeRate, unemploymentRate, householdSize, totalHouseholds
Forward and reverse geocoding.
loc8n geocode address <address> [--limit] [--country]
loc8n geocode reverse --lat <lat> --lon <lon>
loc8n geocode validate <address>
loc8n geocode batch [addresses...] [--file path]
Fields: formattedAddress, latitude, longitude, confidence, city, state, zip, county, country
Geographic boundary data (GeoJSON).
loc8n boundaries zip <code> [--tolerance 0.0001-0.1]
loc8n boundaries county <fips> [--tolerance]
loc8n boundaries state <code> [--tolerance]
loc8n boundaries containing --lat <lat> --lon <lon> [--types zip,county,state]
loc8n boundaries contains --lat <lat> --lon <lon> --type <type> --id <id>
loc8n boundaries intersecting --type <type> --file <geojson>
Manage saved locations.
loc8n locations list [--type] [--tags] [--active|--inactive] [--sort] [--order] [--limit] [--page]
loc8n locations get <id>
loc8n locations create --name <name> --lat <lat> --lon <lon> [--type] [--tags] [--address] [--zip]
loc8n locations update <id> [--name] [--lat] [--lon] [--type] [--tags] [--address] [--zip]
loc8n locations delete <id> [--force]
loc8n locations nearby --lat <lat> --lon <lon> --radius <r> [--unit miles|km] [--limit]
loc8n locations search <query> [--limit]
loc8n locations bulk-create --file <path> # JSON array, max 100
loc8n locations bulk-delete --ids <ids> [--force]
Fields: id, name, latitude, longitude, type, tags, address, zip, city, state, active, createdAt, updatedAt
Fair Market Rent and housing market data.
loc8n market fmr zip <code> [--year]
loc8n market fmr county <fips> [--year]
loc8n market fmr metro <code> [--year]
loc8n market fmr state <code> [--year]
loc8n market trend <zip|county|metro|state> <code> [--start-year] [--end-year]
Fields: areaType, code, name, year, efficiency, oneBedroom, twoBedroom, threeBedroom, fourBedroom
IRS migration flow data.
loc8n migration county <fips> [--year]
loc8n migration state <code> [--year]
loc8n migration inflows <code> [--type county|state] [--year] [--limit] [--sort count|percentage]
loc8n migration outflows <code> [--type county|state] [--year] [--limit] [--sort count|percentage]
loc8n migration trend <code> [--type county|state] [--start-year] [--end-year]
loc8n migration years
Mortgage lending data (Home Mortgage Disclosure Act).
loc8n hmda tract <geoid> [--year] # 11-digit GEOID
loc8n hmda county <fips> [--year]
loc8n hmda state <code> [--year]
loc8n hmda trend <tract|county|state> <code> [--start-year] [--end-year]
loc8n hmda years
Fields: areaType, code, name, year, applicationCount, originationCount, denialCount, denialRate, medianLoanAmount, medianInterestRate, medianPropertyValue, medianBorrowerIncome, purchasePct, refinancePct
LODES employment data.
loc8n employment tract <geoid> [--perspective workplace|residence] [--year]
loc8n employment county <fips> [--perspective] [--year]
loc8n employment state <code> [--perspective] [--year]
loc8n employment inflows <code> [--type tract|county|state] [--year] [--limit]
loc8n employment outflows <code> [--type tract|county|state] [--year] [--limit]
loc8n employment compare <codes...> [--type] [--perspective] [--year] # 2-10 codes
loc8n employment trend <type> <code> [--perspective] [--start-year] [--end-year]
Search for geographic areas.
loc8n areas search <query> [--type zip,county,state,cbsa,place] [--state] [--limit]
Fields: code, name, type, state
loc8n whoami # Text output
loc8n whoami --json # JSON output
Shows current profile and validates your API key.
--api-key <key> API key (overrides profile/env)
--profile <name> Use a specific profile
--json Force JSON output
--csv Force CSV output
--geojson Force GeoJSON output
-o, --output <file> Write to file
-v, --verbose Show HTTP request/response details
-q, --quiet Data only, no metadata
--fields <fields> Comma-separated field list
--compact Minified JSON
--no-tty Force non-interactive mode
--no-header Suppress table/CSV headers
Commands that accept multiple inputs (zip batch, geocode batch, locations bulk-create) support three input methods:
# Arguments
loc8n zip batch 22903 10001 90210
# File
loc8n zip batch --file zips.txt
# Stdin
cat zips.txt | loc8n zip batch
Input files can be plain text (one per line), CSV, or JSON arrays. Format is auto-detected.
Progress is reported to stderr; data goes to stdout — safe for piping.
| Variable | Description |
|---|---|
LOC8N_API_KEY | API key (overrides profile config) |
LOC8N_API_URL | Base API URL (default: https://api.loc8n.com) |
LOC8N_MAX_RETRIES | Max retry attempts (default: 3) |
LOC8N_RETRY_BACKOFF_MS | Base backoff in ms (default: 1000) |
The client automatically retries on:
Retry-After header with exponential backoffNon-retryable errors (401, 403, 404, 422) fail immediately.
MIT
FAQs
Command-line interface for the loc8n geographic data API
We found that loc8n demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
It has been one year since Shai-Hulud made its first appearance on npm.

Research
/Security News
Operators behind PolinRider used a compromised GitHub account to plant malware in four development versions of a Packagist package with 700,000+ downloads.

Security News
GitHub Actions now supports cache-mode, a least-privilege control on the Actions cache aimed at the cache poisoning technique behind recent compromises.