Metadata-Version: 2.4
Name: datacore-cli
Version: 0.1.0
Summary: Command-line client for the DataCore web-data API
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: click>=8
Requires-Dist: httpx>=0.27

# datacore-cli

Command-line client for the [DataCore](https://data.dataleads.pro) web-data API:
fetching, Markdown conversion, metadata extraction, crawling, Google SERP
(search / news / local), product and Amazon data, price tracking, technology
detection, company intelligence, page diffing, job searches, and real-estate
listings.

## Install

```bash
pip install -e /path/to/datacore-cli
# or from a repo containing this directory:
# pip install git+ssh://...#subdirectory=tools/datacore-cli
```

Python 3.10+ is required. This installs the `datacore` console command.

## Configuration

The API key is resolved in this order:

1. `--key` command-line flag
2. `DATACORE_KEY` environment variable
3. otherwise the command exits with an error message

The base URL defaults to `https://data.dataleads.pro` and can be overridden
with the top-level `--base-url` flag.

```bash
export DATACORE_KEY="your-client-key"
```

## Usage

Every command prints human-readable output by default and raw JSON with
`--json`. All commands accept the top-level `--key` and `--base-url` options.

```bash
# service status (no key needed)
datacore health

# usage statistics per key/endpoint
datacore usage

# page data
datacore fetch https://example.com                 # metadata + first 500 chars of HTML
datacore fetch https://example.com --save page.html  # write full HTML to a file
datacore markdown https://example.com              # page as Markdown
datacore extract https://example.com               # title/description/links/language
datacore crawl https://example.com --pages 5       # crawl 1-10 pages

# Google SERP
datacore search "best coffee machine" --country US --lang en
datacore news "electric vehicles" --country US --lang en
datacore local "coffee shops" --country US --lang en

# products / commerce
datacore product https://shop.example.com/product/123
datacore amazon-search "mechanical keyboard"
datacore amazon-product https://www.amazon.com/dp/B08N5WRWNW
datacore track-price https://shop.example.com/product/123

# company intelligence
datacore tech https://example.com
datacore company https://example.com
datacore diff https://example.com

# jobs / real estate
datacore jobs https://example.com/careers
datacore jobs-indeed "python developer"
datacore jobs-linkedin "data engineer"
datacore realestate https://example.com/listings
```

### JSON output

```bash
datacore --json search "best coffee machine" --country US
```

### Errors

API errors (invalid key, upstream failures, `success: false` responses) are
printed as `Error: ...` with exit code 1.

## License

MIT
