Home / Market / hasdata cli

hasdata cli

Command-line access to search, scraping, and structured web data.

skill★ 507590 dlgithubCC-BY-4.0 content; MIT code; upstream exceptions applyInstall in CosmosUpstream Source

Documentation & Preview

--- name: hasdata-cli description: Command-line access to search, scraping, and structured web data. risk: safe source: official source_type: official source_repo: HasData/hasdata-cli license: MIT license_source: "https://github.com/HasData/hasdata-cli/blob/main/LICENSE" date_added: "2026-06-04"

---

hasdata

Use the hasdata CLI for real-time web data. One subcommand per API — flags, enums, defaults are derived from the live schema at api.hasdata.com/apis.

When to Use

Use this skill when:

Prerequisites

Quick start

hasdata <api> --flag value [--flag value ...] --raw | jq .

Always pass --raw when piping to jq (skips pretty-print and TTY detection). Use --pretty only for human-readable terminal output.

Picking the right subcommand

| User intent | Subcommand | | --- | --- | | Web search ("what does Google say about…") | google-serp (full features) or google-serp-light (cheap, single page) | | Latest news | google-news | | AI Mode SERP | google-ai-mode | | Shopping / product prices | google-shopping (broad), amazon-search / amazon-product (Amazon), shopify-products (Shopify) | | Immersive product page | google-immersive-product | | Maps / places / reviews | google-maps, google-maps-place, google-maps-reviews, google-maps-photos, google-maps-posts | | Yelp / YellowPages local data | yelp-search, yelp-place, yellowpages-search, yellowpages-place | | Real-estate listings (homes for sale/rent/sold) | zillow-listing, redfin-listing | | Real-estate single property deep dive | zillow-property, redfin-property | | Travel — short-term rentals | airbnb-listing, airbnb-property | | Travel — hotels / lodging | booking-search, booking-place | | Travel — flights | google-flights | | Jobs | indeed-listing, indeed-job, glassdoor-listing, glassdoor-job | | Bing search | bing-serp | | Trends | google-trends | | Images | google-images | | Short videos | google-short-videos | | Events | google-events | | YouTube search / video / channel / transcript | youtube-search-api, youtube-video-api, youtube-channel-api, youtube-transcript-api | | Instagram profile | instagram-profile | | Amazon seller | amazon-seller, amazon-seller-products | | Scrape a specific URL | web-scraping — supports JS rendering, proxies, markdown output, AI extraction, screenshots |

For exact flags of a subcommand, run hasdata <api> --help or read the matching file in references/.

Non-obvious triggers (when to reach for hasdata even if the user doesn't say "scrape")

The user often won't ask for a SERP API or a scraper directly. Map these intents to the skill:

SERP-first principle: for any data-enrichment intent (people, companies, emails, products, places), reach for google-serp / google-news / google-shopping / google-maps first. They return Google's already-extracted structured fields (.knowledge_graph, .organic_results[].snippet, .local_results[], etc.) without direct access to the target site. Only escalate to web-scraping when SERP doesn't surface the specific field you need, the data is public or authorized, and the target's terms/access controls allow it. See references/enrichment.md.

If a user request matches one of the above and you don't invoke hasdata, you're probably hallucinating a stale answer.

Universal flag patterns

Global flags (apply to every subcommand)

| Flag | Effect | | --- | --- | | --raw | Write response bytes as-is (use this when piping to jq) | | --pretty | Pretty-print JSON (default when stdout is a TTY) | | -o, --output FILE | Write response to file instead of stdout (works for binary like screenshots) | | --verbose | Log outgoing URL and X-RateLimit-* headers to stderr | | --api-key KEY | Override env var (rarely needed) | | --timeout DURATION | Per-request timeout (default 2m) | | --retries N | Max retries on 429/5xx (default 2) |

Output contract

Responses are JSON. Pipe through jq for extraction:

hasdata google-serp --q "espresso machine" --num 10 --raw \
  | jq -c '.organic_results[] | {title, link, snippet}'

For real-estate / e-commerce results, the array shape is API-specific — read a single response with --pretty first to learn the schema, then write the jq filter.

Exit codes (script-safe)

| Code | Meaning | | --- | --- | | 0 | success | | 1 | user / CLI-input error (missing required flag, bad enum value, missing API key) | | 2 | network error | | 3 | API returned 4xx (auth, quota, validation) | | 4 | API returned 5xx |

References