Skip to main content
The HasData CLI is a static Go binary that exposes every HasData API as a subcommand. Output is JSON on stdout — pipe it into jq, redirect it to a file, or call it from any language via subprocess. Source: github.com/HasData/hasdata-cli.

Install

curl -sSL https://raw.githubusercontent.com/HasData/hasdata-cli/main/install.sh | sh
The install script verifies SHA-256 checksums and detects OS/arch automatically.

Authentication

Get your API key from the dashboard, then save it once:
hasdata configure
This writes the key to ~/.hasdata/config.yaml. Resolution order, highest precedence first:
  1. --api-key <key> flag
  2. HASDATA_API_KEY environment variable
  3. ~/.hasdata/config.yaml

Usage

hasdata <command> [flags] [--pretty|--raw] [--output FILE]
Each API endpoint is a subcommand. Flag names mirror the API parameters, kebab-cased: outputFormat--output-format, priceMin--price-min. Object/array params take a --<flag>-json variant that accepts a JSON string, file path, or stdin.

Examples

Google SERP
hasdata google-serp --q "langchain vs llamaindex" --gl us --pretty
Web Scraping with AI extraction
hasdata web-scraping \
  --url "https://news.ycombinator.com" \
  --output-format markdown \
  --ai-extract-rules-json '{"top_story":{"type":"string"}}'
Zillow listing search
hasdata zillow-listing \
  --keyword "Austin, TX" --type forSale \
  --price-min 400000 --price-max 900000 \
  --beds-min 3 --sort priceLowToHigh

Output and exit codes

Output auto-formats as pretty JSON when stdout is a TTY and as raw JSON when piped. Force either with --pretty / --raw. Exit codes: 0 success, 1 user error, 2 network, 3 API 4xx, 4 API 5xx.

Common flags

FlagPurpose
--api-keyOverride the configured API key
--pretty / --rawForce output formatting
--output FILEWrite the response to a file
--verbosePrint request URL and rate-limit headers to stderr
--timeout, --retriesPer-request controls
--helpPer-command schema and examples

Supported commands

The CLI ships a subcommand for every API documented under Web Scraping API, Google SERP API, Google AI Mode API, Google Maps API, and Scraper APIs. Run hasdata --help for the full list, or hasdata <command> --help for parameter schemas.

Updates

hasdata update --check    # check for a new version
hasdata update            # install the latest release
The CLI auto-checks daily and notifies via stderr; it never updates without your consent.

Billing

Each subcommand consumes credits at the same rate as a direct API call. See Credits and Concurrency for details.