Read public Romanian real-estate listings from Storia.ro. Search sales and rentals, inspect a listing, export rows, and track asking prices in local SQLite.
Unofficial, not affiliated with Storia.ro; automated use may breach its terms and get the account suspended. This CLI uses anonymous GET requests and runs on Linux or macOS with Python 3.10 or later.
From a checkout, on Linux or macOS with Python 3.10 or later:
git clone https://github.com/mihailmariusiondev/storia-cli.git && cd storia-cli
python3 -m pip install .Use an activated virtual environment if your system manages its Python installation.
| Command | Purpose | Flags |
|---|---|---|
storia |
Read public Storia.ro listings. | --help, --json |
storia search |
search public listings | --help, --json, --transaction, --estate, --county, --city, --price-min, --price-max, --surface-min, --surface-max, --rooms-min, --rooms-max, --floor-min, --floor-max, --currency, --seller, --all, --limit, --cursor, --details, --sort, --soft-drift, --fresh, --format |
storia detail |
show a normalized listing by URL or slug | --help, --json, --soft-drift, --fresh, --format |
storia snapshot |
record a complete search in local SQLite | --help, --json, --transaction, --estate, --county, --city, --price-min, --price-max, --surface-min, --surface-max, --rooms-min, --rooms-max, --floor-min, --floor-max, --currency, --seller, --soft-drift |
storia diff |
compare the last two snapshots of the same search | --help, --json, --transaction, --estate, --county, --city, --price-min, --price-max, --surface-min, --surface-max, --rooms-min, --rooms-max, --floor-min, --floor-max, --currency, --seller, --format |
storia history |
read local observations for a listing ID | --help, --json, --format |
storia raw |
show public fields from the original response payload by path or URL | --help, --json, --soft-drift, --fresh |
storia doctor |
report local setup and optionally check robots.txt | --help, --json, --live |
storia drift |
validate bundled fixture shapes offline or check a single live page | --help, --json, --soft-drift, --fresh, --live, --url |
storia selftest |
check the read workflow on fixtures or public pages | --help, --json, --live |
storia --json doctor
storia --json search --city Brașov --limit 5
storia search --city Brașov --transaction rent --sort price-asc --limit 10
storia search --transaction rent --county Brașov --rooms-min 2 --seller private --currency EUR --price-max 600 --format csv
storia search --estate house --county Brașov --surface-min 90 --limit 5
storia search --county Brașov --city Brașov --all --details --format jsonl > listings.jsonl
storia detail '<listing URL from search>' --json
storia raw /ro/rezultate/vanzare/apartament/brasov/brasov --json
storia drift --json
storia drift --live --url /ro/rezultate/vanzare/apartament/brasov/brasov --jsonThe default search is apartments for sale anywhere in Romania. A town (one of Romania's 319 municipii and orașe) finds its own county, so --city Brașov is enough; a village or commune, or a name two towns share (Ștefănești), needs --county. The town table (src/storia_cli/towns.json) comes from Wikidata (instances of municipiu Q640364 and oraș Q16858213 with their county, queried 29/11/2026). Supply the site’s URL slugs if a city has a compound route. --sort newest|price-asc|price-desc adds Storia's own by/direction keys; these are the keys of Otodom, the platform Storia runs on. The resulting order has not been independently verified. Apartments, houses and land use the same category route. Filter flags apply inclusive minimum and maximum bounds to public search fields locally. Use --currency whenever comparing prices in a specific currency. Surface uses listing area, falling back to land area. Ground floor is zero and basement is −1. Missing values fail the corresponding filter.
Search defaults to 36 matching rows and scans at most five pages per bounded call. Pass --cursor from next_cursor with the same query to resume. Cursors are page/offset pairs on changing search results. --all walks to the final page and deduplicates listing IDs within the call. --details then reads the selected details sequentially. If a detail disappeared after search, its search row remains with detail_outcome: not_found. Otherwise an unverified result or block interrupts export. A failure envelope includes request and progress counts.
JSONL prints one object per line, and CSV has a header and uses JSON text for nested values. JSON and CSV export the same rows. For opening untrusted descriptions in spreadsheets, import cells as text. Without an export format, use --json for the envelope. Every listing row has source_url and retrieved_utc, including when served from cache.
storia snapshot --county Brașov --city Brașov --json
storia diff --county Brașov --city Brașov --json
storia history 11000001 --format jsonlThere is no remote preview or execute operation. All remote commands use anonymous GET. snapshot explicitly stores a complete fresh search in local SQLite. If collection fails partway, it saves no snapshot. Repeat the same search to compare its last two snapshots. removed means the listing left the query result set. Changing a price or its currency produces repriced; a missing price on either side produces price_visibility_changed. history reads dated observations by listing ID across scopes. It starts with your first snapshot. It cannot reconstruct earlier price changes.
Environment variables take precedence over the optional ${XDG_CONFIG_HOME:-~/.config}/storia/config file (example), then built-in defaults. The file accepts one KEY=VALUE per line and full-line # comments. No credentials are required.
STORIA_MAX_AGEdefaults to 300 seconds. Zero disables response reuse.--freshbypasses the listing and search cache. Origin cache restrictions can shorten reuse.STORIA_TIMEOUTdefaults to 20 seconds per request.- Default locations are
~/.cache/storiafor response and robots caches,~/.local/state/storiafor the shared request clock and cooldown, and~/.local/share/storia/history.sqlite3for snapshots. The corresponding XDG directory variables override the defaults. Use the same state directory across invocations sharing a network connection.
storia doctor --json reads local configuration key names, paths, versions, cached robots state and cooldown without making a request. doctor --live refreshes robots.txt with one GET, unless a local cooldown is active. Other live commands check robots.txt before requesting data. drift --live reads one data page, plus the robots file when needed, and reports the build ID and shape check. A valid empty result can provide only a partial shape check.
storia selftest runs the read workflow against bundled fixtures and a temporary database. storia selftest --live checks robots, searches for a listing, uses the discovered listing for detail and history, and checks raw data, drift and the local diff. It respects the shared cooldown and does not create a snapshot. The table shows ok, fail or n.a. with a reason. Add --json for the envelope. A failed check gives a nonzero exit.
Search, detail, snapshot, raw and live drift validate each fetched or cached public data page against the packaged JSON Schema before using the response. A missing or malformed required field exits 4 with outcome drift and names the command and field. Missing, null, empty or malformed optional fields produce a warning and the command still returns available data. With --json, warnings appear in the envelope’s warnings array when present. With any other output format they go to stderr. --soft-drift remains accepted and selects the default behavior. scripts/generate-shapes.py --help describes how to rebuild the schema from the packaged fixtures and local captures.
Requests share a file lock and wait 10–11 seconds between responses and the next request. The CLI honors robots.txt, uses direct HTTPS, and halts on 403, 429 or a recognized challenge. The saved cooldown respects Retry-After when present and defaults to 24 hours. Server errors trigger a separate short backoff. A live smoke test on 2026-12-03 passed the robots, search, detail, raw and drift reads. Broader route, filter and field coverage is based on captured payloads and offline tests.
| Exit | Meaning |
|---|---|
| 0 | Success, including empty search or not_found detail/history |
| 1 | Local failure |
| 2 | Invocation or configuration error |
| 3 | Authentication requested by the upstream site |
| 4 | Upstream failure or unverified response |
| 5 | Block, challenge, active cooldown, or robots denial |
--json can appear before or after the subcommand. The envelope keys are schema_version (2), ok, outcome, exit_code, data, and error. On error, error has code, message, retryable, write_happened (always false for remote writes), and next_step.
The CLI reads the public Next.js payloads in __NEXT_DATA__. Search evidence is props.pageProps.data.searchAds, and detail evidence is props.pageProps.ad and the public portions of unifiedAd. raw also understands the Next.js JSON body shape. It accepts a public search or listing URL, or its /_next/data/<build>/…json equivalent if you have a current URL. The JSON route itself was not verified live. Raw output excludes session and account/contact fields.
Normalized detail fields include asking price and currency, price per m², usable area, land area where supplied, room and floor counts, construction year, address and neighbourhood, public map coordinates and radius, seller type, creation/refresh/modification dates, photos, and description. Additional public listing fields retain source names in listing_fields and unified_fields. Coordinates may represent a pin with an approximate radius. Fields without public values are null. The observed SEO copy repeated usable area as built area, so the CLI requires a separate structured built-area value. The captured objects did not expose previous prices, price history or view counts. Static analysis covered the inline Storia environment script and the saved Next.js payloads. The captured HTML names external route chunks whose bodies were unavailable, so additional bundle routes remain unverified.
Regenerate endpoint coverage from the packaged inventory:
uv run python -m storia_cli.site
uv run --locked pytestVersion 0.2.0. See the changelog, MIT licence and security reporting instructions.