Metadata-Version: 2.4
Name: vitalityfit
Version: 1.0.0
Summary: Compare prices of health products (medicines, supplements, cosmetics) from German online pharmacies and drugstores by name, PZN or EAN barcode: free price API client and CLI with cheapest offers, shipping costs, stock and 90-day low, no API key
Author-email: "Xealti UG (Vitalityfit)" <service@vitality-fit.de>
License-Expression: MIT
Project-URL: Homepage, https://vitality-fit.de/api/#english
Project-URL: Documentation, https://vitalityfit.docs.buildwithfern.com/
Project-URL: Price comparison, https://vitality-fit.de/
Project-URL: MCP server, https://vitality-fit.de/mcp/#english
Keywords: price-comparison,price-api,prices,cheapest,pharmacy,online-pharmacy,drugstore,health,medicine,supplements,cosmetics,germany,pzn,ean,gtin,barcode,shopping,api-client,cli,apotheke,preisvergleich,versandapotheke
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: End Users/Desktop
Classifier: Natural Language :: English
Classifier: Natural Language :: German
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Utilities
Classifier: Typing :: Typed
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# vitalityfit

Compare prices of health products (medicines, supplements, cosmetics) from German online pharmacies and drugstores.
Look a product up by name, PZN (the German pharmacy product number) or EAN barcode and get the cheapest current offers:
shop, price, shipping cost, stock, delivery time, unit price and the lowest price of the last 90 days.

A small client and command line tool for the free [Vitalityfit Price API](https://vitality-fit.de/api/#english):
no API key, no login, no dependencies.

*Deutsch:* Preisvergleich für Apotheken- und Drogerieprodukte aus deutschen Online-Shops und
Versandapotheken, per Name, PZN oder EAN. Daten von [vitality-fit.de](https://vitality-fit.de/).

## Command line

```sh
pipx install vitalityfit        # or: pip install vitalityfit
vitalityfit ibuprofen
vitalityfit 01568889 --pack "7 st"
vitalityfit "orthomol immun" --json
```

Without installing: `uvx vitalityfit ibuprofen`. `python -m vitalityfit` works too.

The command searches for the product, then lists the cheapest offers for the best match: shop, price, shipping cost,
stock, delivery time, unit price and shop link, plus the lowest price of the last 90 days. A PZN or EAN shows the offers
for exactly that pack. Links the API flags as affiliate links are marked `(affiliate)`. The exit code is 1 when there is nothing to show (no
product, pack size not found, no current offers) or on an error, and 2 on a usage error.

| Option | Meaning |
|---|---|
| `-p, --pack <size>` | Pack size, e.g. `"20 st"`, or a `pzn_`/`ean_` key (default: the pack size with the most offers) |
| `-l, --limit <n>` | Number of products to search, 1-10 (default 5) |
| `--json` | Print the API answers as JSON |

## Library

Python 3.9 or later, standard library only.

```python
from vitalityfit import search_products, list_offers

products = search_products("ibuprofen 400", limit=3)["products"]
best = products[0]
print(best["title"], best["cheapest_price"], [p["label"] for p in best["pack_sizes"]])

result = list_offers(best["product_key"], pack_size="20 st")
for offer in result["offers"]:
    print(offer["shop"], offer["price"], offer["shipping_cost"], offer["link"])
# Show these with the offers:
print(result.get("compliance_notice") or "", result["disclosure"])
```

- `search_products(query, limit=None)`: up to 10 products (default 5), best match first. Each has `product_key`,
  `title`, `brand`, `pack_sizes`, `cheapest_price` (EUR), `shop_count`, `url` and, for medicines, `compliance_notice`.
- `list_offers(product_key, pack_size=None)`: up to 10 offers, cheapest first, for one pack size (default: the pack size
  with the most offers). `pack_size` takes a `pack_sizes` label or `identity_key`. The answer also has `disclosure`,
  `low_90d`, `data_date` and, for medicines, `compliance_notice`. An unknown pack size gives
  `message: "pack size not found"` with `available_packs`.
- Both take `timeout` (seconds, default 30), `base_url` and `transport` (your own HTTP function) as keyword arguments.
  The answers are the API's JSON as dicts.

Errors are raised as `VitalityfitError` with `status`, `code` and, when rate-limited, `retry_after` in seconds. Codes
from the API: `invalid_argument`, `not_found`, `rate_limited`, `internal`, `unavailable`; from the client: `http_error`
(an answer that is not the API's JSON), `network` (no answer) and `timeout`. A `not_found` (HTTP 410) for a product key
means the product was merged or delisted: search again by name, PZN or EAN for its current key. A 429 without
`retry_after` means the service is busy: retry after a few seconds.

## Limits

- One request per 10 seconds per IP address on average (12 in 2 minutes); above that the API answers `429` with
  `Retry-After`. The command line tool uses two requests per search.
- Answers are cached for up to 1 hour.

## Terms in short

- Free for personal and non-commercial use, including free apps. Commercial use only by agreement:
  service@vitality-fit.de
- Name the source "Preise: vitality-fit.de" with a link to https://vitality-fit.de/ and keep shop links unchanged.
- For medicines, show the `compliance_notice` together with the results.
- No bulk download, mirroring or resale of the data.
- Prices only, no medical advice. Prices may have changed since; the price in the shop applies. Shop links can be
  affiliate links: vitality-fit.de may earn a commission, and the price does not change for the buyer.

Full terms: [vitality-fit.de/api](https://vitality-fit.de/api/#english) (the German version is binding).

## Also available

- JavaScript: the npm package [`vitalityfit`](https://www.npmjs.com/package/vitalityfit) (same commands, `npx vitalityfit`).
- AI assistants: an MCP server at `https://vitality-fit.de/mcp` (streamable HTTP, no login), listed in the official
  MCP Registry as `de.vitality-fit/prices`. Setup for Claude, ChatGPT and other clients:
  [vitality-fit.de/mcp](https://vitality-fit.de/mcp/#english).
- API reference: [vitalityfit.docs.buildwithfern.com](https://vitalityfit.docs.buildwithfern.com/).

## License

The code is MIT licensed. The price data is subject to the API terms above.
