diff --git a/surfsense_backend/app/capabilities/core/billing.py b/surfsense_backend/app/capabilities/core/billing.py index 67abf4164..c2c7f6b5b 100644 --- a/surfsense_backend/app/capabilities/core/billing.py +++ b/surfsense_backend/app/capabilities/core/billing.py @@ -33,6 +33,7 @@ _PLATFORM_RATE_KEYS: dict[BillingUnit, str] = { BillingUnit.GOOGLE_SEARCH_SERP: "GOOGLE_SEARCH_MICROS_PER_SERP", BillingUnit.GOOGLE_MAPS_PLACE: "GOOGLE_MAPS_MICROS_PER_PLACE", BillingUnit.GOOGLE_MAPS_REVIEW: "GOOGLE_MAPS_MICROS_PER_REVIEW", + BillingUnit.AMAZON_PRODUCT: "AMAZON_MICROS_PER_PRODUCT", BillingUnit.YOUTUBE_VIDEO: "YOUTUBE_MICROS_PER_VIDEO", BillingUnit.YOUTUBE_COMMENT: "YOUTUBE_MICROS_PER_COMMENT", BillingUnit.INSTAGRAM_ITEM: "INSTAGRAM_SCRAPE_MICROS_PER_ITEM", @@ -54,6 +55,7 @@ _UNIT_NOUNS: dict[BillingUnit, str] = { BillingUnit.GOOGLE_SEARCH_SERP: "SERP", BillingUnit.GOOGLE_MAPS_PLACE: "place", BillingUnit.GOOGLE_MAPS_REVIEW: "review", + BillingUnit.AMAZON_PRODUCT: "product", BillingUnit.YOUTUBE_VIDEO: "video", BillingUnit.YOUTUBE_COMMENT: "comment", BillingUnit.INSTAGRAM_ITEM: "item", diff --git a/surfsense_backend/app/capabilities/core/types.py b/surfsense_backend/app/capabilities/core/types.py index 67b9175fc..2e8d3b6cc 100644 --- a/surfsense_backend/app/capabilities/core/types.py +++ b/surfsense_backend/app/capabilities/core/types.py @@ -23,6 +23,7 @@ class BillingUnit(StrEnum): GOOGLE_SEARCH_SERP = "google_search_serp" GOOGLE_MAPS_PLACE = "google_maps_place" GOOGLE_MAPS_REVIEW = "google_maps_review" + AMAZON_PRODUCT = "amazon_product" YOUTUBE_VIDEO = "youtube_video" YOUTUBE_COMMENT = "youtube_comment" INSTAGRAM_ITEM = "instagram_item" diff --git a/surfsense_backend/app/config/__init__.py b/surfsense_backend/app/config/__init__.py index 92e448d9a..41b94a7e1 100644 --- a/surfsense_backend/app/config/__init__.py +++ b/surfsense_backend/app/config/__init__.py @@ -697,9 +697,8 @@ class Config: # per item; retune with an env change + restart (no code/migration): # = round(USD_per_1000_items * 1_000) # $3.50/1000 -> 3500 | $5.00/1000 -> 5000 | $2.00/1000 -> 2000 - # Defaults sit at/above Apify's first-party actor rates (Jul 2026), which - # is justified because SurfSense charges no subscription tiers, no - # per-run actor-start fees, and no separate proxy/compute/storage billing. + # Defaults include margin for proxy, compute, and storage costs while + # remaining independently adjustable for each platform. PLATFORM_SCRAPE_BILLING_ENABLED = ( os.getenv("PLATFORM_SCRAPE_BILLING_ENABLED", "FALSE").upper() == "TRUE" ) @@ -715,6 +714,7 @@ class Config: GOOGLE_MAPS_MICROS_PER_REVIEW = int( os.getenv("GOOGLE_MAPS_MICROS_PER_REVIEW", "1500") ) + AMAZON_MICROS_PER_PRODUCT = int(os.getenv("AMAZON_MICROS_PER_PRODUCT", "3500")) YOUTUBE_MICROS_PER_VIDEO = int(os.getenv("YOUTUBE_MICROS_PER_VIDEO", "2500")) # Kept separate from the video rate so comments can be re-tuned toward the # cheaper per-comment market ($0.40-2.00/1k) without touching video pricing.