Skip to content

Keeping your database current

Re-downloading the full national file every day works, but it is 13.5 GB and 147 million rows to re-ingest. The daily change set contains only the properties that changed — typically 150,000–200,000 rows (about 30 MB) — in exactly the same columns as the national file.

The pattern is the one used for any keyed replica:

  1. Load the national file once (your baseline).
  2. Every day, apply that day’s change set: upsert incremental.parquet by id, then delete the ids in removed_ids.csv and the old_ids in merged_ids.csv (two records found to be one home; it continues under new_id).
FileWhat it tells you
/data/latest/manifest.jsonThe current national build: version (a date), row count, checksums.
/data/changes/manifest.jsonThe last 30 daily change sets, newest first. Each release has version, prev_version and its files, with an asset name for each download.

Both manifests are public. The files they describe require a subscription.

Every file is downloaded the same way: ask for a short-lived link, then fetch it.

Terminal window
curl -s -X POST https://api.straply.com/v1/issue-download \
-H "Authorization: Bearer $STRAPLY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"asset": "changes/2026-11-13/incremental.parquet"}'
# {"url": "https://api.straply.com/dl/…", "expires_at": "…", "bytes": 31313905}

Assets: national.parquet, national.csv.gz, and from the change manifest changes/<version>/incremental.parquet, changes/<version>/removed_ids.csv and changes/<version>/merged_ids.csv. Homes on the market carry their current listing’s MLS number and MLS name as the columns mls_number and mls_name, refreshed every night. They are empty for homes that are not on the market or not listed through an MLS.

Download national.parquet and record the version from /data/latest/manifest.json at the same time. That version is your sync point.

  1. Read /data/changes/manifest.json.
  2. Take every release whose version is newer than your sync point, oldest first.
  3. If the oldest release’s prev_version is newer than your sync point, you have fallen more than 30 days behind: reload the baseline instead.
  4. For each release: upsert incremental.parquet, delete removed_ids.csv, then set your sync point to that release’s version. Do all three in one transaction.

New releases are published each morning.

listing_confirmed_at (when a for-sale home was last confirmed on the market) moves every day for most listings without anything else changing, so it is not part of the change sets. It is in each day’s full national and per-geo files. If you need it, refresh it from those files, joining on id.

-- once
CREATE TABLE properties AS SELECT * FROM 'national.parquet';
ALTER TABLE properties ADD PRIMARY KEY (id);
-- each day
BEGIN;
INSERT OR REPLACE INTO properties SELECT * FROM 'incremental.parquet';
DELETE FROM properties WHERE id IN (
SELECT id FROM read_csv('removed_ids.csv', header = true, columns = {'id': 'VARCHAR'}));
DELETE FROM properties WHERE id IN ( -- merged_ids.csv is absent before 2026-11-24
SELECT old_id FROM read_csv('merged_ids.csv', header = true, columns = {'old_id': 'VARCHAR', 'new_id': 'VARCHAR'}));
COMMIT;

Load the change set into a staging table (for example with DuckDB’s postgres extension, or by converting to CSV), then merge. price_history and tax_history are lists of records; store them as jsonb.

BEGIN;
INSERT INTO properties SELECT * FROM properties_staging
ON CONFLICT (id) DO UPDATE SET
street = EXCLUDED.street, status = EXCLUDED.status, list_price = EXCLUDED.list_price,
last_sold_price = EXCLUDED.last_sold_price, last_sold_date = EXCLUDED.last_sold_date,
price_history = EXCLUDED.price_history, tax_history = EXCLUDED.tax_history
-- …list every column
;
DELETE FROM properties WHERE id IN (SELECT id FROM removed_ids_staging);
COMMIT;
REPLACE INTO properties SELECT * FROM properties_staging;
DELETE p FROM properties p JOIN removed_ids_staging r ON r.id = p.id;

Each release lists a sha256 for every file; verify downloads against it. After applying, your row count should match national_rows in the latest national manifest for the same version.