Your weekly comparison says a membership got cheaper. Before you publish that price cut, check whether tiers[0] still refers to the same reward.
The Actor returns paid tiers sorted by ascending price. Add a cheaper reward and existing tiers move along the array, even when their prices stay unchanged.
Match membership snapshots on campaign ID plus tier ID: array position describes the current ladder, not the identity of a reward.
A sorted ladder can manufacture a discount
Flattening the array into “cheapest”, “next cheapest” and similar columns feels reasonable when your report needs a tidy table.
The trouble starts when you treat those columns as product histories. A comparison of array positions can silently compare a new entry tier with an established reward.
Example: a cheaper addition changes the positions without changing the continuing rewards.
Earlier: [Reward A] [Reward B] Later: [New tier] [Reward A] [Reward B] By position: Reward A → New tier By identity: Reward A → Reward A “Cheapest available membership” remains a useful metric. It just answers a different question from “Did this reward change price?”
Bad joins are remarkably good at producing tidy charts.
What should a tier tracker join on?
For this worked example, we'll use the campaign and reward identifiers returned by Dataspryva's Actor.
Keep the campaign ID with every tier, even when your current report follows a single creator. It makes the scope of the comparison explicit when the portfolio grows.
These are the fields that matter to this comparison:
| Field | Use in the tracker | Boundary |
|---|---|---|
Campaign id + tier id | Match a reward across observations | A different reward ID stays a different identity, even with a familiar title |
Tier title | Detect an observed rename | A title is mutable, so it cannot be the join key |
amountCents + tier currency | Compare the published price | Missing values or different currencies prevent a direct price comparison |
scrapedAt | Retain observation time | It does not establish when an edit happened |
minTierPrice / maxTierPrice | Describe the ladder's endpoints | Neither identifies which reward changed |
Use amountCents for the comparison. Despite their names, amountUsd and amountDollars contain local-currency decimal values, without currency conversion.
A renamed reward can remain a continuing item. A replacement with a familiar title belongs in the additions and disappearances, rather than inheriting the old reward's price history.
That distinction is what lets you defend the report when someone asks which memberships actually became cheaper.
Collect the same campaign population
Use a fixed creator list for a recurring comparison. Changing a search result set introduces a population change before you've even reached the tiers.
Disable posts so the collection focuses on campaign records. Check the run status before treating its dataset as a completed observation.
Example input below requests a named campaign; the collection function retains each completed observation under a snapshot label.
import os import duckdb import pandas as pd from apify_client import ApifyClient client = ApifyClient(os.environ["APIFY_TOKEN"]) run_input = { "mode": "creator", "creators": ["PhilosophyTube"], "includePosts": False, } def collect(): run = client.actor( "dataspryva/patreon-creator-economics-and-membership-tier" ).call(run_input=run_input) if run["status"] != "SUCCEEDED": raise RuntimeError(f"Collection ended: {run['status']}") return list(client.dataset(run["defaultDatasetId"]).iterate_items()) raw_snapshots = {"before": collect(), "after": collect()} Consecutive calls compare consecutive observations. For a weekly report, your scheduler needs to retain the earlier collection until the later collection is due.
The remaining cells use an in-memory database so the example needs no existing files. A scheduled tracker needs durable storage for the original records, collection outcomes and normalised observations.
Keep a logical snapshot label separate from scrapedAt. The label selects the reporting comparison; the timestamp records when each campaign was observed. A portfolio collection isn't an instantaneous census.
Keep missing ladders out of the comparison
The Actor omits empty fields. An absent tiers key therefore needs interpretation before you flatten anything.
An explicit tierCount == 0 supports treating the paid ladder as empty. A missing array without that evidence stays unknown. Otherwise, an omitted field could become an impressive-looking mass disappearance.
This cell preserves campaign observations separately from tier rows, including campaigns that contribute no tiers.
campaign_rows, tier_rows = [], [] for snapshot, records in raw_snapshots.items(): for record in records: if record.get("recordType") != "creator": continue campaign_id = record.get("id") rewards, count = record.get("tiers"), record.get("tierCount") known = ( isinstance(rewards, list) and (count is None or count == len(rewards)) ) or (rewards is None and count == 0) campaign_rows.append(( snapshot, campaign_id, record.get("scrapedAt"), known )) if isinstance(rewards, list): for reward in rewards: tier_rows.append(( snapshot, campaign_id, reward.get("id"), reward.get("title"), reward.get("amountCents"), reward.get("currency"), )) campaigns = pd.DataFrame(campaign_rows, columns=[ "snapshot", "campaign_id", "scraped_at", "ladder_known" ]).astype({"snapshot": "string", "campaign_id": "string"}) tiers = pd.DataFrame(tier_rows, columns=[ "snapshot", "campaign_id", "tier_id", "title", "amount_cents", "currency" ]).astype({c: "string" for c in [ "snapshot", "campaign_id", "tier_id", "title", "currency" ]}) campaigns["scraped_at"] = pd.to_datetime( campaigns["scraped_at"], utc=True, errors="raise" ) tiers["amount_cents"] = pd.to_numeric( tiers["amount_cents"], errors="raise" ).astype("Int64") Keep identifiers as strings. Parse the ISO timestamp into a timezone-aware value, and retain omitted prices as missing rather than filling them with zero.
Typed error records remain in raw_snapshots. They don't become empty campaign observations.
The ladder check is a consistency gate, not proof that every public offer was captured. It prevents an internally contradictory observation from quietly entering the price comparison.
Block ambiguous keys before joining
Duplicate reward keys can multiply rows in a join. Dropping an arbitrary duplicate hides the problem and leaves you defending whichever price survived.
We'd quarantine the affected campaign comparison instead.
This cell checks campaign and tier uniqueness, then stores the observations in batches.
campaign_key = ["snapshot", "campaign_id"] tier_key = [*campaign_key, "tier_id"] bad_campaigns = tiers.loc[ tiers["tier_id"].isna() | tiers.duplicated(tier_key, keep=False), "campaign_id", ] campaigns["usable"] = ( campaigns["ladder_known"] & campaigns["campaign_id"].notna() & campaigns["scraped_at"].notna() & ~campaigns.duplicated(campaign_key, keep=False) & ~campaigns["campaign_id"].isin(bad_campaigns) ) con = duckdb.connect() con.register("campaign_batch", campaigns) con.register("tier_batch", tiers) con.execute("CREATE TABLE campaign_snapshots AS SELECT * FROM campaign_batch") con.execute("CREATE TABLE tier_snapshots AS SELECT * FROM tier_batch") con.execute(""" CREATE TABLE eligible_campaigns AS SELECT campaign_id FROM campaign_snapshots GROUP BY campaign_id HAVING count(*) = 2 AND count(DISTINCT snapshot) = 2 AND bool_and(usable) """) Eligibility requires a usable campaign observation on both sides. A creator missing from a later collection can't consequently turn every earlier tier into a disappearance.
Keep excluded campaigns visible in your collection audit. “Couldn't compare” belongs outside the count of changed memberships.
For repeated ingestion, enforce these keys in storage as well. A retry should replace or reject the same snapshot's batch according to your ingestion policy, rather than append another copy and change the apparent event count.
Separate ladder events from reward edits
A full outer join preserves additions and disappearances. For continuing rewards, independent flags allow a rename and repricing to coexist.
This query retains the compared values and leaves a flag unknown when its required values are missing.
changes = con.sql(""" WITH b AS ( SELECT * FROM tier_snapshots WHERE snapshot = 'before' AND campaign_id IN (SELECT campaign_id FROM eligible_campaigns) ), a AS ( SELECT * FROM tier_snapshots WHERE snapshot = 'after' AND campaign_id IN (SELECT campaign_id FROM eligible_campaigns) ) SELECT coalesce(b.campaign_id, a.campaign_id) AS campaign_id, coalesce(b.tier_id, a.tier_id) AS tier_id, CASE WHEN b.tier_id IS NULL THEN 'observed_addition' WHEN a.tier_id IS NULL THEN 'observed_disappearance' ELSE 'continuing' END AS membership_event, b.title AS before_title, a.title AS after_title, b.amount_cents AS before_cents, a.amount_cents AS after_cents, b.currency AS before_currency, a.currency AS after_currency, b.title <> a.title AS title_changed, b.currency <> a.currency AS currency_changed, CASE WHEN b.currency = a.currency THEN b.amount_cents <> a.amount_cents END AS price_changed, CASE WHEN b.currency = a.currency THEN a.amount_cents - b.amount_cents END AS price_delta_cents FROM b FULL OUTER JOIN a USING (campaign_id, tier_id) """).df() A missing title becoming visible isn't automatically a rename. A currency change belongs in its own review queue. Neither should become a same-currency price movement through enthusiastic null handling.
For a repricing count, select continuing rewards where price_changed is true. Preserve unknown comparisons separately: false means comparable and unchanged, while null means the comparison couldn't be established.
Additions and disappearances describe ladder composition. They shouldn't inflate a headline about existing rewards becoming cheaper or more expensive.
Track the entry price separately
Now calculate the cheapest observed paid tier independently of reward history.
Group by currency, and keep an unknown minimum if any tier price within that group is missing.
entry_prices = con.sql(""" SELECT t.snapshot, t.campaign_id, t.currency, CASE WHEN count(*) = count(t.amount_cents) THEN min(t.amount_cents) END AS cheapest_observed_cents FROM tier_snapshots AS t JOIN eligible_campaigns AS e USING (campaign_id) GROUP BY t.snapshot, t.campaign_id, t.currency """).df() con.close() An absent currency remains a separate unknown group. Don't publish a campaign-wide entry price while any tier's currency is unknown, and don't combine different currencies into a single minimum.
An empty paid ladder produces no minimum, so retain the campaign observations when presenting coverage. No minimum isn't a free membership.
Your report can now distinguish a lower entry price from repricing of a continuing reward. A cheaper addition can move the former while leaving the latter untouched.
The worked collection uses Patreon Creator Economics & Membership Tier Scraper. The matching rule applies wherever a sorted offer list also carries item identifiers.
Array position is a derived ranking. A change to scrapedAt is an expected consequence of another observation. Neither belongs in the repricing count.
The public offer stops short of the transaction
These observations describe public paid tiers at collection time. They don't establish what existing members were charged, whether the benefits remained equivalent, or why a creator edited the ladder.
Retain payPerName if your analysis compares billing units. A tier price alone doesn't describe its billing basis, and matching a reward ID doesn't establish that every other term stayed unchanged.
An observed disappearance also stops short of proving permanent deletion. Likewise, an observed addition means the reward wasn't present in the earlier eligible snapshot, rather than proving when it was created.
The timestamp brackets what you observed. It doesn't supply the edit history between collections.
Before defending a price cut, make sure the reward survived the join.
Drafted with AI assistance and reviewed for accuracy.

