diff --git a/downloadtags.py b/downloadtags.py deleted file mode 100644 index 54a500c..0000000 --- a/downloadtags.py +++ /dev/null @@ -1,197 +0,0 @@ -""" -Download classification, price and genres for every game in data/. -Fast version: bulk price lookups + parallel workers behind a shared rate limiter. - -- Game ids come from the file names in data/ (e.g. data/730.csv -> app id 730). -- A row is complete when it has price AND genres. Incomplete or missing rows are (re)fetched, - so the script can be stopped and re-run, and old files without a genres column are upgraded. -- Writes game_tags.csv: sheet, group, name, categories, price, currency, genres - group = sp / mp / both / unknown (from Steam store "categories") - price = base price before discount, 0 if free, "NA" if no price listed - genres = Steam store genres joined by ";" ("none" if the store lists none) - -Install: pip install requests -""" -import csv -import glob -import os -import threading -import time -from concurrent.futures import ThreadPoolExecutor, as_completed - -import requests - -DATA_GLOB = "data/*.csv" -OUT = "game_tags.csv" -API = "https://store.steampowered.com/api/appdetails" -CC = "us" -MIN_INTERVAL = 1.3 # global seconds between requests, shared by all workers -WORKERS = 4 -BULK_SIZE = 100 # max ids per price_overview request -SAVE_EVERY = 25 -FIELDS = ["sheet", "group", "name", "categories", "price", "currency", "genres"] - -MP_CATS = {"multi-player", "co-op", "online co-op", "pvp", "online pvp", "mmo", - "cross-platform multiplayer"} -SP_CATS = {"single-player"} - -session = requests.Session() -_lock = threading.Lock() -_next_slot = 0.0 # earliest time the next request may start - - -def wait_slot(extra_pause=0.0): - """Reserve the next global request slot (thread safe) and sleep until it.""" - global _next_slot - with _lock: - now = time.monotonic() - if extra_pause: - _next_slot = max(_next_slot, now + extra_pause) - start = max(now, _next_slot) - _next_slot = start + MIN_INTERVAL - time.sleep(max(0, start - now)) - - -def get_json(params): - for attempt in range(5): - wait_slot() - try: - r = session.get(API, params={**params, "l": "english", "cc": CC}, timeout=20) - if r.status_code == 429: - wait_slot(extra_pause=60 * (attempt + 1)) # pauses every worker - continue - r.raise_for_status() - return r.json() - except (requests.RequestException, ValueError): - time.sleep(3 * (attempt + 1)) - return None - - -def ids_from_files(): - ids = [] - for path in sorted(glob.glob(DATA_GLOB)): - stem = os.path.splitext(os.path.basename(path))[0] - if stem.isdigit(): - ids.append(stem) - else: - print(f"skipping {path}: file name is not a numeric app id") - return ids - - -def load_rows(): - """Existing rows keyed by sheet; columns missing in an old file load as blanks.""" - if not os.path.exists(OUT): - return {} - with open(OUT, newline="", encoding="utf-8") as f: - return {row["sheet"]: {k: row.get(k) or "" for k in FIELDS} for row in csv.DictReader(f)} - - -def save_rows(rows): - tmp = OUT + ".tmp" - with open(tmp, "w", newline="", encoding="utf-8") as f: - writer = csv.DictWriter(f, fieldnames=FIELDS) - writer.writeheader() - writer.writerows(rows.values()) - os.replace(tmp, OUT) - - -def classify(categories): - cats = {c.lower() for c in categories} - mp, sp = bool(cats & MP_CATS), bool(cats & SP_CATS) - if mp and sp: - return "both" - if mp: - return "mp" - if sp: - return "sp" - return "unknown" - - -def get_price(data): - if data.get("is_free"): - return 0, "" - po = data.get("price_overview") - if po: - return round(po["initial"] / 100, 2), po.get("currency", "") - return "NA", "" - - -def needs_fetch(rows, appid): - r = rows.get(appid) - return r is None or r["price"] == "" or r["genres"] == "" - - -def bulk_prices(ids): - """{appid: (price, currency)} for ids that have a price_overview. 100 ids per request.""" - out = {} - for i in range(0, len(ids), BULK_SIZE): - chunk = ids[i:i + BULK_SIZE] - js = get_json({"appids": ",".join(chunk), "filters": "price_overview"}) - if js is None: - print(f"bulk price batch {i // BULK_SIZE + 1} failed, those ids fall back to single requests") - continue - for appid, entry in js.items(): - data = entry.get("data") if entry.get("success") else None - if isinstance(data, dict) and data.get("price_overview"): - po = data["price_overview"] - out[appid] = (round(po["initial"] / 100, 2), po.get("currency", "")) - print(f"bulk prices: {min(i + BULK_SIZE, len(ids))}/{len(ids)}") - return out - - -def fetch_full(appid): - """(appid, data dict), data = {} if Steam has no store entry, None on a temporary failure.""" - js = get_json({"appids": appid}) - if js is None: - return appid, None - try: - entry = js[appid] - return appid, (entry["data"] if entry.get("success") else {}) - except (KeyError, TypeError): - return appid, None - - -def main(): - ids = ids_from_files() - rows = load_rows() - need = [i for i in ids if needs_fetch(rows, i)] - print(f"{len(ids)} games in data/, {len(ids) - len(need)} complete, {len(need)} to fetch") - - # Step 1: rows that already have genres but miss only the price -> bulk lookup. - # (Genres need the full request, so rows missing genres skip this step.) - price_only = [i for i in need if i in rows and rows[i]["genres"] != ""] - prices = bulk_prices(price_only) if price_only else {} - for appid, (price, cur) in prices.items(): - rows[appid]["price"], rows[appid]["currency"] = price, cur - if prices: - save_rows(rows) - - # Step 2: everything else (new ids, missing genres, free/unlisted games) -> full request - todo = [i for i in need if i not in prices] - print(f"{len(todo)} need a full request " - f"(about {len(todo) * MIN_INTERVAL / 60:.0f} min at the shared rate limit)") - - try: - with ThreadPoolExecutor(WORKERS) as pool: - futures = [pool.submit(fetch_full, i) for i in todo] - for n, fut in enumerate(as_completed(futures), 1): - appid, data = fut.result() - if data is None: - print(f"[{n}/{len(todo)}] {appid}: request failed, will retry on next run") - continue - cats = [c["description"] for c in data.get("categories", [])] - genres = [g["description"] for g in data.get("genres", [])] - price, currency = get_price(data) - rows[appid] = {"sheet": appid, "group": classify(cats), "name": data.get("name", ""), - "categories": ";".join(cats), "price": price, "currency": currency, - "genres": ";".join(genres) or "none"} - print(f"[{n}/{len(todo)}] {appid} {data.get('name', '?')}: {rows[appid]['group']}, " - f"{price} {currency}, {rows[appid]['genres']}") - if n % SAVE_EVERY == 0: - save_rows(rows) - finally: - save_rows(rows) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/ell_by_group.csv b/ell_by_group.csv deleted file mode 100644 index d665920..0000000 --- a/ell_by_group.csv +++ /dev/null @@ -1,69 +0,0 @@ -spec,group,cutoffs,est,se,p_cluster,p_boot,pct,games_below,games_above,obs,kind -rd,sp,"0.70,0.80,0.95",0.06977589677610212,0.0651955469069849,0.2853703718535656,0.33433433433433435,7.226785564301852,207,226,289269,real -rd,mp,"0.70,0.80,0.95",-0.11586573610411528,0.1100246139251769,0.2970776414460521,0.3923923923923924,-10.940521000329284,46,47,47827,real -rd,both,"0.70,0.80,0.95",0.14116443507937487,0.06981132409895935,0.04463982467804706,0.07307307307307308,15.161399815560817,149,150,168831,real -rd,all,"0.70,0.80,0.95",0.08280772179868487,0.05073494169743983,0.10323455601533937,0.11811811811811812,8.633291032756741,402,423,505927,real -rd,sp,0.70,-0.04144809330500921,0.07814345637154571,0.5984353652877861,0.6156156156156156,-4.060086671277629,30,40,16009,real -rd,mp,0.70,-0.21421668100908847,0.1794679457330567,0.24429191190863797,0.6206206206206206,-19.282653308867037,19,25,11353,real -rd,both,0.70,-0.02594672739611093,0.09159418380142965,0.7782619834134452,0.8188188188188188,-2.5613003641375087,38,42,30736,real -rd,all,0.70,-0.12772535676243213,0.08815992160598593,0.15009363008515697,0.24924924924924924,-11.9904941888495,87,107,58098,real -rd,sp,0.80,0.021962470055520728,0.07466094038692488,0.7694149126854466,0.7847847847847848,2.220542043786722,56,68,57731,real -rd,mp,0.80,0.173108501608406,0.09965821859207331,0.09421843058241453,0.16816816816816818,18.899510596688817,25,22,28263,real -rd,both,0.80,0.25357015941378586,0.12132571573719864,0.03940790285186102,0.07607607607607608,28.861778498224446,73,82,56631,real -rd,all,0.80,0.14720273916073942,0.0722781409535493,0.043026738274295484,0.07407407407407407,15.85888305477765,154,172,142625,real -rd,sp,0.95,0.06634437118140492,0.08548644833056121,0.4386465235355521,0.5015015015015015,6.859464701117379,131,135,215529,real -rd,both,0.95,0.152345350365342,0.09334242817422841,0.10749156927355275,0.15015015015015015,16.45623490259498,53,44,81463,real -rd,all,0.95,0.08441449001419256,0.07150737847476503,0.23883634352149308,0.2822822822822823,8.807979856576132,192,185,305203,real -rd,sp,"0.60,0.75,0.85,0.90",0.059757836006853124,0.050921675678383196,0.24170680660652044,0.3106212424849699,6.157943909951835,212,233,293843,placebo -rd,mp,"0.60,0.75,0.85,0.90",-0.004035927230259323,0.11679628363073945,0.9725666745862851,0.9719438877755511,-0.40277938215829145,45,51,55700,placebo -rd,both,"0.60,0.75,0.85,0.90",-0.01706328292428104,0.060580027128471034,0.7785220409935467,0.7835671342685371,-1.69185296038723,165,162,185933,placebo -rd,all,"0.60,0.75,0.85,0.90",0.00920248589212096,0.039752534204052746,0.8170284302334097,0.8236472945891784,0.9244958951353688,422,446,535477,placebo -rd,sp,0.60,-0.03955998083986333,0.0952800517143765,0.6838757908184414,0.749498997995992,-3.878770205943105,12,16,8793,placebo -rd,mp,0.60,-0.061079764816542204,0.06462695147392157,0.3632431987156406,0.48296593186372744,-5.925180182423007,10,12,7859,placebo -rd,both,0.60,0.13072333130387445,0.12059373620368065,0.28795107404639264,0.4308617234468938,13.965243153802653,23,26,9388,placebo -rd,all,0.60,-0.013266212570350855,0.06489827439758673,0.8387699480402295,0.843687374749499,-1.3178604210654088,45,54,26041,placebo -rd,sp,0.75,-0.08779850735410857,0.1028111084949876,0.3963523094029564,0.48096192384769537,-8.40545856037519,51,56,42857,placebo -rd,mp,0.75,-0.10360811712502269,0.2527932792267738,0.6852710878577692,0.9278557114228457,-9.842145860762875,20,26,22782,placebo -rd,both,0.75,0.0850816730026131,0.1113306115168643,0.44754149550654465,0.6633266533066132,8.88059891214632,52,54,44909,placebo -rd,all,0.75,-0.06875928727141746,0.0934991240811961,0.4631999062402248,0.4969939879759519,-6.644862926811235,123,136,110549,placebo -rd,sp,0.85,0.020386944148207763,0.0733113132099523,0.7814320352858439,0.8316633266533067,2.059617735034247,94,101,107413,placebo -rd,mp,0.85,0.26086155047780357,0.08735544783098131,0.009228225713199478,0.2865731462925852,29.80479388755237,13,12,8237,placebo -rd,both,0.85,-0.0058137560717960125,0.0701255961428603,0.9341034412721667,0.9378757515030061,-0.5796888895012176,79,82,70560,placebo -rd,all,0.85,0.0166348289255315,0.052706214729123395,0.7525815653684684,0.8056112224448898,1.6773958084862706,186,195,186211,placebo -rd,sp,0.90,0.08080255391775878,0.07280808793132691,0.2688843616353671,0.3466933867735471,8.415681291722121,119,117,134779,placebo -rd,mp,0.90,-0.3152851916559152,0.14491760344234197,0.044917275161265424,0.20240480961923848,-27.041922575285902,15,12,16821,placebo -rd,both,0.90,-0.03577273566825194,0.08308368784453353,0.668004981695945,0.685370741482966,-3.5140453271923833,66,49,61075,placebo -rd,all,0.90,0.002673826469143803,0.06712118278305798,0.968256873224667,0.9599198396793587,0.2677404331287603,200,178,212675,placebo -crossers,sp,"0.70,0.80,0.95",0.013970748796574159,0.029258879530683395,0.6338168501318846,0.6416416416416416,1.4068795772019804,131,131,167227,real -crossers,mp,"0.70,0.80,0.95",-0.1162537985918383,0.08923833193143936,0.200937764352634,0.35435435435435436,-10.97507493832801,37,37,35263,real -crossers,both,"0.70,0.80,0.95",0.0863017498527914,0.04184253321772688,0.04144916188068137,0.08008008008008008,9.013522682431008,114,114,115786,real -crossers,all,"0.70,0.80,0.95",0.023771913514224172,0.028043377747406846,0.39733559645150707,0.4124124124124124,2.4056717753129675,282,282,318276,real -crossers,sp,0.70,-0.07662099629761042,0.041440653011362724,0.0773630989299181,0.14514514514514515,-7.375916420340944,24,24,13239,real -crossers,mp,0.70,-0.39344899816323603,0.09675512147663641,0.000724343971491237,0.018018018018018018,-32.52742710491684,19,19,10361,real -crossers,both,0.70,0.052915546355270834,0.04533144875302382,0.25145355843569805,0.3013013013013013,5.4340598452925715,34,34,22521,real -crossers,all,0.70,-0.10927843494380063,0.07433238035624934,0.14565387549814934,0.2682682682682683,-10.351922882842167,77,77,46121,real -crossers,sp,0.80,0.029889240364722843,0.05636795022515568,0.5986029523633141,0.6386386386386387,3.0340407505585087,45,45,47421,real -crossers,mp,0.80,0.04853709982557234,0.07996328619191811,0.5510414175140377,0.6826826826826827,4.973431605793155,20,20,21176,real -crossers,both,0.80,0.06249498415450746,0.03773457142728681,0.10273985204748004,0.19019019019019018,6.448911959151649,63,63,46905,real -crossers,all,0.80,0.036672584747822805,0.03629741104243463,0.3142553423868937,0.33933933933933935,3.735331993072055,128,128,115502,real -crossers,sp,0.95,0.012524767187365298,0.03272035270230878,0.7030411716160447,0.6946946946946947,1.260353057143293,71,71,106567,real -crossers,both,0.95,0.06598024716169724,0.08033471652414781,0.4179452483751884,0.4724724724724725,6.8205616864774665,31,31,46359,real -crossers,all,0.95,0.02413213421767054,0.03695329868804763,0.5151689154348846,0.5435435435435435,2.442567063261092,105,105,156652,real -crossers,sp,"0.60,0.75,0.85,0.90",0.020108201122091482,0.029524563532404145,0.4966995955818876,0.5110220440881763,2.031173292871613,182,182,225425,placebo -crossers,mp,"0.60,0.75,0.85,0.90",-0.16124296983839087,0.09429044042711372,0.09562818085746416,0.156312625250501,-14.89147420640904,38,38,41414,placebo -crossers,both,"0.60,0.75,0.85,0.90",-0.04503219185056594,0.02633582782742629,0.08959495624179237,0.12024048096192384,-4.403329299962467,135,135,140769,placebo -crossers,all,"0.60,0.75,0.85,0.90",-0.025805856670577124,0.02527422079586863,0.3079352505932358,0.3246492985971944,-2.547573136965209,355,355,407609,placebo -crossers,sp,0.60,0.02892719858112294,0.09084439913275634,0.7567127156466578,0.0,2.934965363195907,11,11,7822,placebo -crossers,both,0.60,0.01918095540586597,0.07019871476515374,0.7874719090372295,0.8416833667334669,1.9366091733771018,21,21,8836,placebo -crossers,all,0.60,-0.024549248745847917,0.036992448354180044,0.5107350278383238,0.5350701402805611,-2.425036671062375,41,41,21398,placebo -crossers,sp,0.75,-0.04918971648963493,0.09271139089662724,0.5985124080725361,0.7454909819639278,-4.7999497628385175,43,43,35532,placebo -crossers,mp,0.75,0.02609423855366563,0.08802009602366145,0.7704718031147131,0.8196392785571143,2.643767391755536,18,18,16909,placebo -crossers,both,0.75,0.03157639207400229,0.03317364133474998,0.3468886703818057,0.36072144288577157,3.2080215332427997,41,41,36432,placebo -crossers,all,0.75,-0.07035279262770973,0.07181503967160327,0.3296052399097822,0.44488977955911824,-6.79350637425623,102,102,88873,placebo -crossers,sp,0.85,0.01790666236865091,0.03917059267989924,0.6488878437951211,0.6432865731462926,1.8067947904186088,76,76,88095,placebo -crossers,both,0.85,0.0009329596911895152,0.0415700948111168,0.982164367864667,0.0,0.09333950334573515,65,65,56643,placebo -crossers,all,0.85,0.02220314136273311,0.03216922539328535,0.4911432292296556,0.5150300601202404,2.245146555945654,150,150,149884,placebo -crossers,sp,0.90,0.02774744286648366,0.0498219533417962,0.5790203804640919,0.593186372745491,2.8135988550649804,87,87,93976,placebo -crossers,mp,0.90,-0.35034616630694954,0.1401138672586952,0.033837450198500596,0.20040080160320642,-29.555580733794862,10,10,14619,placebo -crossers,both,0.90,-0.14570361816748104,0.057430073441788576,0.015526493481147874,0.01603206412825651,-13.55861382131992,38,38,38858,placebo -crossers,all,0.90,-0.05700038261490047,0.04121779730284615,0.1689934606723147,0.19238476953907815,-5.540629204917336,135,135,147453,placebo diff --git a/ell_did.csv b/ell_did.csv deleted file mode 100644 index fd6ac4d..0000000 --- a/ell_did.csv +++ /dev/null @@ -1,17 +0,0 @@ -spec,group,effect,est,se,p_cluster,p_boot,pct,obs -rd,sp,placebo jump (D),-0.005170940167028049,0.05488107849219133,0.9249785726456707,0.9079079079079079,-0.5157593870132815,889835 -rd,sp,real minus placebo (D_x_real),0.05273364754141571,0.08766960886413708,0.5478278927919431,0.5455455455455456,5.414883259018821,889835 -rd,mp,placebo jump (D),0.011928716366942227,0.15571292616971652,0.9391788758028419,0.953953953953954,1.2000147247699156,139642 -rd,mp,real minus placebo (D_x_real),-0.28706924098800624,0.2198579604470944,0.19640148952325598,0.25725725725725723,-24.954023553749394,139642 -rd,both,placebo jump (D),-0.016032323710668664,0.06199503216936062,0.7961515857825088,0.8108108108108109,-1.5904490077355948,518517 -rd,both,real minus placebo (D_x_real),0.1457867561057011,0.10792357613839959,0.17797020343029213,0.2002002002002002,15.694944933788534,518517 -rd,all,placebo jump (D),-0.03456285364560534,0.04330316833124592,0.4250351416132778,0.4394394394394394,-3.3972380579369466,1547994 -rd,all,real minus placebo (D_x_real),0.09937814992479586,0.06977093646437785,0.1547693700927013,0.14914914914914915,10.448388109626716,1547994 -crossers,sp,placebo jump (D),0.011129802176277336,0.030550214329010096,0.7159190721947652,0.7247247247247247,1.1191968844691313,503647 -crossers,sp,real minus placebo (D_x_real),-0.012758592171361357,0.0418596760432984,0.7607647699262867,0.7647647647647647,-1.2677546377162674,503647 -crossers,mp,placebo jump (D),-0.14983610883291007,0.1298116069336355,0.25357257209453143,0.3483483483483483,-13.915094958008723,98823 -crossers,mp,real minus placebo (D_x_real),0.04890221037276008,0.16063707709770966,0.7619949993463968,0.8028028028028028,5.011765510477528,98823 -crossers,both,placebo jump (D),-0.04562590856387067,0.03359344514303505,0.17600071781205084,0.2022022022022022,-4.460069795536336,333283 -crossers,both,real minus placebo (D_x_real),0.12406217914544339,0.053826777266037414,0.02224482568470365,0.03003003003003003,13.20862609670337,333283 -crossers,all,placebo jump (D),-0.026538615920839087,0.02743846699398653,0.33390101155400664,0.3613613613613614,-2.618956147734841,935753 -crossers,all,real minus placebo (D_x_real),0.04918382865071978,0.03886123064453395,0.2062256123616677,0.23323323323323322,5.04134290761844,935753 diff --git a/ell_results.csv b/ell_results.csv deleted file mode 100644 index 58b9b0f..0000000 --- a/ell_results.csv +++ /dev/null @@ -1,45 +0,0 @@ -spec,cutoffs,effect,est,se,p_cluster,p_boot,pct,games_sp,games_mp,obs,kind,groups,games -rd,"0.70,0.80,0.95",ell (single-player),0.265208179120153,0.16873546980853776,0.1174883263107167,0.36736736736736736,30.370235113844824,177.0,38.0,108814.0,real,2, -rd,"0.70,0.80,0.95",lambda (MP - SP),0.24079426821949287,0.1438965071571863,0.09571258872786093,0.15715715715715717,27.225926421814183,177.0,38.0,108814.0,real,2, -rd,"0.70,0.80,0.95",ell + lambda (multiplayer),0.5060024473396475,0.17595823428508237,0.004438821752944966,0.03803803803803804,65.86473940188667,177.0,38.0,108814.0,real,2, -rd,"0.60,0.75,0.85,0.90",ell (single-player),-0.11451090769572225,0.10680035469337845,0.2851698141725958,0.44288577154308617,-10.819778914208777,127.0,42.0,68608.0,placebo,2, -rd,"0.60,0.75,0.85,0.90",lambda (MP - SP),0.6515154913544425,0.1641431621054619,0.00010668735717511701,0.004008016032064128,91.84460154157541,127.0,42.0,68608.0,placebo,2, -rd,"0.60,0.75,0.85,0.90",ell + lambda (multiplayer),0.5370045836587134,0.11925211523248967,1.2481834758659716e-05,0.0,71.08743979593099,127.0,42.0,68608.0,placebo,2, -rd,0.75,ell (single-player),0.11135281539831196,0.1314350126338556,0.39985109837616317,0.45490981963927857,11.77892105377072,43.0,26.0,15501.0,placebo,2, -rd,0.75,lambda (MP - SP),0.2812247567306166,0.155502444092685,0.07495151997209204,0.12625250501002003,32.47513172524139,43.0,26.0,15501.0,placebo,2, -rd,0.75,ell + lambda (multiplayer),0.39257757212893246,0.12504981706856744,0.0025048505516682695,0.028056112224448898,48.07927290703691,43.0,26.0,15501.0,placebo,2, -rd,0.85,ell (single-player),-0.08368826147021466,0.13172288198583487,0.5281654321932019,0.625250501002004,-8.028207707663526,36.0,14.0,23709.0,placebo,2, -rd,0.85,lambda (MP - SP),0.4212412808507639,0.22036531051087754,0.06179033795158562,0.21643286573146292,52.385191034106306,36.0,14.0,23709.0,placebo,2, -rd,0.85,ell + lambda (multiplayer),0.33755301938055055,0.14757691449839921,0.026534704862240854,0.04208416833667335,40.15139138216857,36.0,14.0,23709.0,placebo,2, -crossers,"0.70,0.80,0.95",ell (single-player),-0.07929516006425846,0.06778788082328821,0.24522297823335815,0.3333333333333333,-7.623277499141845,65.0,25.0,68971.0,real,2, -crossers,"0.70,0.80,0.95",lambda (MP - SP),0.0597621254417001,0.10670142873337357,0.576826898011604,0.6206206206206206,6.158399268512338,65.0,25.0,68971.0,real,2, -crossers,"0.70,0.80,0.95",ell + lambda (multiplayer),-0.01953303462255829,0.07296467959984361,0.7895455662428343,0.8118118118118118,-1.9343500963733162,65.0,25.0,68971.0,real,2, -crossers,"0.60,0.75,0.85,0.90",ell (single-player),0.1071558905145822,0.07857216346093678,0.17599787040066261,0.27054108216432865,11.310776389683742,65.0,27.0,55071.0,placebo,2, -crossers,"0.60,0.75,0.85,0.90",lambda (MP - SP),0.019512580289508755,0.1057832820909215,0.8540645653548062,0.8496993987975952,1.970419495395337,65.0,27.0,55071.0,placebo,2, -crossers,"0.60,0.75,0.85,0.90",ell + lambda (multiplayer),0.12666847080409016,0.07870720189164024,0.11100077983063006,0.19839679358717435,13.504065628141904,65.0,27.0,55071.0,placebo,2, -crossers,0.75,ell (single-player),0.0013139975431374054,0.08451518928250158,0.9876862890862474,0.9939879759519038,0.13148612161557605,19.0,16.0,11487.0,placebo,2, -crossers,0.75,lambda (MP - SP),0.0799733679439065,0.16400626669556098,0.628945901649909,0.7194388777555111,8.325821789717303,19.0,16.0,11487.0,placebo,2, -crossers,0.75,ell + lambda (multiplayer),0.0812873654870437,0.1323435439036874,0.5431618285215545,0.6533066132264529,8.468255211496768,19.0,16.0,11487.0,placebo,2, -crossers,0.85,ell (single-player),0.17623006304267946,0.1219173518155334,0.1590415988104783,0.35070140280561124,19.271242613834882,20.0,10.0,20386.0,placebo,2, -crossers,0.85,lambda (MP - SP),-0.022914461005779638,0.1350161499242592,0.8664115353890729,0.905811623246493,-2.2653918601394207,20.0,10.0,20386.0,placebo,2, -crossers,0.85,ell + lambda (multiplayer),0.1533156020368989,0.05851685664585496,0.013845652108582351,0.014028056112224449,16.569281592173812,20.0,10.0,20386.0,placebo,2, -crossers,"0.70,0.80,0.95",ell single-player,0.006329104879160874,0.08233233043910523,0.9388185528481667,0.9579579579579579,,,,,real,3,65.0 -crossers,"0.70,0.80,0.95",ell multiplayer-only,-0.0059583438610938885,0.08566461791712103,0.9446331363801392,0.953953953953954,,,,,real,3,25.0 -crossers,"0.70,0.80,0.95",ell both,0.08719847247799399,0.055314223063373906,0.11685596035126666,0.14514514514514515,,,,,real,3,75.0 -crossers,"0.70,0.80,0.95",mp-only minus sp,-0.012287448740288129,0.12504481186773275,0.9218423734196226,0.943943943943944,,,,,real,3, -crossers,"0.70,0.80,0.95",both minus sp,0.08086936759878514,0.09537211806148527,0.39770994272513716,0.4394394394394394,,,,,real,3, -crossers,"0.60,0.75,0.85,0.90",ell single-player,0.07166992971293004,0.08492424818509708,0.3997938592550334,0.4248496993987976,,,,,placebo,3,65.0 -crossers,"0.60,0.75,0.85,0.90",ell multiplayer-only,0.08369987916768806,0.07223515341134175,0.24805830610588142,0.3306613226452906,,,,,placebo,3,27.0 -crossers,"0.60,0.75,0.85,0.90",ell both,0.08097278504646685,0.04052070166292885,0.04714012831741732,0.04408817635270541,,,,,placebo,3,95.0 -crossers,"0.60,0.75,0.85,0.90",mp-only minus sp,0.012029949454759326,0.10754642649982243,0.9110564624887634,0.9118236472945892,,,,,placebo,3, -crossers,"0.60,0.75,0.85,0.90",both minus sp,0.009302855333533111,0.08895211301832538,0.9168196030994746,0.9278557114228457,,,,,placebo,3, -rd,"0.70,0.80,0.95",ell single-player,0.22545741499110764,0.1362364880567935,0.09878418663672184,0.18118118118118118,,,,,real,3,177.0 -rd,"0.70,0.80,0.95",ell multiplayer-only,0.43028002694371525,0.13348361370462755,0.0013777404581201136,0.01901901901901902,,,,,real,3,38.0 -rd,"0.70,0.80,0.95",ell both,0.07930716957903333,0.12198106250822549,0.5159882355360925,0.6256256256256256,,,,,real,3,160.0 -rd,"0.70,0.80,0.95",mp-only minus sp,0.20482261195260873,0.1477325368261786,0.1664378534075701,0.22422422422422422,,,,,real,3, -rd,"0.70,0.80,0.95",both minus sp,-0.14615024541207766,0.11461614865696096,0.20305552021560191,0.22522522522522523,,,,,real,3, -rd,"0.60,0.75,0.85,0.90",ell single-player,-0.22105247468145903,0.11121985594200143,0.04767305942380484,0.09619238476953908,,,,,placebo,3,127.0 -rd,"0.60,0.75,0.85,0.90",ell multiplayer-only,0.2921179444375056,0.12033409256097834,0.015724211753443518,0.03006012024048096,,,,,placebo,3,42.0 -rd,"0.60,0.75,0.85,0.90",ell both,0.036533405214211175,0.07519781957403315,0.627402972967396,0.6593186372745491,,,,,placebo,3,169.0 -rd,"0.60,0.75,0.85,0.90",mp-only minus sp,0.5131704191189583,0.1583899177891829,0.0013148092559693847,0.012024048096192385,,,,,placebo,3, -rd,"0.60,0.75,0.85,0.90",both minus sp,0.2575858798956652,0.12785532757291568,0.04473350853787239,0.1282565130260521,,,,,placebo,3, diff --git a/ell_triple.csv b/ell_triple.csv deleted file mode 100644 index 8c6dd14..0000000 --- a/ell_triple.csv +++ /dev/null @@ -1,9 +0,0 @@ -spec,effect,est,se,ci_low,ci_high,p_cluster,p_boot,obs -rd,"placebo jump, sp",0.038729173504570814,0.05224716905952501,-0.0636752778520982,0.14113362486123984,0.45896139420367765,0.4944944944944945,331008 -rd,"real minus placebo, sp",-0.002119147098953385,0.08678998574633341,-0.17222751916176687,0.1679892249638601,0.9805320804208619,0.9769769769769769,331008 -rd,"placebo jump, mp minus sp",-0.031610781279016106,0.15232032593231748,-0.3301586201063584,0.26693705754832614,0.8357018459247958,0.8748748748748749,331008 -rd,TRIPLE: (mp real-placebo) minus (sp real-placebo),-0.5174571339450283,0.2499685958284159,-1.0073955817687235,-0.02751868612133318,0.039078970434134774,0.0970970970970971,331008 -crossers,"placebo jump, sp",-0.005986639366604475,0.027054625608215616,-0.05901370555870708,0.047040426825498124,0.8250184843445094,0.8168168168168168,268627 -crossers,"real minus placebo, sp",1.1725106155952166e-05,0.03615493841939818,-0.07085195419586449,0.07087540440817638,0.9997414506586217,0.998998998998999,268627 -crossers,"placebo jump, mp minus sp",-0.02918863322850976,0.1106608664730715,-0.24608393151572988,0.18770666505871036,0.792132840879243,0.8138138138138138,268627 -crossers,TRIPLE: (mp real-placebo) minus (sp real-placebo),-0.16322637039369314,0.15582790262998333,-0.4686490595484605,0.1421963187610742,0.295684575344922,0.3923923923923924,268627 diff --git a/event-study.py b/event-study.py deleted file mode 100644 index c0d7aed..0000000 --- a/event-study.py +++ /dev/null @@ -1,216 +0,0 @@ -""" -Event study around the first clean crossing of a review-label cutoff. - -For each game and cutoff we find the first day t0 where the lagged score S_{t-1} crosses c -(up: from below to above; down: from above to below), requiring a clean crossing: - - PRE_CLEAN days before t0 the score stayed on the old side, - - PERSIST days from t0 the score stayed on the new side. -Then, in a +-EV_WIN day window around t0: - ln(1+R) = event FE + date FE + sum_k b_k * 1[bin(k)=k] (reference bin: -1) -Plots b_k (event-study) and the share of days above the cutoff (first stage). -Also a step estimate: ln(1+R) = post + k + k*post | event FE + date FE. -Expected sign if the label matters: positive for up-crossings, negative for down-crossings. -""" -import numpy as np -import pandas as pd -import matplotlib -matplotlib.use("Agg") -import matplotlib.pyplot as plt -import pyfixest as pf - -from game_test import load, add_groups, build, boot_p, DATA_GLOB, MIN_REVIEWS - -# ----------------------------------------------------------------- settings -EV_WIN = 30 # days before/after the crossing -EV_BIN = 3 # bin width in days (daily data is too noisy) -PRE_CLEAN = 14 # days before crossing that must be on the old side -PERSIST = 7 # days from crossing that must be on the new side (1 = intent-to-treat) -REAL_CUTS = [0.70, 0.80] # 0.95 adds almost no events -PLACEBO_CUTS = [0.75, 0.85] # no label change here -MIN_EVENTS = 15 # skip cells with fewer events -BOOT_REPS = 499 - - -# ----------------------------------------------------------------- events -def find_events(df, cutoffs, direction): - out = [] - for sheet, g in df.groupby("sheet"): - g = g.sort_values("date") - grp = g["group"].iloc[0] - g = g.set_index("date") - g = g.reindex(pd.date_range(g.index.min(), g.index.max(), freq="D")) - S, L, N = g["S_lag"].to_numpy(), g["lnR"].to_numpy(), g["N_lag"].to_numpy() - n, dates = len(S), g.index - known = ~np.isnan(S) - for c in cutoffs: - above = S >= c - if direction == "up": - hits = np.where(above[1:] & ~above[:-1] & known[1:] & known[:-1])[0] + 1 - else: - hits = np.where(~above[1:] & above[:-1] & known[1:] & known[:-1])[0] + 1 - for t in hits: - if t < PRE_CLEAN or t + PERSIST > n or not N[t] >= MIN_REVIEWS: - continue - pre, post = S[t - PRE_CLEAN:t], S[t:t + PERSIST] - pk, qk = ~np.isnan(pre), ~np.isnan(post) - if pk.mean() < 0.7 or qk.mean() < 0.7: - continue - if direction == "up": - ok = (pre[pk] < c).all() and (post[qk] >= c).all() - else: - ok = (pre[pk] >= c).all() and (post[qk] < c).all() - if not ok: - continue - idx = np.arange(max(t - EV_WIN, 0), min(t + EV_WIN, n)) - k = idx - t - fr = pd.DataFrame({"sheet": sheet, "group": grp, "cutoff": c, - "eid": f"{sheet}_{c:.2f}", "k": k, - "kb": np.floor_divide(k, EV_BIN), - "lnR": L[idx], "D": above[idx].astype(int), - "date": dates[idx]}) - out.append(fr.dropna(subset=["lnR"])) - break # first clean crossing only - return pd.concat(out, ignore_index=True) if out else pd.DataFrame() - - -# ----------------------------------------------------------------- estimation -def estimate(ev): - ev = ev.copy() - ev["gid"] = pd.factorize(ev["sheet"])[0] # integer cluster id (numba) - ev["eid_i"] = pd.factorize(ev["eid"])[0] - ev["date_i"] = pd.factorize(ev["date"])[0] - ref = -1 - names = {} - for b in sorted(ev["kb"].unique()): - if b == ref: - continue - nm = f"k_{'m' if b < 0 else 'p'}{abs(b)}" - ev[nm] = (ev["kb"] == b).astype(int) - names[b] = nm - cl = {"CRV1": "gid"} - m = pf.feols(f"lnR ~ {' + '.join(names.values())} | eid_i + date_i", data=ev, vcov=cl) - t = m.tidy() - coefs = [] - for b, nm in names.items(): - if nm in t.index: - e, s = float(t.loc[nm, "Estimate"]), float(t.loc[nm, "Std. Error"]) - coefs.append((b, e, s)) - coefs.append((ref, 0.0, 0.0)) - coefs = pd.DataFrame(coefs, columns=["kb", "est", "se"]).sort_values("kb") - - ev["post"] = (ev["k"] >= 0).astype(int) - ev["k_post"] = ev["k"] * ev["post"] - ms = pf.feols("lnR ~ post + k + k_post | eid_i + date_i", data=ev, vcov=cl) - ts = ms.tidy() - step = dict(est=float(ts.loc["post", "Estimate"]), se=float(ts.loc["post", "Std. Error"]), - p_cluster=float(ts.loc["post", "Pr(>|t|)"])) - first_stage = ev.groupby("kb")["D"].mean() - return coefs, step, first_stage - -def plot(coefs, first_stage, title, path): - fig, (a1, a2) = plt.subplots(2, 1, figsize=(8, 7), sharex=True, - gridspec_kw={"height_ratios": [3, 1.3]}) - x = coefs["kb"] * EV_BIN - a1.errorbar(x, coefs["est"], yerr=1.96 * coefs["se"], fmt="o-", capsize=3) - a1.axhline(0, color="grey", lw=0.8) - a1.axvline(-0.5, color="red", ls="--", lw=0.8) - a1.set_ylabel("ln(1+reviews) vs bin -1") - a1.set_title(title) - a2.plot(first_stage.index * EV_BIN, first_stage.values, "s-") - a2.axvline(-0.5, color="red", ls="--", lw=0.8) - a2.set_ylim(0, 1) - a2.set_ylabel("share above cutoff") - a2.set_xlabel(f"days since crossing (bin start, {EV_BIN}-day bins)") - fig.tight_layout() - fig.savefig(path, dpi=150) - plt.close(fig) - - -def pooled_signed(ev_up, ev_down): - ev = pd.concat([ev_up.assign(sgn=1, dirn="up"), - ev_down.assign(sgn=-1, dirn="down")], ignore_index=True) - ev["eid"] = ev["eid"] + "_" + ev["dirn"] - ev["gid"] = pd.factorize(ev["sheet"])[0] - ev["eid_i"] = pd.factorize(ev["eid"])[0] - ev["date_dir"] = pd.factorize(ev["date"].astype(str) + "_" + ev["dirn"])[0] # date FE per direction - ev["post"] = (ev["k"] >= 0).astype(int) - ev["post_s"] = ev["post"] * ev["sgn"] # +post for up, -post for down - up = (ev["sgn"] == 1).astype(int) - ev["kp_up"] = ev["k"] * ev["post"] * up # linear trend is absorbed by the FEs, - ev["kp_dn"] = ev["k"] * ev["post"] * (1 - up) # only the change at the crossing is identified - m = pf.feols("lnR ~ post_s + kp_up + kp_dn | eid_i + date_dir", - data=ev, vcov={"CRV1": "gid"}) - t = m.tidy() - return (float(t.loc["post_s", "Estimate"]), float(t.loc["post_s", "Std. Error"]), - float(t.loc["post_s", "Pr(>|t|)"]), ev["eid"].nunique(), ev["sheet"].nunique()) -# ----------------------------------------------------------------- run -if __name__ == "__main__": - import warnings - warnings.filterwarnings("ignore", category=UserWarning, module="pyfixest") - - df = build(add_groups(load(DATA_GLOB))) - rows, pooled = [], [] - - - - for kind, cuts in [("real", REAL_CUTS), ("placebo", PLACEBO_CUTS)]: - ups, downs = find_events(df, cuts, "up"), find_events(df, cuts, "down") - - # ---- pooled signed step (up and down combined) - if not ups.empty and not downs.empty: - e, s, p, n_ev, n_g = pooled_signed(ups, downs) - print(f"{kind}: signed step {e:.4f} (SE {s:.4f}, p {p:.3f}), " - f"{n_ev} events, {n_g} games, {100*(np.exp(e)-1):.1f}%") - pooled.append(dict(kind=kind, est=e, se=s, p_cluster=p, events=n_ev, - games=n_g, pct=100 * (np.exp(e) - 1))) - - # ---- per direction and group, with plots - for direction, ev_all in [("up", ups), ("down", downs)]: - if ev_all.empty: - print(f"[{kind} {direction}] no events") - continue - for grp in [None, "sp", "mp", "both"]: - ev = ev_all if grp is None else ev_all[ev_all["group"] == grp] - n_ev = ev["eid"].nunique() - label = f"{kind} {direction} {grp or 'all'}" - if n_ev < MIN_EVENTS: - print(f"[{label}] only {n_ev} events, skipped") - continue - coefs, step, fs = estimate(ev) - rows.append(dict(kind=kind, direction=direction, group=grp or "all", - cutoffs=",".join(f"{c:.2f}" for c in cuts), - events=n_ev, games=ev["sheet"].nunique(), - pct=100 * (np.exp(step["est"]) - 1), **step)) - if grp is None: - plot(coefs, fs, f"{kind}: {direction}-crossings of {cuts}, {n_ev} events", - f"event_{kind}_{direction}.png") - - - fake = [0.725, 0.775, 0.825, 0.875, 0.925] - out = [] - for c in fake: - u, d = find_events(df, [c], "up"), find_events(df, [c], "down") - if u.empty or d.empty or u["eid"].nunique() < 10 or d["eid"].nunique() < 10: - print(f"fake {c}: too few events, skipped") - continue - e, s, p, n_ev, n_g = pooled_signed(u, d) - out.append(dict(cutoff=c, est=e, se=s, p=p, events=n_ev)) - pl = pd.DataFrame(out) - print(pl.to_string(index=False)) - print("real est 0.104 vs placebo estimates above bigger:", - int((pl["est"] > 0.104).sum()), "of", len(pl)) - - real_est = pooled[0]["est"] # the "real" row, computed in the loop above - print(f"real est {real_est:.3f}; placebo estimates larger: " - f"{int((pl['est'] > real_est).sum())} of {len(pl)}") - - pd.set_option("display.float_format", lambda x: f"{x:.4f}") - pd.set_option("display.width", 220) - - res = pd.DataFrame(rows).drop(columns=["p_boot"], errors="ignore") # p_boot is broken here - print("\nSTEP ESTIMATES (post = jump at crossing, log points; use p_cluster):") - print(res.to_string(index=False)) - res.to_csv("event_results.csv", index=False) - - pd.DataFrame(pooled).to_csv("event_pooled.csv", index=False) - print("Saved event_results.csv, event_pooled.csv and event_*.png") \ No newline at end of file diff --git a/event_placebo_down.png b/event_placebo_down.png deleted file mode 100644 index f09fa2b..0000000 Binary files a/event_placebo_down.png and /dev/null differ diff --git a/event_placebo_up.png b/event_placebo_up.png deleted file mode 100644 index b55a9e4..0000000 Binary files a/event_placebo_up.png and /dev/null differ diff --git a/event_pooled.csv b/event_pooled.csv deleted file mode 100644 index 37523e4..0000000 --- a/event_pooled.csv +++ /dev/null @@ -1,3 +0,0 @@ -kind,est,se,p_cluster,events,games,pct -real,-0.0030531499178668197,0.023879919807555706,0.8983417020392981,453,336,-0.30484937954750047 -placebo,0.022755139724486766,0.019991570973315425,0.25574255842134397,509,382,2.3016012893684934 diff --git a/event_real_down.png b/event_real_down.png deleted file mode 100644 index 18085c8..0000000 Binary files a/event_real_down.png and /dev/null differ diff --git a/event_real_up.png b/event_real_up.png deleted file mode 100644 index 16b2878..0000000 Binary files a/event_real_up.png and /dev/null differ diff --git a/event_results.csv b/event_results.csv deleted file mode 100644 index de72a06..0000000 --- a/event_results.csv +++ /dev/null @@ -1,17 +0,0 @@ -kind,direction,group,cutoffs,events,games,pct,est,se,p_cluster -real,up,all,"0.70,0.80",199,192,-10.648417880250404,-0.11259123754726014,0.03748381331330474,0.003036175460825463 -real,up,sp,"0.70,0.80",82,82,-14.260612766375191,-0.15385787164080356,0.04732229113114258,0.0017222892195427608 -real,up,mp,"0.70,0.80",32,31,2.7376781824437035,0.027008739831719256,0.15879294661224932,0.8668382155151342 -real,up,both,"0.70,0.80",85,79,-3.732994749991936,-0.038044550503742024,0.06776543903173138,0.5763075029936569 -real,down,all,"0.70,0.80",254,251,-7.049311425745519,-0.07310106384103623,0.03046442915180092,0.01714758261768523 -real,down,sp,"0.70,0.80",121,121,-9.33502075376833,-0.09799901978819309,0.055758994670060034,0.08150904843863604 -real,down,mp,"0.70,0.80",31,30,-4.892878350759378,-0.05016633333897211,0.07007409209758021,0.48193599344217275 -real,down,both,"0.70,0.80",102,100,-2.0368671079089684,-0.020578973075265076,0.05809804137107864,0.7239574918770453 -placebo,up,all,"0.75,0.85",224,217,-4.279014776164192,-0.04373263023202346,0.029390974114973406,0.13826116656403387 -placebo,up,sp,"0.75,0.85",105,101,-3.035523159957687,-0.03082549270284303,0.05606165581277423,0.5837264713818384 -placebo,up,mp,"0.75,0.85",26,25,3.8747925642916847,0.03801607021119906,0.0641392053416555,0.5628261450649412 -placebo,up,both,"0.75,0.85",93,91,-8.197555648011912,-0.08553126178816213,0.05992048292715752,0.15740188856998882 -placebo,down,all,"0.75,0.85",285,282,-6.63200617406835,-0.06862157800421213,0.02636865772058945,0.009755888562036796 -placebo,down,sp,"0.75,0.85",154,153,-2.9559639672159577,-0.030005330782900772,0.04066495096595017,0.4617635171572614 -placebo,down,mp,"0.75,0.85",30,30,-4.681505709375511,-0.047946330245884024,0.06177954983927433,0.4490182036319892 -placebo,down,both,"0.75,0.85",101,99,-5.8047247818605925,-0.05980016258363823,0.0571807133470576,0.29857933071246534 diff --git a/filter.py b/filter.py deleted file mode 100644 index ca67f92..0000000 --- a/filter.py +++ /dev/null @@ -1,389 +0,0 @@ -""" -Label-cutoff RD, run separately for single-player (sp), multiplayer-only (mp), -both, and all games pooled. Self-contained. - -Inputs: - game_tags.csv columns: sheet, genres, group ("sp"/"mp"/"both"), price - data/.csv columns: date, positive, negative - -Install: pip install pandas numpy pyfixest -""" -import os - -import numpy as np -import pandas as pd - -# ----------------------------------------------------------------- settings -DATA_DIR = "data" -TAGS_FILE = "game_tags.csv" - -# game selection -GAME_GENRES = { - 'Action', 'Indie', 'Simulation', 'Strategy', 'RPG', 'Early Access', - 'Casual', 'Adventure', 'Free To Play', 'Massively Multiplayer', - 'Racing', 'Sports', 'Episodic', -} -MIN_SPAN_DAYS = 365 # first to last date -MAX_SPAN_DAYS = 10 * 365 -MIN_TOTAL_REVIEWS = 2000 # all reviews in the file - -# RD settings -W = 0.01 # window half-width in score; also try 0.01 and 0.03 -MIN_REVIEWS = 500 # min cumulative reviews before a game-day is used -TRIM_Q = 0.99 # drop each game's top 1% burst days (None = off) -MIN_GAMES = 10 # per group AND per side of the cutoff -TIME_FE = "month" -CUTOFFS = [0.70, 0.80, 0.95] -PLACEBOS = [0.60, 0.75, 0.85, 0.90] -BOOT_REPS = 999 -PLACEBO_REPS = 499 -SEED = 42 - - -# ----------------------------------------------------------------- step 1: choose games, load panel -def load_tags(): - tags = pd.read_csv(TAGS_FILE, dtype={"sheet": str}) - tags["sheet"] = tags["sheet"].str.strip() - tags = tags.drop_duplicates("sheet") - tags["group"] = tags["group"].astype(str).str.strip().str.lower() - if "price" not in tags.columns: - tags["price"] = np.nan - tags["price"] = pd.to_numeric(tags["price"], errors="coerce") # "NA"/blank -> NaN - return tags - - -def select_and_load(tags): - """Genre filter, then read each game file once, apply span/review filters, - fill missing days with zero reviews. Returns the daily panel for kept games.""" - mask = tags["genres"].fillna("").str.split(";").apply( - lambda gs: any(g.strip() in GAME_GENRES for g in gs)) - games = tags[mask] - print(f"tag rows: {len(tags)}, real games (genre filter): {len(games)}") - - frames, n_nofile, n_span, n_rev = [], 0, 0, 0 - for sheet in games["sheet"]: - path = os.path.join(DATA_DIR, f"{sheet}.csv") - if not os.path.exists(path): - n_nofile += 1 - continue - d = pd.read_csv(path, parse_dates=["date"])[["date", "positive", "negative"]] - d[["positive", "negative"]] = (d[["positive", "negative"]] - .apply(pd.to_numeric, errors="coerce").fillna(0).abs()) - if d.empty: - n_nofile += 1 - continue - - span = (d["date"].max() - d["date"].min()).days + 1 - if not (MIN_SPAN_DAYS <= span <= MAX_SPAN_DAYS): - n_span += 1 - continue - if d["positive"].sum() + d["negative"].sum() < MIN_TOTAL_REVIEWS: - n_rev += 1 - continue - - full = pd.date_range(d["date"].min(), d["date"].max(), freq="D") - d = (d.groupby("date")[["positive", "negative"]].sum() - .reindex(full, fill_value=0) - .rename_axis("date").reset_index()) - d["sheet"] = sheet - frames.append(d) - - print(f"dropped: no file/empty {n_nofile}, span {n_span}, reviews {n_rev}; kept {len(frames)}") - if not frames: - raise SystemExit("No games left after filtering") - return pd.concat(frames, ignore_index=True) - - -def add_groups(df, tags): - df = df.merge(tags[["sheet", "group", "price"]], on="sheet", how="left") - df = df[df["group"].isin(["sp", "mp", "both"])].copy() - df["MP"] = (df["group"] == "mp").astype(int) - df["BOTH"] = (df["group"] == "both").astype(int) - df["no_price"] = df["price"].isna().astype(int) - df["ln_price"] = np.log1p(df["price"].fillna(0)) - print("games per group:", df.groupby("group")["sheet"].nunique().to_dict()) - return df - - -def build(df): - df = df.sort_values(["sheet", "date"]).reset_index(drop=True) - df[["positive", "negative"]] = df[["positive", "negative"]].astype(int) - df["R"] = df["positive"] + df["negative"] - - g = df.groupby("sheet") - df["cum_pos"] = g["positive"].cumsum() - df["cum_tot"] = g["R"].cumsum() - df["score"] = df["cum_pos"] / df["cum_tot"].replace(0, np.nan) - - g = df.groupby("sheet") - df["S_lag"] = g["score"].shift(1) - df["N_lag"] = g["cum_tot"].shift(1) - df["lnR"] = np.log1p(df["R"]) - df["ln_N"] = np.log(df["N_lag"].clip(lower=1)) - - first = g["date"].transform("min") # CSV must start at release - df["age"] = (df["date"] - first).dt.days - df["ln_age"] = np.log1p(df["age"]) - df["rel_year"] = first.dt.year.astype(str) - df["month"] = df["date"].dt.to_period("M").astype(str) - - if TRIM_Q is not None: - q = df.groupby("sheet")["R"].transform(lambda x: x.quantile(TRIM_Q)) - before = len(df) - df = df[df["R"] <= q] - print(f"burst filter dropped {before - len(df)} game-days") - - return df.dropna(subset=["S_lag", "N_lag"]) - - -# ----------------------------------------------------------------- RD helpers -def stack(df, cutoffs, spec="rd"): - """One row per game-day per cutoff, inside the window. - spec="crossers": keep only games seen on both sides of that cutoff in the window.""" - base = df[df["N_lag"] >= MIN_REVIEWS] - parts = [] - for c in cutoffs: - s = base[(base["S_lag"] - c).abs() <= W].copy() - s["cut"] = f"{c:.3f}" - s["dist"] = s["S_lag"] - c - s["D"] = (s["dist"] >= 0).astype(int) - if spec == "crossers": - crosses = s.groupby("sheet")["D"].nunique() >= 2 - s = s[s["sheet"].isin(crosses[crosses].index)] - parts.append(s) - s = pd.concat(parts, ignore_index=True) - if s.empty: - return s - s["dist_x_D"] = s["dist"] * s["D"] - s["gid"] = pd.factorize(s["sheet"])[0] # cluster id - s["gc"] = pd.factorize(s["sheet"] + "_" + s["cut"])[0] # game x cutoff FE - return s - - -def boot_p(model, param, reps): - """Wild cluster bootstrap p-value for one coefficient.""" - try: - r = model.wildboottest(param=param, reps=reps, seed=SEED) - return float(r["Pr(>|t|)"]) - except Exception as e: - print(f" bootstrap failed for {param}: {e}") - return np.nan - - -def fit_group(df, cutoffs, reps, group, spec="rd"): - """Label effect (jump D) for one subset: 'sp', 'mp', 'both' or 'all'.""" - sub = df if group == "all" else df[df["group"] == group] - - s = stack(sub, cutoffs, spec) - if s.empty: - print(f"[{spec}] {group} {cutoffs}: no rows, skipped") - return None - - side = s.groupby("D")["sheet"].nunique() - n0, n1 = int(side.get(0, 0)), int(side.get(1, 0)) - if min(n0, n1) < MIN_GAMES: - print(f"[{spec}] {group} {cutoffs}: games below/above = {n0}/{n1} " - f"(need {MIN_GAMES}), skipped") - return None - - regs = ["D", "dist", "dist_x_D"] - if group == "all": - # separate slopes per group so the pooled jump is not driven by slope differences - for g in ("MP", "BOTH"): - s[f"dist_x_{g}"] = s["dist"] * s[g] - s[f"dist_x_D_x_{g}"] = s["dist_x_D"] * s[g] - regs += [f"dist_x_{g}", f"dist_x_D_x_{g}"] - - if spec == "rd": - ctrl = [c for c in ["ln_age", "ln_N", "ln_price", "no_price"] if s[c].nunique() > 1] - if group == "all": - ctrl += [c for c in ["MP", "BOTH"] if s[c].nunique() > 1] - fes = [TIME_FE, "rel_year"] + (["cut"] if s["cut"].nunique() > 1 else []) - else: # crossers: game x cutoff FE absorbs price, release year, group level - ctrl = [c for c in ["ln_age", "ln_N"] if s[c].nunique() > 1] - fes = ["gc", TIME_FE] - - import pyfixest as pf - m = pf.feols(f"lnR ~ {' + '.join(regs + ctrl)} | {' + '.join(fes)}", - data=s, vcov={"CRV1": "gid"}) - t = m.tidy() - if "D" not in t.index: - print(f"[{spec}] {group}: D dropped as collinear, skipped") - return None - - est = float(t.loc["D", "Estimate"]) - return pd.DataFrame([dict( - spec=spec, group=group, cutoffs=",".join(f"{c:.2f}" for c in cutoffs), - est=est, se=float(t.loc["D", "Std. Error"]), - p_cluster=float(t.loc["D", "Pr(>|t|)"]), - p_boot=boot_p(m, "D", reps), - pct=100 * (np.exp(est) - 1), - games_below=n0, games_above=n1, obs=int(m._N))]) - - -def test_all_groups(df, cutoffs, reps, spec="rd", per_cutoff=False): - sets = [cutoffs] + ([[c] for c in cutoffs] if per_cutoff else []) - out = [fit_group(df, cs, reps, g, spec) - for cs in sets for g in ("sp", "mp", "both", "all")] - out = [o for o in out if o is not None] - return pd.concat(out, ignore_index=True) if out else None - -def fit_did(df, group, spec="rd", reps=BOOT_REPS): - """Difference-in-discontinuities: real-cutoff jump minus average placebo jump.""" - sub = df if group == "all" else df[df["group"] == group] - - s = stack(sub, CUTOFFS + PLACEBOS, spec) # real and placebo cutoffs together - if s.empty: - return None - - real_cuts = [f"{c:.3f}" for c in CUTOFFS] - s["real"] = s["cut"].isin(real_cuts).astype(int) - - # check there are enough games on each side for both kinds of cutoff - side = s.groupby(["real", "D"])["sheet"].nunique() - if side.min() < MIN_GAMES or len(side) < 4: - print(f"[{spec}] {group}: too few games per side {side.to_dict()}, skipped") - return None - - s["D_x_real"] = s["D"] * s["real"] - s["dist_x_real"] = s["dist"] * s["real"] - s["dist_x_D_x_real"] = s["dist_x_D"] * s["real"] - regs = ["D", "D_x_real", "dist", "dist_x_D", "dist_x_real", "dist_x_D_x_real"] - - if group == "all": # group-specific slopes, as before - for g in ("MP", "BOTH"): - s[f"dist_x_{g}"] = s["dist"] * s[g] - s[f"dist_x_D_x_{g}"] = s["dist_x_D"] * s[g] - regs += [f"dist_x_{g}", f"dist_x_D_x_{g}"] - - if spec == "rd": - ctrl = [c for c in ["ln_age", "ln_N", "ln_price", "no_price"] if s[c].nunique() > 1] - if group == "all": - ctrl += [c for c in ["MP", "BOTH"] if s[c].nunique() > 1] - fes = [TIME_FE, "rel_year", "cut"] # "cut" absorbs the real dummy - else: - ctrl = [c for c in ["ln_age", "ln_N"] if s[c].nunique() > 1] - fes = ["gc", TIME_FE] - - import pyfixest as pf - m = pf.feols(f"lnR ~ {' + '.join(regs + ctrl)} | {' + '.join(fes)}", - data=s, vcov={"CRV1": "gid"}) - t = m.tidy() - - rows = [] - for label, par in [("placebo jump (D)", "D"), - ("real minus placebo (D_x_real)", "D_x_real")]: - est = float(t.loc[par, "Estimate"]) - rows.append(dict(spec=spec, group=group, effect=label, est=est, - se=float(t.loc[par, "Std. Error"]), - p_cluster=float(t.loc[par, "Pr(>|t|)"]), - p_boot=boot_p(m, par, reps), - pct=100 * (np.exp(est) - 1), - obs=int(m._N))) - return pd.DataFrame(rows) - -def fit_did_mp(df, spec="rd", reps=BOOT_REPS): - """Triple difference: (mp real-minus-placebo) minus (sp real-minus-placebo).""" - sub = df[df["group"].isin(["sp", "mp"])] # "both" excluded - s = stack(sub, CUTOFFS + PLACEBOS, spec) - if s.empty: - return None - - real_cuts = [f"{c:.3f}" for c in CUTOFFS] - s["real"] = s["cut"].isin(real_cuts).astype(int) - - # games per cell: MP x real x side of cutoff - cells = s.groupby(["MP", "real", "D"])["sheet"].nunique() - print(f"[{spec}] games per cell (MP, real, D):\n{cells.to_string()}") - if len(cells) < 8 or cells.min() < MIN_GAMES: - print(f"[{spec}] some cell has fewer than {MIN_GAMES} games, skipped") - return None - - # jump terms - s["D_x_real"] = s["D"] * s["real"] - s["D_x_MP"] = s["D"] * s["MP"] - s["D_x_real_x_MP"] = s["D"] * s["real"] * s["MP"] - regs = ["D", "D_x_real", "D_x_MP", "D_x_real_x_MP"] - - # slopes: fully interacted so slope differences don't leak into the jump - for v in ("dist", "dist_x_D"): - s[f"{v}_x_real"] = s[v] * s["real"] - s[f"{v}_x_MP"] = s[v] * s["MP"] - s[f"{v}_x_real_x_MP"] = s[v] * s["real"] * s["MP"] - regs += [v, f"{v}_x_real", f"{v}_x_MP", f"{v}_x_real_x_MP"] - - if spec == "rd": - s["real_x_MP"] = s["real"] * s["MP"] - ctrl = [c for c in ["ln_age", "ln_N", "ln_price", "no_price", - "MP", "real_x_MP"] if s[c].nunique() > 1] - fes = [TIME_FE, "rel_year", "cut"] # "cut" absorbs the real dummy - else: # gc absorbs MP and real x MP - ctrl = [c for c in ["ln_age", "ln_N"] if s[c].nunique() > 1] - fes = ["gc", TIME_FE] - - import pyfixest as pf - m = pf.feols(f"lnR ~ {' + '.join(regs + ctrl)} | {' + '.join(fes)}", - data=s, vcov={"CRV1": "gid"}) - t = m.tidy() - - labels = {"D": "placebo jump, sp", - "D_x_real": "real minus placebo, sp", - "D_x_MP": "placebo jump, mp minus sp", - "D_x_real_x_MP": "TRIPLE: (mp real-placebo) minus (sp real-placebo)"} - rows = [] - for par, label in labels.items(): - if par not in t.index: - continue - est = float(t.loc[par, "Estimate"]) - se = float(t.loc[par, "Std. Error"]) - rows.append(dict(spec=spec, effect=label, est=est, se=se, - ci_low=est - 1.96 * se, ci_high=est + 1.96 * se, - p_cluster=float(t.loc[par, "Pr(>|t|)"]), - p_boot=boot_p(m, par, reps), - obs=int(m._N))) - return pd.DataFrame(rows) - -# ----------------------------------------------------------------- run -if __name__ == "__main__": - import warnings - warnings.filterwarnings("ignore", category=UserWarning, module="pyfixest") - pd.set_option("display.float_format", lambda x: f"{x:.4f}") - pd.set_option("display.width", 220) - - tags = load_tags() - df = build(add_groups(select_and_load(tags), tags)) - print(df["sheet"].nunique(), "games with lagged score,", - df[df["N_lag"] >= MIN_REVIEWS]["sheet"].nunique(), f"with {MIN_REVIEWS}+ reviews") - - - tri = [fit_did_mp(df, spec) for spec in ["rd", "crossers"]] - tri = pd.concat([x for x in tri if x is not None], ignore_index=True) - print(tri.to_string(index=False)) - tri.to_csv("ell_triple.csv", index=False) - - ''' - did = [fit_did(df, g, spec) for spec in ["rd", "crossers"] - for g in ("sp", "mp", "both", "all")] - did = pd.concat([d for d in did if d is not None], ignore_index=True) - print(did.to_string(index=False)) - did.to_csv("ell_did.csv", index=False) - - - res = [] - for spec in ["rd", "crossers"]: - print(f"\n=== {spec.upper()} by group: real cutoffs (stacked, plus each cutoff) ===") - real = test_all_groups(df, CUTOFFS, BOOT_REPS, spec, per_cutoff=True) - if real is not None: - print(real.to_string(index=False)) - res.append(real.assign(kind="real")) - - print(f"\n=== {spec.upper()} by group: placebos ===") - plc = test_all_groups(df, PLACEBOS, PLACEBO_REPS, spec, per_cutoff=True) - if plc is not None: - print(plc.to_string(index=False)) - res.append(plc.assign(kind="placebo")) - - if res: - pd.concat(res).to_csv("ell_by_group.csv", index=False) - print("Saved ell_by_group.csv") - ''' \ No newline at end of file diff --git a/game_tags.csv b/game_tags.csv index dcbe74e..e5205df 100644 --- a/game_tags.csv +++ b/game_tags.csv @@ -58,9 +58,9 @@ sheet,group,name,categories,price,currency,genres 203770,both,Crusader Kings II,Single-player;Multi-player;Steam Trading Cards;Family Sharing,0,,RPG;Simulation;Strategy;Free To Play 2054970,sp,Dragon's Dogma 2,Single-player;Steam Achievements;Steam Trading Cards;Gamepad Recommended;DualShock Controller Support;DualSense Controller Support;Partial Controller Support;Steam Cloud;HDR available;Family Sharing,39.99,USD,Action;RPG 208650,sp,Batman™: Arkham Knight,Single-player;Steam Achievements;Full controller support;Steam Trading Cards;Steam Cloud;Steam Leaderboards;Remote Play on Phone;Remote Play on Tablet;Remote Play on TV;Family Sharing,19.99,USD,Action;Adventure -2113850,sp,Spirit City: Lofi Sessions,Single-player;Steam Achievements;Steam Trading Cards;Steam Cloud;Stats;Family Sharing,11.99,USD, -2116120,both,Incursion Red River,Single-player;Multi-player;Co-op;Online Co-op;Steam Achievements;Steam Cloud;Family Sharing,21.99,USD, -2129530,both,REANIMAL,Single-player;Multi-player;Co-op;Online Co-op;Shared/Split Screen Co-op;Shared/Split Screen;Cross-Platform Multiplayer;Steam Achievements;Full controller support;Steam Trading Cards;Custom Volume Controls;Gamepad Recommended;Playable without Timed Input;DualShock Controller Support;DualSense Controller Support;Stereo Sound;Surround Sound;Steam Cloud;Remote Play Together;HDR available;Family Sharing,39.99,USD, +2113850,sp,Spirit City: Lofi Sessions,Single-player;Steam Achievements;Steam Trading Cards;Steam Cloud;Stats;Family Sharing,11.99,USD,Casual;Indie;Simulation +2116120,both,Incursion Red River,Single-player;Multi-player;Co-op;Online Co-op;Steam Achievements;Steam Cloud;Family Sharing,21.99,USD,Action;Early Access +2129530,both,REANIMAL,Single-player;Multi-player;Co-op;Online Co-op;Shared/Split Screen Co-op;Shared/Split Screen;Cross-Platform Multiplayer;Steam Achievements;Full controller support;Steam Trading Cards;Custom Volume Controls;Gamepad Recommended;Playable without Timed Input;DualShock Controller Support;DualSense Controller Support;Stereo Sound;Surround Sound;Steam Cloud;Remote Play Together;HDR available;Family Sharing,39.99,USD,Adventure 2139460,mp,Once Human,Multi-player;MMO;PvP;Online PvP;Co-op;Online Co-op;Full controller support;Steam Trading Cards;In-App Purchases;DualShock Controller Support;DualShock Controller Support;DualSense Controller Support;DualSense Controller Support;Family Sharing,0,, 214950,both,Total War: ROME II - Emperor Edition,Single-player;Multi-player;PvP;Online PvP;LAN PvP;Co-op;Online Co-op;LAN Co-op;Steam Trading Cards;Camera Comfort;Custom Volume Controls;Adjustable Difficulty;Playable without Timed Input;Save Anytime;Stereo Sound;Surround Sound;Steam Cloud;Family Sharing,29.99,USD, 218620,both,PAYDAY 2,Single-player;Multi-player;Co-op;Online Co-op;Steam Achievements;Full controller support;Tracked Controller Support;VR Supported;Steam Trading Cards;In-App Purchases;Camera Comfort;Custom Volume Controls;Adjustable Difficulty;Playable without Timed Input;DualShock Controller Support;Stereo Sound;Steam Cloud;Remote Play on Phone;Remote Play on Tablet;Remote Play on TV;Family Sharing,9.99,USD, @@ -243,7 +243,7 @@ sheet,group,name,categories,price,currency,genres 1946560,sp,sobosuba,Single-player;Steam Achievements;Full controller support;DualShock Controller Support;DualShock Controller Support;DualSense Controller Support;DualSense Controller Support;Steam Leaderboards;Family Sharing,3.99,USD,Casual;Indie 2026820,sp,Die in the Dungeon,Single-player;Steam Achievements;Full controller support;DualShock Controller Support;DualShock Controller Support;Steam Cloud;Family Sharing,14.99,USD,Indie;RPG;Strategy 2085540,both,Stick It to the Stickman,Single-player;Multi-player;Co-op;Shared/Split Screen Co-op;Shared/Split Screen;Steam Achievements;Full controller support;Steam Workshop;Gamepad Recommended;DualSense Controller Support;Steam Cloud;Includes level editor;Remote Play Together;Family Sharing,11.99,USD,Action;Indie -2111550,both,Schrodinger's Cat Burglar,Single-player;Multi-player;Co-op;Shared/Split Screen Co-op;Shared/Split Screen;Steam Achievements;Full controller support;Adjustable Text Size;Camera Comfort;Color Alternatives;Custom Volume Controls;Adjustable Difficulty;Gamepad Recommended;Keyboard Only Option;Playable without Timed Input;DualShock Controller Support;DualSense Controller Support;Stereo Sound;Subtitle Options;Steam Cloud;Stats;Remote Play Together;Family Sharing,19.99,USD, +2111550,both,Schrodinger's Cat Burglar,Single-player;Multi-player;Co-op;Shared/Split Screen Co-op;Shared/Split Screen;Steam Achievements;Full controller support;Adjustable Text Size;Camera Comfort;Color Alternatives;Custom Volume Controls;Adjustable Difficulty;Gamepad Recommended;Keyboard Only Option;Playable without Timed Input;DualShock Controller Support;DualSense Controller Support;Stereo Sound;Subtitle Options;Steam Cloud;Stats;Remote Play Together;Family Sharing,19.99,USD,Adventure;Indie 2162800,sp,shapez 2 - Factory,Single-player;Steam Achievements;Steam Workshop;Adjustable Text Size;Camera Comfort;Color Alternatives;#category_contrast_controls;Custom Volume Controls;Adjustable Difficulty;#category_playable_at_your_own_pace;Playable without Timed Input;Save Anytime;Stereo Sound;Subtitle Options;Steam Cloud;Family Sharing,29.99,USD, 2209900,sp,Moonlight Peaks,Single-player;Steam Achievements;Full controller support;Steam Trading Cards;Gamepad Recommended;DualShock Controller Support;DualShock Controller Support;DualSense Controller Support;DualSense Controller Support;Steam Cloud;Family Sharing,34.99,USD, 2245620,sp,Tangy TD,Single-player;Steam Achievements;Steam Cloud;Steam Leaderboards;Family Sharing,9.99,USD, @@ -3640,3 +3640,99 @@ sheet,group,name,categories,price,currency,genres 2104240,sp,DREDGE - Blackstone Key,Single-player;Downloadable Content;Steam Achievements;Full controller support;Steam Cloud;Family Sharing,4.99,USD,Adventure;RPG 2104890,both,RoadCraft,Single-player;Multi-player;Co-op;Online Co-op;Cross-Platform Multiplayer;Steam Achievements;Full controller support;Steam Trading Cards;Camera Comfort;Custom Volume Controls;Playable without Timed Input;DualShock Controller Support;DualShock Controller Support;DualSense Controller Support;DualSense Controller Support;Save Anytime;Stereo Sound;Surround Sound;Steam Cloud;Family Sharing,39.99,USD,Adventure;Simulation 2105620,sp,Sektori,Single-player;Steam Achievements;Full controller support;Steam Trading Cards;Camera Comfort;Adjustable Difficulty;Gamepad Recommended;DualShock Controller Support;DualShock Controller Support;DualSense Controller Support;DualSense Controller Support;Stereo Sound;Steam Cloud;Steam Leaderboards;Family Sharing,14.99,USD,Action +2105910,both,Garbanzo Quest,Single-player;Multi-player;Co-op;Shared/Split Screen Co-op;Shared/Split Screen;Steam Achievements;Full controller support;Captions available;DualShock Controller Support;DualShock Controller Support;DualSense Controller Support;DualSense Controller Support;Steam Input API Support;Steam Cloud;Includes level editor;Remote Play Together;Family Sharing,19.99,USD,Action;Adventure;Indie +2106520,sp,私のリアルは充実しすぎている フルボイス版,Single-player;Remote Play on Phone;Remote Play on Tablet;Family Sharing,9.99,USD,Adventure;Casual;Indie +2106670,both,Gatekeeper,Single-player;Multi-player;Co-op;Online Co-op;Steam Achievements;Full controller support;Steam Trading Cards;DualShock Controller Support;DualSense Controller Support;Steam Cloud;Family Sharing,14.99,USD,Action;Adventure;Indie +2106810,sp,The Forest of Drizzling Rain,Single-player;Family Sharing,15.99,USD,Adventure;Indie;RPG +2106840,sp,PARANORMASIGHT: The Seven Mysteries of Honjo,Single-player;Steam Achievements;Camera Comfort;Color Alternatives;Custom Volume Controls;Keyboard Only Option;Mouse Only Option;Playable without Timed Input;Save Anytime;Partial Controller Support;Steam Cloud;Family Sharing,19.99,USD,Adventure;RPG;Simulation +2107090,both,KitHack Model Club,Single-player;Multi-player;PvP;Online PvP;Co-op;Online Co-op;Steam Workshop;Adjustable Text Size;Camera Comfort;Color Alternatives;Custom Volume Controls;Playable without Timed Input;DualShock Controller Support;DualShock Controller Support;Save Anytime;Stereo Sound;Surround Sound;Partial Controller Support;Steam Cloud;Includes level editor;Remote Play on TV;Family Sharing,19.99,USD,none +2107670,mp,Warhaven,Multi-player;PvP;Online PvP;In-App Purchases;Partial Controller Support;Family Sharing,NA,,Action;Early Access +2107680,unknown,Warhaven Playtest,Partial Controller Support,NA,,none +2108180,sp,Swordhaven: Iron Conspiracy,Single-player;Steam Achievements;Full controller support;Steam Trading Cards;Steam Workshop;Adjustable Text Size;Camera Comfort;Color Alternatives;Custom Volume Controls;Adjustable Difficulty;Keyboard Only Option;Mouse Only Option;Playable without Timed Input;DualShock Controller Support;DualShock Controller Support;DualSense Controller Support;DualSense Controller Support;Save Anytime;Steam Input API Support;Stereo Sound;Subtitle Options;Steam Cloud;Family Sharing,24.99,USD,Adventure;RPG +2108290,sp,The Impregnation of the Elves: Conquest of the Arrogant Fairies by Impregnation,Single-player;Steam Achievements;Steam Cloud;Family Sharing,10.99,USD,Adventure;Indie;RPG;Simulation;Strategy +2108330,both,F1® 23,Single-player;Multi-player;PvP;Online PvP;Shared/Split Screen PvP;Co-op;Online Co-op;Shared/Split Screen Co-op;Shared/Split Screen;Steam Achievements;Full controller support;VR Supported;Steam Workshop;Gamepad Recommended;DualShock Controller Support;DualSense Controller Support;Steam Cloud;Remote Play Together;HDR available;Family Sharing,NA,,Racing;Sports +2109270,sp,Preserve,Single-player;Steam Achievements;Full controller support;Steam Cloud;Family Sharing,12.49,USD,Casual;Indie +2109300,sp,Resident Evil 4 - Separate Ways,Single-player;Downloadable Content;Steam Achievements;Full controller support;Steam Cloud;Family Sharing,9.99,USD,Action;Adventure +2109370,both,The Great War: Western Front™,Single-player;Multi-player;PvP;Online PvP;Steam Achievements;Steam Trading Cards;Steam Workshop;Steam Cloud;Family Sharing,39.99,USD,Strategy +2109460,sp,VillageRhapsody,Single-player;Steam Achievements;Steam Cloud;Family Sharing,NA,,Casual;Indie;RPG;Simulation +2110110,sp,Motherless - Season 1,Single-player;Steam Achievements;Adjustable Text Size;Custom Volume Controls;Narrated Game Menus;#category_playable_at_your_own_pace;Playable without Timed Input;Save Anytime;Family Sharing,0,,Casual;Indie;Free To Play +2110820,sp,Granny Remake,Single-player;Steam Achievements;Captions available;Partial Controller Support;Family Sharing,6.99,USD,Action;Adventure;Indie +2111170,sp,STORY OF SEASONS: A Wonderful Life,Single-player;Steam Achievements;Steam Trading Cards;DualShock Controller Support;DualShock Controller Support;DualSense Controller Support;DualSense Controller Support;Partial Controller Support;Steam Cloud;Family Sharing,39.99,USD,Casual;RPG;Simulation +2111190,sp,MULLET MADJACK,Single-player;Steam Achievements;Full controller support;Steam Trading Cards;DualShock Controller Support;DualShock Controller Support;DualSense Controller Support;DualSense Controller Support;Steam Input API Support;Steam Cloud;Steam Leaderboards;Family Sharing,19.99,USD,Action;Indie +2111630,sp,JR EAST Train Simulator,Single-player;Full controller support;DualShock Controller Support;DualSense Controller Support;Steam Input API Support;Family Sharing,22.99,USD,Simulation +2111850,both,Gunfire Reborn - Visitors of Spirit Realm,Single-player;Multi-player;Co-op;Online Co-op;Downloadable Content;Steam Achievements;Steam Trading Cards;Partial Controller Support;Steam Cloud;Remote Play on Phone;Remote Play on Tablet;Family Sharing,6.99,USD,Action;Adventure;Indie;RPG +2111870,both,Section 13,Single-player;Multi-player;Co-op;Online Co-op;Full controller support;Steam Cloud;Family Sharing,19.99,USD,Action;Adventure;Indie +2112280,unknown,Men of War II Playtest,,NA,,none +2112520,sp,her tears were my light,Single-player;Steam Achievements;Full controller support;Family Sharing,2.99,USD,Simulation +2113040,sp,RUNGORE,Single-player;Steam Achievements;Full controller support;Steam Cloud;Steam Leaderboards;Family Sharing,14.99,USD,Indie;RPG;Strategy +2113050,sp,RUNGORE: Beginner Experience,Single-player;Steam Achievements;Family Sharing,0,,Adventure;Indie;Strategy +2113430,sp,Soulstone Survivors: Prologue,Single-player;Full controller support;DualShock Controller Support;DualShock Controller Support;DualSense Controller Support;DualSense Controller Support;Steam Cloud;Family Sharing,NA,,Action;Indie;RPG +2113540,sp,梦魇:无归 Nightmare without return,Single-player;Family Sharing,6.99,USD,Adventure;Indie;RPG +2113570,both,Ascend: Reborn,Single-player;Multi-player;PvP;Online PvP;Co-op;Online Co-op;Steam Achievements;Full controller support;In-App Purchases;Steam Leaderboards;Family Sharing,0,,Action;Indie;RPG;Free To Play +2113900,both,Touge Shakai,Single-player;Multi-player;PvP;Online PvP;Steam Achievements;Full controller support;Gamepad Recommended;DualShock Controller Support;DualShock Controller Support;Steam Cloud;Family Sharing,14.99,USD,Indie;Racing;Simulation;Sports;Early Access +2113920,sp,The Legend of Heroes: Kuro no Kiseki Ⅱ -CRIMSON SiN- ,Single-player;Steam Achievements;Gamepad Recommended;DualShock Controller Support;Partial Controller Support;Steam Cloud;Family Sharing,59.99,USD,RPG +2114740,sp,Blasphemous 2,Single-player;Steam Achievements;Full controller support;Gamepad Recommended;DualShock Controller Support;DualShock Controller Support;DualSense Controller Support;DualSense Controller Support;Steam Cloud;Family Sharing,29.99,USD,Action;Adventure;Indie +2114760,both,Crusader Kings III: Friends & Foes,Single-player;Multi-player;PvP;Online PvP;Downloadable Content;Steam Achievements;Steam Trading Cards;Steam Workshop;Steam Cloud;Remote Play on Tablet;Family Sharing,4.99,USD,RPG;Simulation;Strategy +2115390,both,Project Unknown,Single-player;Multi-player;Co-op;Online Co-op;Family Sharing,9.99,USD,Action;Adventure;Indie +2116060,sp,Epic Auto Towers,Single-player;Steam Achievements;Full controller support;DualShock Controller Support;Steam Cloud;Family Sharing,14.99,USD,Casual;Indie;Strategy;Early Access +2118120,both,Kind Words 2 (lofi city pop),Single-player;Multi-player;MMO;PvP;Online PvP;Co-op;Online Co-op;Full controller support;DualShock Controller Support;DualShock Controller Support;DualSense Controller Support;DualSense Controller Support;Steam Cloud;Family Sharing,19.99,USD,Casual;Indie;Massively Multiplayer +2118420,sp,Stories from Sol: The Gun-Dog,Single-player;Steam Achievements;Steam Trading Cards;Partial Controller Support;Steam Cloud;Family Sharing,14.99,USD,Adventure;Indie;RPG +2118810,sp,Breachway,Single-player;Steam Achievements;Full controller support;Steam Trading Cards;DualShock Controller Support;Steam Cloud;Family Sharing,19.99,USD,RPG;Simulation;Strategy;Early Access +2119270,sp,Black Reliquary,Single-player;Full controller support;Steam Cloud;Family Sharing,0,,Indie;RPG;Strategy +2119490,mp,TRAHA Global,Multi-player;MMO;PvP;Online PvP;Co-op;Online Co-op;Cross-Platform Multiplayer;In-App Purchases;Family Sharing,NA,,Action;Massively Multiplayer;RPG;Strategy;Free To Play +2119590,both,Deducto 2,Single-player;Multi-player;PvP;Online PvP;Co-op;Online Co-op;Steam Achievements;DualShock Controller Support;DualShock Controller Support;DualSense Controller Support;DualSense Controller Support;Partial Controller Support;Steam Leaderboards;Family Sharing,4.99,USD,Casual;Indie;Simulation;Strategy +2119740,mp,United heist,Multi-player;Co-op;Online Co-op;Steam Achievements;Family Sharing,0,,Adventure;Indie;Free To Play +2119830,both,MISERY,Single-player;Multi-player;Co-op;Online Co-op;LAN Co-op;Steam Achievements;Custom Volume Controls;Keyboard Only Option;Mouse Only Option;Playable without Timed Input;DualShock Controller Support;DualShock Controller Support;DualSense Controller Support;DualSense Controller Support;Save Anytime;Stereo Sound;Surround Sound;Partial Controller Support;Steam Cloud;Family Sharing,19.99,USD,Action;Adventure;Indie;Massively Multiplayer;Simulation +2120900,sp,Fears to Fathom - Carson House,Single-player;Steam Achievements;Family Sharing,4.99,USD,Adventure;Casual;Indie +2121150,mp,Chess for idiots,Multi-player;PvP;Online PvP;Shared/Split Screen PvP;Shared/Split Screen;Steam Achievements;Captions available;Stats;Remote Play Together;Family Sharing,0,,Casual;Indie;Strategy;Early Access +2121360,sp,东北之夏,Single-player;Steam Achievements;Steam Cloud;Family Sharing,0,,Free To Play;RPG +2121510,sp,Tenebris Somnia,Single-player;Steam Achievements;Full controller support;Steam Trading Cards;Steam Cloud;Family Sharing,24.99,USD,Adventure;Indie +2121980,sp,Void Stranger,Single-player;Full controller support;Steam Cloud;Family Sharing,11.99,USD,Adventure;Indie +2123640,sp,Hollowbody,Single-player;Steam Achievements;Full controller support;Gamepad Recommended;DualShock Controller Support;DualShock Controller Support;DualSense Controller Support;DualSense Controller Support;Steam Cloud;Family Sharing,16.99,USD,Adventure;Indie +2124100,sp,Transience,Single-player;Steam Achievements;Full controller support;Adjustable Text Size;Camera Comfort;Custom Volume Controls;Adjustable Difficulty;Playable without Timed Input;Stereo Sound;Subtitle Options;Surround Sound;Steam Cloud;Family Sharing,19.99,USD,Action;Indie +2124120,sp,SULFUR,Single-player;Steam Achievements;Full controller support;DualShock Controller Support;Steam Input API Support;Steam Cloud;Family Sharing,29.99,USD,Action;Adventure;Indie;RPG;Simulation +2124380,sp,Super Lesbian Animal RPG,Single-player;Partial Controller Support;Steam Cloud;Family Sharing,14.99,USD,Indie;RPG +2124420,sp,Fate Seeker: Journey,Single-player;Steam Achievements;Full controller support;DualShock Controller Support;DualShock Controller Support;DualSense Controller Support;DualSense Controller Support;Steam Cloud;Family Sharing,10.0,USD,Action;RPG +2124490,sp,SILENT HILL 2,Single-player;Steam Achievements;Full controller support;Gamepad Recommended;DualShock Controller Support;DualSense Controller Support;DualSense Controller Support;Steam Cloud;Family Sharing,69.99,USD,Action;Adventure +2124750,both,Stormworks: Industrial Frontier,Single-player;Multi-player;PvP;Online PvP;Co-op;Online Co-op;Downloadable Content;Steam Workshop;Partial Controller Support;Family Sharing,9.99,USD,Simulation +2124780,sp,Endoparasitic,Single-player;Steam Achievements;Steam Workshop;Steam Cloud;Family Sharing,9.99,USD,Indie +2124930,both,Gum Ball Run,Single-player;Multi-player;PvP;Online PvP;Steam Achievements;Partial Controller Support;Steam Leaderboards;Family Sharing,0,,Action;Racing;Free To Play +2125540,sp,Kādomon: Hyper Auto Battlers,Single-player;Full controller support;DualShock Controller Support;DualSense Controller Support;Family Sharing,9.99,USD,Casual;Indie;Simulation;Strategy +2125770,sp,Beeny,Single-player;Partial Controller Support;Family Sharing,0.99,USD,Action +2126190,sp,Rue Valley,Single-player;Steam Achievements;Steam Trading Cards;Captions available;DualShock Controller Support;Partial Controller Support;Steam Cloud;Family Sharing,14.99,USD,Adventure;Casual;Indie +2126550,unknown,The Outlast Trials Playtest,,NA,,none +2126680,sp,Lust Academy - Season 2,Single-player;Steam Achievements;Color Alternatives;Custom Volume Controls;Keyboard Only Option;Mouse Only Option;Playable without Timed Input;Save Anytime;Subtitle Options;Touch Only Option;Steam Cloud;Family Sharing,14.99,USD,Adventure;Casual;Indie +2127010,sp,Handyman Legend,Single-player;Steam Achievements;Steam Cloud;Family Sharing,6.99,USD,Casual;Indie;RPG;Simulation +2128270,sp,Path of Achra,Single-player;Steam Achievements;Steam Cloud;Family Sharing,9.99,USD,RPG +2128480,sp,Staffer Case: A Supernatural Mystery Adventure,Single-player;Steam Achievements;Full controller support;Steam Trading Cards;Steam Cloud;Family Sharing,16.99,USD,Adventure +2128940,mp,THE 4 SINS,Multi-player;Co-op;Online Co-op;Steam Achievements;Steam Workshop;Family Sharing,9.99,USD,Adventure;Indie;RPG;Strategy +2129810,sp,Reignbreaker,Single-player;Steam Achievements;Full controller support;Steam Trading Cards;Gamepad Recommended;DualShock Controller Support;DualShock Controller Support;DualSense Controller Support;DualSense Controller Support;Steam Cloud;Family Sharing,9.99,USD,Action;Adventure;Indie;RPG +2130460,sp,FATAL FRAME / PROJECT ZERO: Mask of the Lunar Eclipse,Single-player;Steam Achievements;Partial Controller Support;Steam Cloud;Family Sharing,49.99,USD,Adventure +2130540,sp,目盲/Blind,Single-player;Steam Achievements;Family Sharing,2.99,USD,Adventure;Casual;RPG;Simulation +2131200,sp,NeverSynth,Single-player;Steam Workshop;Steam Cloud;Family Sharing,11.99,USD,Action;Indie;Racing;Sports +2131350,both,My Coworker is an Idiot,Single-player;Multi-player;Co-op;Online Co-op;Shared/Split Screen Co-op;Shared/Split Screen;Steam Achievements;Remote Play Together;Family Sharing,1.99,USD,Action;Casual;Indie;Simulation +2131630,sp,METAL GEAR SOLID - Master Collection Version,Single-player;Steam Achievements;Full controller support;Gamepad Recommended;DualShock Controller Support;DualSense Controller Support;Family Sharing,19.99,USD,Action +2131640,sp,METAL GEAR SOLID 2: Sons of Liberty - Master Collection Version,Single-player;Steam Achievements;Full controller support;Gamepad Recommended;DualShock Controller Support;Family Sharing,19.99,USD,Action +2131650,sp,METAL GEAR SOLID 3: Snake Eater - Master Collection Version,Single-player;Steam Achievements;Full controller support;Gamepad Recommended;DualShock Controller Support;Family Sharing,19.99,USD,Action +2131680,sp,METAL GEAR & METAL GEAR 2: Solid Snake,Single-player;Steam Achievements;Full controller support;Gamepad Recommended;DualShock Controller Support;Family Sharing,19.99,USD,Action +2132690,sp,Vivat Slovakia,Single-player;Steam Achievements;Full controller support;DualShock Controller Support;DualShock Controller Support;DualSense Controller Support;DualSense Controller Support;Steam Cloud;Family Sharing,19.99,USD,Action;Adventure +2132850,both,Rabbit and Steel,Single-player;Multi-player;Co-op;Online Co-op;Shared/Split Screen Co-op;Shared/Split Screen;Steam Achievements;Full controller support;DualShock Controller Support;DualShock Controller Support;DualSense Controller Support;DualSense Controller Support;Steam Cloud;Remote Play Together;Family Sharing,14.99,USD,Action;Adventure;Indie;RPG +2132890,sp,Possessor(s),Single-player;Steam Achievements;Full controller support;Gamepad Recommended;DualShock Controller Support;DualSense Controller Support;Steam Cloud;Family Sharing,9.99,USD,Action;Adventure +2133670,sp,Perseus: Titan Slayer - Free Trial,Single-player;Steam Achievements;Partial Controller Support;Family Sharing,NA,,Action;Adventure;Indie;RPG +2133760,sp,Tiny Bookshop,Single-player;Steam Achievements;Full controller support;Color Alternatives;Custom Volume Controls;Mouse Only Option;Playable without Timed Input;DualShock Controller Support;DualShock Controller Support;DualSense Controller Support;DualSense Controller Support;Stereo Sound;Touch Only Option;Steam Cloud;Family Sharing,19.99,USD,Casual;Indie;RPG;Simulation +2134320,sp,ENA: Dream BBQ,Single-player;Steam Achievements;Full controller support;Adjustable Text Size;Camera Comfort;Custom Volume Controls;Playable without Timed Input;DualSense Controller Support;Stereo Sound;Steam Cloud;Family Sharing,0,,Adventure;Indie +2134770,sp,SteamWorld Build,Single-player;Steam Achievements;Full controller support;DualShock Controller Support;DualShock Controller Support;DualSense Controller Support;DualSense Controller Support;Steam Cloud;Family Sharing,24.99,USD,Simulation;Strategy +2135150,sp,Elin,Single-player;Steam Achievements;Steam Workshop;Steam Cloud;Family Sharing,19.99,USD,Indie;RPG;Simulation;Strategy;Early Access +2135690,sp,Ticy Adventure Club,Single-player;Family Sharing,0,,Adventure;Indie;RPG;Free To Play +2137700,sp,I'm on Observation Duty 6,Single-player;Steam Achievements;Full controller support;DualShock Controller Support;DualShock Controller Support;DualSense Controller Support;DualSense Controller Support;Family Sharing,11.99,USD,Indie +2137760,sp,Crafty Survivors,Single-player;Steam Achievements;Full controller support;Steam Cloud;Family Sharing,11.99,USD,Action +2138330,sp,Cyberpunk 2077: Phantom Liberty,Single-player;Downloadable Content;Steam Achievements;Full controller support;Steam Trading Cards;Adjustable Text Size;Camera Comfort;Color Alternatives;Custom Volume Controls;Adjustable Difficulty;DualShock Controller Support;DualSense Controller Support;DualSense Controller Support;Save Anytime;Stereo Sound;Subtitle Options;Surround Sound;Steam Cloud;HDR available;Family Sharing,29.99,USD,RPG +2138350,unknown,,,NA,,none +2138450,sp,The Agnietta ~The holy healer & the cursed dungeon~,Single-player;Steam Cloud;Family Sharing,9.99,USD,Action;Adventure;RPG +2138580,sp,Exotica: Petshop Simulator,Single-player;Steam Cloud;Family Sharing,7.99,USD,Casual;Indie;Simulation +2138610,sp,The Legend of Heroes: Trails through Daybreak,Single-player;Steam Achievements;Full controller support;Steam Trading Cards;Adjustable Text Size;Custom Volume Controls;Adjustable Difficulty;DualShock Controller Support;DualShock Controller Support;DualSense Controller Support;DualSense Controller Support;Save Anytime;Stereo Sound;Steam Cloud;HDR available;Family Sharing;Steam Timeline,59.99,USD,Action;Adventure;RPG +2138700,sp,Crypt,Single-player;Steam Achievements;Family Sharing,0,,Adventure;Free To Play;Indie +2138710,sp,Sifu,Single-player;Steam Achievements;Full controller support;DualShock Controller Support;DualShock Controller Support;DualSense Controller Support;DualSense Controller Support;Steam Cloud;Family Sharing,39.99,USD,Action;Indie +2138720,mp,REMATCH,Multi-player;Co-op;Online Co-op;Cross-Platform Multiplayer;Steam Achievements;Full controller support;In-App Purchases;Gamepad Recommended;DualShock Controller Support;DualShock Controller Support;DualSense Controller Support;DualSense Controller Support;Family Sharing,39.99,USD,Action;Indie;Sports +2139020,both,What the Fog,Single-player;Multi-player;Co-op;Online Co-op;Steam Achievements;Full controller support;Family Sharing,4.99,USD,Action +2139300,sp,Redemption Reapers,Single-player;Steam Achievements;Full controller support;Steam Cloud;Family Sharing,24.99,USD,Simulation diff --git a/itad.py b/itad.py deleted file mode 100644 index b202be8..0000000 --- a/itad.py +++ /dev/null @@ -1,123 +0,0 @@ -#!/usr/bin/env python3 -""" -Look up Steam prices via the IsThereAnyDeal (ITAD) API using Steam app IDs. - -Usage: - export ITAD_API_KEY=your_key_here - python3 itad.py 3330 - python3 itad.py 730 1245620 -c DK - python3 itad.py 730 --json - -API key: https://isthereanydeal.com/apps/my/ -""" -import argparse -import json -import os -import sys - -import requests - -BASE = "https://api.isthereanydeal.com" -STEAM_SHOP_ID = 61 # Steam's shop ID on ITAD - -session = requests.Session() -session.headers.update({ - "User-Agent": "itad-price-script/1.0 (+python-requests)", - "Accept": "application/json", -}) - - -def api(method: str, path: str, key: str, params: dict | None = None, body=None): - """Call the ITAD API; on failure print the status and response body, then exit.""" - params = {"key": key, **(params or {})} - try: - r = session.request(method, f"{BASE}{path}", params=params, json=body, timeout=20) - except requests.RequestException as e: - sys.exit(f"Network error: {e}") - - if not r.ok: - text = r.text.strip().replace(key, "") - sys.exit( - f"HTTP {r.status_code} from {path}\n{text[:500]}\n" - "Hints: 403 = bad/inactive API key or blocked request; " - "401 = key missing; 429 = rate limited." - ) - return r.json() - - -def lookup_game(key: str, appid: int) -> dict | None: - """Steam app ID -> ITAD game record.""" - data = api("GET", "/games/lookup/v1", key, {"appid": appid}) - return data["game"] if data.get("found") else None - - -def get_steam_prices(key: str, itad_ids: list[str], country: str) -> dict: - """ITAD game IDs -> {id: current Steam deal or None}.""" - data = api( - "POST", "/games/prices/v3", key, - {"country": country, "shops": STEAM_SHOP_ID}, - body=itad_ids, - ) - return {e["id"]: (e.get("deals") or [None])[0] for e in data} - - -def main() -> int: - p = argparse.ArgumentParser(description="Steam price lookup via IsThereAnyDeal") - p.add_argument("appids", nargs="+", type=int, help="Steam app ID(s)") - p.add_argument("-c", "--country", default="US", help="2-letter country code (default: US)") - p.add_argument("-k", "--key", default=os.environ.get("ITAD_API_KEY"), - help="ITAD API key (or set ITAD_API_KEY)") - p.add_argument("--json", action="store_true", help="Output JSON") - args = p.parse_args() - - if not args.key: - print("Missing API key. Set ITAD_API_KEY or pass --key.", file=sys.stderr) - return 1 - - games = {} - for appid in args.appids: - game = lookup_game(args.key, appid) - if game: - games[appid] = game - else: - print(f"[{appid}] not found on ITAD", file=sys.stderr) - if not games: - return 1 - - prices = get_steam_prices(args.key, [g["id"] for g in games.values()], args.country) - - results = [] - for appid, game in games.items(): - deal = prices.get(game["id"]) - if not deal: - results.append({"appid": appid, "title": game["title"], "available": False}) - continue - results.append({ - "appid": appid, - "title": game["title"], - "available": True, - "price": deal["price"]["amount"], - "list_price": deal["regular"]["amount"], - "discount_percent": deal["cut"], - "currency": deal["price"]["currency"], - "url": deal.get("url"), - }) - - if args.json: - print(json.dumps(results, indent=2)) - return 0 - - for r in results: - print(f"{r['title']} (app {r['appid']})") - if not r["available"]: - print(" No Steam price available for this region\n") - continue - cur = r["currency"] - print(f" Price: {r['price']:.2f} {cur}") - print(f" List price: {r['list_price']:.2f} {cur}") - print(f" Discount: {r['discount_percent']}%\n") - return 0 - - -if __name__ == "__main__": - sys.exit(main()) \ No newline at end of file diff --git a/matched_study.py b/matched_study.py deleted file mode 100644 index d4052bf..0000000 --- a/matched_study.py +++ /dev/null @@ -1,133 +0,0 @@ -""" -Download classification, price and genres for every game in data/. - -- Game ids come from the file names in data/ (e.g. data/730.csv -> app id 730). -- A row is complete when it has price AND genres. Incomplete or missing rows are (re)fetched, - so the script can be stopped and re-run, and old files without a genres column are upgraded. -- Writes game_tags.csv: sheet, group, name, categories, price, currency, genres - group = sp / mp / both / unknown (from Steam store "categories") - price = base price before discount, 0 if free, "NA" if no price listed - genres = Steam store genres joined by ";" ("none" if the store lists none) - -Install: pip install requests -""" -import csv -import glob -import os -import time - -import requests - -DATA_GLOB = "data/*.csv" -OUT = "game_tags.csv" -API = "https://store.steampowered.com/api/appdetails" -CC = "us" -DELAY = 1.6 -SAVE_EVERY = 10 -FIELDS = ["sheet", "group", "name", "categories", "price", "currency", "genres"] - -MP_CATS = {"multi-player", "co-op", "online co-op", "pvp", "online pvp", "mmo", - "cross-platform multiplayer"} -SP_CATS = {"single-player"} - - -def ids_from_files(): - ids = [] - for path in sorted(glob.glob(DATA_GLOB)): - stem = os.path.splitext(os.path.basename(path))[0] - if stem.isdigit(): - ids.append(stem) - else: - print(f"skipping {path}: file name is not a numeric app id") - return ids - - -def load_rows(): - """Existing rows keyed by sheet; columns missing in an old file load as blanks.""" - if not os.path.exists(OUT): - return {} - with open(OUT, newline="", encoding="utf-8") as f: - return {row["sheet"]: {k: row.get(k) or "" for k in FIELDS} for row in csv.DictReader(f)} - - -def save_rows(rows): - tmp = OUT + ".tmp" - with open(tmp, "w", newline="", encoding="utf-8") as f: - writer = csv.DictWriter(f, fieldnames=FIELDS) - writer.writeheader() - writer.writerows(rows.values()) - os.replace(tmp, OUT) - - -def fetch(appid): - """Store data dict, {} if Steam has no store entry, None on a temporary failure.""" - for attempt in range(5): - try: - r = requests.get(API, params={"appids": appid, "l": "english", "cc": CC}, timeout=20) - if r.status_code == 429: - time.sleep(60 * (attempt + 1)) - continue - r.raise_for_status() - entry = r.json()[appid] - return entry["data"] if entry.get("success") else {} - except (requests.RequestException, ValueError, KeyError, TypeError): - time.sleep(5 * (attempt + 1)) - return None - - -def classify(categories): - cats = {c.lower() for c in categories} - mp, sp = bool(cats & MP_CATS), bool(cats & SP_CATS) - if mp and sp: - return "both" - if mp: - return "mp" - if sp: - return "sp" - return "unknown" - - -def get_price(data): - if data.get("is_free"): - return 0, "" - po = data.get("price_overview") - if po: - return round(po["initial"] / 100, 2), po.get("currency", "") - return "NA", "" - - -def needs_fetch(rows, appid): - r = rows.get(appid) - return r is None or r["price"] == "" or r["genres"] == "" - - -def main(): - ids = ids_from_files() - rows = load_rows() - todo = [i for i in ids if needs_fetch(rows, i)] - print(f"{len(ids)} games in data/, {len(ids) - len(todo)} complete, {len(todo)} to fetch " - f"(about {len(todo) * DELAY / 60:.0f} min)") - - try: - for n, appid in enumerate(todo, 1): - data = fetch(appid) - if data is None: - print(f"[{n}/{len(todo)}] {appid}: request failed, will retry on next run") - continue - cats = [c["description"] for c in data.get("categories", [])] - genres = [g["description"] for g in data.get("genres", [])] - price, currency = get_price(data) - rows[appid] = {"sheet": appid, "group": classify(cats), "name": data.get("name", ""), - "categories": ";".join(cats), "price": price, "currency": currency, - "genres": ";".join(genres) or "none"} - print(f"[{n}/{len(todo)}] {appid} {data.get('name', '?')}: {rows[appid]['group']}, " - f"{price} {currency}, {rows[appid]['genres']}") - if n % SAVE_EVERY == 0: - save_rows(rows) - time.sleep(DELAY) - finally: - save_rows(rows) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/openapi.json b/openapi.json deleted file mode 100644 index de59431..0000000 --- a/openapi.json +++ /dev/null @@ -1,8832 +0,0 @@ -{ - "openapi": "3.1.0", - "info": { - "title": "IsThereAnyDeal API", - "description": "[Changelog](https://github.com/IsThereAnyDeal/API/blob/master/CHANGELOG.md)\n\nIsThereAnyDeal API provides programmatic access to features found at IsThereAnyDeal. \n\n## Terms of Service\n\nAPI is provided in good faith. We trust you won't misuse the API to damage IsThereAnyDeal, its users or its reputation.\n\n- You MAY use this API for commercial purposes **IF** the resulting app is available to public.\n Private **personal** use is allowed. Private use beyond personal requires approval, contact us.\n- You SHOULD provide a link to IsThereAnyDeal.com or mention IsThereAnyDeal API.\n- You MUST NOT make an impression that you are affiliated with IsThereAnyDeal, unless agreed otherwise.\n If you are interested in making an official app, please contact us.\n- You MUST NOT change provided data in any way. This means that you can't remove affiliate tags from the URLs, change prices and so on.\n You MAY use only part of data provided and enrich them from your own sources. \n- You MUST NOT make an app that could be considered a competition to IsThereAnyDeal or IsThereAnyDeal projects.\n- You MUST NOT use this API to directly or indirectly help the competition of IsThereAnyDeal.\n\nAll data are provided _as-is_. We reserve the right to deny you access to the API at any point without notice.\nIf you are not sure about any of the points, please contact us.\n\n## Access\n\nMost of the endpoints will be restricted by either API key or OAuth.\nIn order to get neccessary keys, you have to [register your app](https://isthereanydeal.com/apps/my/).\nUpon registration, api keys and OAuth credentials will be generated for you.\n\n> For endpoints protected with api key, you can either add key as the query parameter `key`, or as `ITAD-API-Key` header˙.\n> Refer to endpoint's Authorizations section.\n\nFor some endpoints you might need explicit approval for use. In such cases, contact us.\n\n### OAuth\n\nWe support [authorization code](https://www.oauth.com/oauth2-servers/access-tokens/authorization-code-request/) flow with [PKCE extension](https://oauth.net/2/pkce/).\n\n> You can find PKCE step-through tutorial at [OAuth 2.0 PKCE Flow](https://www.oauth.com/playground/authorization-code-with-pkce.html)\n\nDo not set hard limits for token lengths. Server will return access token as JWT of variable length.\nTo authorize your endpoint access use Authorization header.\n\n> At the moment implicit flow is also enabled, but its usage is discouraged and support may be removed in the future\n\n## Rate Limiting\n\nAccess to API is rate limited. We implement a window-based throttling. By default, if your account has verified email,\nyou can make 1000 requests in a 5 minute window. You will see your current limits and usage in the app setup page.\n\n> We are about to lower the limits for accounts without verified email, but for a transitional period the limits\n> are kept the same.\n> Even though for now the limits are the same, you will still get\n> a warning in the app setup that you can increase your limits by verifying your email.\n\nThe limits are meant to give you some leeway and allow you to handle short bursts of higher activity.\nYou should not be constantly maxing out your usage, implement proper caching.\n\nIf you get rate-limited, you will get a `429 Too Many Requests` response with a `Retry-After` header.\n\nIf you need higher limits, reach out to us with your use case.\n\nLimits may change in the future. Attempts to work around the limits will cause ban.\nFurther limits and restrictions may be added if we detect misuse.\n\n# Unstable and Internal Endpoints\n\nSome endpoints are marked as unstable or internal. Unstable endpoints are publicly available,\nbut the API may not be completely finalized yet - either the way the endpoint is called or the response may change\nat any time.\n\nInternal APIs are available only for our own services. They are documented here for the sake of completeness.\n\n# Unofficial SDKs\n- [isthereanydeal-nodejs](https://www.npmjs.com/package/isthereanydeal-nodejs) \\\n An unofficial Node.js library for the IsThereAnyDeal API written in TypeScript.\n\n# Source\n\nYou can find source files for this documentation over at [GitHub](https://github.com/IsThereAnyDeal/API).\nFeel free to help us improve it.\n", - "termsOfService": "https://github.com/IsThereAnyDeal/API/blob/master/TERMS_OF_SERVICE.md", - "version": "2.11.0", - "contact": { - "name": "General API contact", - "email": "api@isthereanydeal.com" - } - }, - "servers": [ - { - "url": "https://api.isthereanydeal.com" - } - ], - "tags": [ - { - "name": "Lookup", - "description": "Endpoints for looking up things on IsThereAnyDeal.\n\nEndpoints in `/lookup/` namespace will follow this URL structure: `/lookup/{lookup-what}/{by-what}/`\n\nEndpoints from other namespaces that are related to lookup in any way may also be\nincluded in this category. \n" - }, - { - "name": "Game" - }, - { - "name": "Prices" - }, - { - "name": "History" - }, - { - "name": "Bundles" - }, - { - "name": "Giveaways" - }, - { - "name": "Deals List" - }, - { - "name": "Subscriptions" - }, - { - "name": "Waitlist Games", - "x-displayName": "Games" - }, - { - "name": "Waitlist Stats", - "x-displayName": "Stats" - }, - { - "name": "Waitlist Notifications", - "x-displayName": "Notifications" - }, - { - "name": "Collection Games", - "x-displayName": "Games", - "description": "Basic Collection operations when you only need to track games, without additional details.\n" - }, - { - "name": "Collection Copies", - "x-displayName": "Copies", - "description": "Operations on Collection copies. These allow more detailed tracking of owned games.\n" - }, - { - "name": "Collection Groups", - "x-displayName": "Categories", - "description": "Collection category endpoints. Category and group may be used interchangably. Default category has ID 0.\n" - }, - { - "name": "Collection Stats", - "x-displayName": "Stats" - }, - { - "name": "Ignored Games", - "x-displayName": "Games" - }, - { - "name": "User" - }, - { - "name": "User Notes", - "x-displayName": "Notes", - "description": "Endpoints for managing notes, that user can create for individual games." - }, - { - "name": "Profiles", - "description": "You can create a link between your app's users' accounts and ITAD, and use that link to sync\ngames into Waitlist and Collection in the similar fashion as natively supported profiles on IsThereAnyDeal.\n" - }, - { - "name": "Sync", - "description": "Sync endpoints provide easier way to add or remove games from Waitlist and Collection.\n\nSync via API works in the same way as natively supported sync of remote profiles, but instead of ITAD pulling data,\nyou will have to push data. Behavior of sync'd games is the same as for natively supported profiles.\n\nIt is useful when you can create a list of all games for user, and don't want to handle game identification,\ndeduplication, additions and removals via regular API endpoints.\n" - }, - { - "name": "Notifications" - }, - { - "name": "Shops" - }, - { - "name": "Stats" - }, - { - "name": "Unstable", - "description": "Endpoints that are not yet stable. They may be in development, experimental,\nor we are not sure about their current definition.\n" - }, - { - "name": "Internal", - "description": "Endpoints available for our own services. They are documented here for the sake of completeness.\n" - }, - { - "name": "Webhooks", - "description": "Webhooks provide a simpler wait to get data from IsThereAnyDeal, if you don't required full API access.\n\nUser can [register a webhook in their settings](https://isthereanydeal.com/settings/webhooks/)\nand choose which events they wish to listen to. Once the event is triggered on IsThereAnyDeal,\na request will be sent to registered webhook.\n\nEach request will include `ITAD-Hook-ID` header with a unique ID of a registered webhook\nand `ITAD-Event-ID` headers which identify the event.\n" - } - ], - "x-tagGroups": [ - { - "name": "Webhooks", - "tags": [ - "Webhooks" - ] - }, - { - "name": "Lookup", - "tags": [ - "Lookup" - ] - }, - { - "name": "Games", - "tags": [ - "Game", - "Prices", - "History", - "Bundles", - "Giveaways", - "Deals List", - "Subscriptions" - ] - }, - { - "name": "Waitlist", - "tags": [ - "Waitlist Games", - "Waitlist Stats", - "Waitlist Notifications" - ] - }, - { - "name": "Collection", - "tags": [ - "Collection Games", - "Collection Copies", - "Collection Groups", - "Collection Stats" - ] - }, - { - "name": "Ignore List", - "tags": [ - "Ignored Games" - ] - }, - { - "name": "Stats", - "tags": [ - "Stats" - ] - }, - { - "name": "User", - "tags": [ - "User", - "User Notes", - "Profiles", - "Sync" - ] - }, - { - "name": "Notifications", - "tags": [ - "Notifications" - ] - }, - { - "name": "Shops", - "tags": [ - "Shops" - ] - }, - { - "name": "Unstable", - "tags": [ - "Unstable" - ] - }, - { - "name": "Internal", - "tags": [ - "Internal" - ] - } - ], - "components": { - "securitySchemes": { - "ApiKeyParamAuth": { - "type": "apiKey", - "in": "query", - "name": "key" - }, - "ApiKeyHeaderAuth": { - "type": "apiKey", - "in": "header", - "name": "ITAD-API-Key" - }, - "OAuth2": { - "type": "oauth2", - "flows": { - "authorizationCode": { - "authorizationUrl": "https://isthereanydeal.com/oauth/authorize/", - "tokenUrl": "https://isthereanydeal.com/oauth/token/", - "refreshUrl": "https://isthereanydeal.com/oauth/token/", - "scopes": { - "user_info": "Get basic user's info", - "notes_read": "Read user's game notes", - "notes_write": "Write (add, edit, delete) user's game notes", - "profiles": "Link or unlink profiles", - "wait_read": "Read user's Waitlist", - "wait_write": "Write (add, edit, delete) in user's Waitlist", - "coll_read": "Read user's Collection", - "coll_write": "Write (add, edit, delete) in user's Collection", - "ignored_read": "Read user's Ignore list", - "ignored_write": "Write (add, delete) in user's Ignore list", - "webhooks": "Add or remove webhooks on user's behalf" - } - } - } - } - }, - "parameters": { - "country": { - "name": "country", - "in": "query", - "description": "Two letter country code (ISO 3166-1 alpha-2)", - "schema": { - "type": "string", - "minLength": 2, - "maxLength": 2, - "default": "US" - } - }, - "gid": { - "name": "id", - "in": "query", - "required": true, - "description": "Game ID", - "schema": { - "type": "string", - "format": "uuid" - } - }, - "shops": { - "name": "shops", - "in": "query", - "description": "List of shop IDs", - "explode": false, - "style": "form", - "schema": { - "type": "array", - "items": { - "type": "integer" - }, - "example": [ - 65, - 35 - ] - } - }, - "headers.user-agent": { - "in": "header", - "name": "User-Agent", - "required": true, - "schema": { - "type": "string", - "const": "ITAD-Webhooks/1.0 (+https://isthereanydeal.com)" - } - }, - "headers.content-type": { - "in": "header", - "name": "Content-Type", - "required": true, - "schema": { - "type": "string", - "const": "application/json" - } - }, - "headers.hook-id": { - "in": "header", - "name": "ITAD-Hook-ID", - "description": "ID of the Webhook", - "required": true, - "schema": { - "type": "string", - "format": "uuid" - } - }, - "headers.event": { - "in": "header", - "name": "ITAD-Event", - "description": "Event that generated the request", - "required": true, - "schema": { - "type": "string" - } - } - }, - "requestBodies": { - "gids": { - "description": "List of Game IDs", - "content": { - "application/json": { - "schema": { - "type": "array", - "minItems": 1, - "items": { - "type": "string", - "format": "uuid" - } - }, - "example": [ - "01849783-6a26-7147-ab32-71804ca47e8e", - "01849782-1017-7389-8de4-c97c587fd7e3" - ] - } - } - }, - "gids-200": { - "description": "List of Game IDs", - "content": { - "application/json": { - "schema": { - "type": "array", - "minItems": 1, - "maxItems": 200, - "items": { - "type": "string", - "format": "uuid" - } - }, - "example": [ - "01849783-6a26-7147-ab32-71804ca47e8e", - "01849782-1017-7389-8de4-c97c587fd7e3" - ] - } - } - } - }, - "responses": { - "error-response": { - "description": "Error response", - "content": { - "application/json": { - "schema": { - "title": "Error Response", - "type": "object", - "required": [ - "status_code", - "reason_phrase" - ], - "properties": { - "status_code": { - "description": "HTTP status code", - "type": "number" - }, - "reason_phrase": { - "description": "Error description", - "type": "string" - } - } - } - } - } - }, - "resp.error.array-of-objects-validation": { - "description": "Array Validation Error Response", - "content": { - "application/json": { - "schema": { - "title": "Array Validation Error Response", - "type": "object", - "required": [ - "status_code", - "reason_phrase" - ], - "properties": { - "status_code": { - "description": "HTTP status code", - "type": "number" - }, - "reason_phrase": { - "description": "Error description", - "type": "string" - }, - "details": { - "description": "When this endpoint fails during data validation, validation errors will be listed\nas array of two items.\n\nFirst item is the index of object in request data.\n\nSecond item is map of errors, with key being the property that failed to validate and value is the error itself.\n", - "type": "array", - "prefixItems": [ - { - "type": "number", - "description": "Index of object" - }, - { - "type": "object", - "description": "Validation errors", - "additionalProperties": { - "type": "string" - } - } - ] - } - } - }, - "example": { - "status_code": 400, - "reason_phrase": "Bad Request", - "details": [ - 0, - { - "propety": "Missing data for 'property'" - } - ] - } - } - } - }, - "resp.error.object-validation": { - "description": "Data Validation Error Response", - "content": { - "application/json": { - "schema": { - "title": "Data Validation Error Response", - "type": "object", - "required": [ - "status_code", - "reason_phrase" - ], - "properties": { - "status_code": { - "description": "HTTP status code", - "type": "number" - }, - "reason_phrase": { - "description": "Error description", - "type": "string" - }, - "details": { - "description": "When this endpoint fails during data validation, validation errors will be provided as a map,\nwhere key is the property that failed to validate and value is the error itself.\n", - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - }, - "example": { - "status_code": 400, - "reason_phrase": "Bad Request", - "details": { - "propety": "Missing data for 'property'" - } - } - } - } - } - }, - "schemas": { - "resp.lookup.gid-by-title": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Game IDs Lookup by Title Response", - "type": "object", - "additionalProperties": { - "x-additionalPropertiesName": "title", - "oneOf": [ - { - "type": "null" - }, - { - "type": "string", - "format": "uuid" - } - ] - } - }, - "resp.lookup.gid-by-shopid": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Game IDs lookup by shop ID response", - "type": "object", - "additionalProperties": { - "x-additionalPropertiesName": "shop ID", - "oneOf": [ - { - "type": "null" - }, - { - "type": "string", - "format": "uuid" - } - ] - } - }, - "resp.lookup.shopid-by-gid": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Shop IDs Lookup Response", - "type": "object", - "patternProperties": { - "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - } - } - }, - "obj.price": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Price", - "type": "object", - "properties": { - "amount": { - "type": "number", - "minimum": 0 - }, - "amountInt": { - "type": "integer", - "minimum": 0 - }, - "currency": { - "type": "string", - "pattern": "[A-Z]{3}" - } - }, - "required": [ - "amount", - "amountInt", - "currency" - ] - }, - "obj.game-type": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Game Type", - "oneOf": [ - { - "type": "string", - "enum": [ - "game", - "dlc", - "package" - ] - }, - { - "type": "null" - } - ] - }, - "obj.asset-map": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Asset Map", - "type": "object", - "properties": { - "banner145": { - "type": "string" - }, - "banner300": { - "type": "string" - }, - "banner400": { - "type": "string" - }, - "banner600": { - "type": "string" - }, - "boxart": { - "type": "string" - } - } - }, - "obj.game": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Game", - "type": "object", - "required": [ - "id", - "slug", - "title", - "type", - "mature", - "assets" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "slug": { - "type": "string" - }, - "title": { - "type": "string" - }, - "type": { - "$ref": "#/components/schemas/obj.game-type" - }, - "mature": { - "type": "boolean" - }, - "assets": { - "$ref": "#/components/schemas/obj.asset-map" - } - } - }, - "obj.bundle": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Bundle", - "type": "object", - "required": [ - "id", - "title", - "page", - "url", - "isMature", - "publish", - "expiry", - "note", - "counts", - "tiers" - ], - "properties": { - "id": { - "type": "integer" - }, - "title": { - "type": "string" - }, - "page": { - "type": "object", - "required": [ - "id", - "name" - ], - "properties": { - "id": { - "type": "number" - }, - "name": { - "type": "string" - }, - "shopId": { - "oneOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ] - } - } - }, - "url": { - "type": "string", - "format": "uri" - }, - "details": { - "type": "string", - "format": "uri" - }, - "isMature": { - "type": "boolean" - }, - "publish": { - "type": "string", - "format": "date-time" - }, - "expiry": { - "type": [ - "string", - "null" - ], - "format": "date-time" - }, - "note": { - "type": [ - "string", - "null" - ] - }, - "counts": { - "type": "object", - "required": [ - "games", - "media" - ], - "properties": { - "games": { - "type": "integer", - "minimum": 0 - }, - "media": { - "type": "integer", - "minimum": 0 - } - } - }, - "tiers": { - "type": "array", - "items": { - "type": "object", - "required": [ - "price", - "addon", - "games" - ], - "properties": { - "price": { - "oneOf": [ - { - "$ref": "#/components/schemas/obj.price" - }, - { - "type": "null" - } - ] - }, - "addon": { - "type": "boolean" - }, - "games": { - "type": "array", - "items": { - "$ref": "#/components/schemas/obj.game" - } - } - } - } - } - } - }, - "resp.bundles": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "array", - "items": { - "$ref": "#/components/schemas/obj.bundle" - } - }, - "obj.shop": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Shop", - "type": "object", - "required": [ - "id", - "name" - ], - "properties": { - "id": { - "type": "number" - }, - "name": { - "type": "string" - } - } - }, - "obj.platform": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Platform", - "type": "object", - "required": [ - "id", - "name" - ], - "properties": { - "id": { - "type": "number" - }, - "name": { - "type": "string" - } - } - }, - "obj.platform-list": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Platform List", - "type": "array", - "items": { - "$ref": "#/components/schemas/obj.platform" - } - }, - "obj.giveaway": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Giveaway", - "type": "object", - "required": [ - "id", - "title", - "shop", - "url", - "details", - "isMature", - "publish", - "expiry", - "note", - "games" - ], - "properties": { - "id": { - "type": "integer" - }, - "title": { - "type": "string" - }, - "shop": { - "oneOf": [ - { - "$ref": "#/components/schemas/obj.shop" - }, - { - "type": "null" - } - ] - }, - "url": { - "type": "string", - "format": "uri" - }, - "details": { - "type": "string", - "format": "uri" - }, - "isMature": { - "type": "boolean" - }, - "publish": { - "type": "string", - "format": "date-time" - }, - "expiry": { - "type": [ - "string", - "null" - ], - "format": "date-time" - }, - "note": { - "type": [ - "string", - "null" - ] - }, - "games": { - "type": "array", - "items": { - "title": "Giveaway Game", - "type": "object", - "required": [ - "id", - "slug", - "title", - "type", - "mature", - "assets", - "drmFree", - "keys", - "platforms" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "slug": { - "type": "string" - }, - "title": { - "type": "string" - }, - "type": { - "$ref": "#/components/schemas/obj.game-type" - }, - "mature": { - "type": "boolean" - }, - "assets": { - "$ref": "#/components/schemas/obj.asset-map" - }, - "drmFree": { - "type": "boolean" - }, - "keys": { - "type": "array", - "items": { - "$ref": "#/components/schemas/obj.shop" - } - }, - "platforms": { - "$ref": "#/components/schemas/obj.platform-list" - } - } - } - } - } - }, - "resp.giveaways": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "array", - "items": { - "$ref": "#/components/schemas/obj.giveaway" - } - }, - "resp.games.search": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Game Search Response", - "type": "array", - "items": { - "$ref": "#/components/schemas/obj.game" - } - }, - "resp.games.lookup": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Game Lookup Response", - "type": "object", - "required": [ - "found" - ], - "properties": { - "found": { - "type": "boolean" - }, - "game": { - "$ref": "#/components/schemas/obj.game" - } - } - }, - "obj.company": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Company", - "type": "object", - "required": [ - "id", - "name" - ], - "properties": { - "id": { - "type": "number" - }, - "name": { - "type": "string" - } - } - }, - "obj.reviews": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Reviews", - "type": "object", - "required": [ - "score", - "source", - "count", - "url" - ], - "properties": { - "score": { - "type": [ - "number", - "null" - ] - }, - "source": { - "type": "string" - }, - "count": { - "type": [ - "number", - "null" - ] - }, - "url": { - "type": "string", - "format": "uri" - } - } - }, - "resp.games.info": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Game Info Response", - "type": "object", - "required": [ - "id", - "slug", - "title", - "type", - "mature", - "assets", - "earlyAccess", - "achievements", - "tradingCards", - "appid", - "tags", - "releaseDate", - "developers", - "publishers", - "reviews", - "stats", - "players", - "urls" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "slug": { - "type": "string" - }, - "title": { - "type": "string" - }, - "type": { - "$ref": "#/components/schemas/obj.game-type" - }, - "mature": { - "type": "boolean" - }, - "assets": { - "$ref": "#/components/schemas/obj.asset-map" - }, - "earlyAccess": { - "type": "boolean" - }, - "achievements": { - "type": "boolean" - }, - "tradingCards": { - "type": "boolean" - }, - "appid": { - "type": [ - "integer", - "null" - ] - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "releaseDate": { - "type": [ - "string", - "null" - ], - "format": "date" - }, - "developers": { - "type": "array", - "items": { - "$ref": "#/components/schemas/obj.company" - } - }, - "publishers": { - "type": "array", - "items": { - "$ref": "#/components/schemas/obj.company" - } - }, - "reviews": { - "type": "array", - "items": { - "$ref": "#/components/schemas/obj.reviews" - } - }, - "stats": { - "type": "object", - "properties": { - "rank": { - "type": "integer", - "minimum": 0 - }, - "waitlisted": { - "type": "integer", - "minimum": 0 - }, - "collected": { - "type": "integer", - "minimum": 0 - } - } - }, - "players": { - "oneOf": [ - { - "type": "object", - "required": [ - "recent", - "day", - "week", - "peak" - ], - "properties": { - "recent": { - "type": "integer", - "minimum": 0 - }, - "day": { - "type": "integer", - "minimum": 0 - }, - "week": { - "type": "integer", - "minimum": 0 - }, - "peak": { - "type": "integer", - "minimum": 0 - } - } - }, - { - "type": "null" - } - ] - }, - "urls": { - "type": "object", - "required": [ - "game" - ], - "properties": { - "game": { - "type": "string", - "format": "uri" - } - } - } - } - }, - "obj.deal-flag": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Deal Flag", - "oneOf": [ - { - "type": "string", - "enum": [ - "H", - "N", - "S" - ], - "description": "- **H**: Historical Low\n- **N**: New Historical Low\n- **S**: Store low" - }, - { - "type": "null" - } - ] - }, - "obj.drm": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "DRM", - "type": "object", - "properties": { - "id": { - "type": "number" - }, - "name": { - "type": "string" - } - }, - "required": [ - "id", - "name" - ] - }, - "obj.drm-list": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "DRM List", - "type": "array", - "items": { - "$ref": "#/components/schemas/obj.drm" - } - }, - "obj.deal2": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Deal", - "type": "object", - "required": [ - "shop", - "price", - "regular", - "cut", - "voucher", - "storeLow", - "flag", - "drm", - "platforms", - "timestamp", - "expiry", - "url" - ], - "properties": { - "shop": { - "$ref": "#/components/schemas/obj.shop" - }, - "price": { - "$ref": "#/components/schemas/obj.price" - }, - "regular": { - "$ref": "#/components/schemas/obj.price" - }, - "cut": { - "type": "integer", - "minimum": 0, - "maximum": 100 - }, - "voucher": { - "type": [ - "string", - "null" - ] - }, - "storeLow": { - "oneOf": [ - { - "type": "null" - }, - { - "$ref": "#/components/schemas/obj.price" - } - ] - }, - "flag": { - "$ref": "#/components/schemas/obj.deal-flag" - }, - "drm": { - "$ref": "#/components/schemas/obj.drm-list" - }, - "platforms": { - "$ref": "#/components/schemas/obj.platform-list" - }, - "timestamp": { - "type": "string", - "format": "date-time" - }, - "expiry": { - "type": [ - "string", - "null" - ], - "format": "date-time" - }, - "url": { - "type": "string", - "format": "uri" - } - } - }, - "resp.games.prices": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Prices Response", - "type": "array", - "items": { - "type": "object", - "required": [ - "id", - "historyLow", - "deals" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "Game ID" - }, - "historyLow": { - "type": "object", - "required": [ - "all", - "y1", - "m3" - ], - "properties": { - "all": { - "oneOf": [ - { - "type": "null" - }, - { - "$ref": "#/components/schemas/obj.price" - } - ] - }, - "y1": { - "oneOf": [ - { - "type": "null" - }, - { - "$ref": "#/components/schemas/obj.price" - } - ] - }, - "m3": { - "oneOf": [ - { - "type": "null" - }, - { - "$ref": "#/components/schemas/obj.price" - } - ] - } - } - }, - "deals": { - "type": "array", - "items": { - "$ref": "#/components/schemas/obj.deal2" - } - } - } - } - }, - "resp.games.bundles": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Bundles with Game Response", - "type": "array", - "items": { - "$ref": "#/components/schemas/obj.bundle" - } - }, - "resp.games.giveaways": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Giveaways with Game Response", - "type": "array", - "items": { - "$ref": "#/components/schemas/obj.giveaway" - } - }, - "obj.deal-overview": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Overview Deal", - "description": "This object is basically the same as regular Deal, difference being storeLow and historyLow properties are not included", - "type": "object", - "required": [ - "shop", - "price", - "regular", - "cut", - "voucher", - "flag", - "drm", - "platforms", - "timestamp", - "expiry", - "url" - ], - "properties": { - "shop": { - "$ref": "#/components/schemas/obj.shop" - }, - "price": { - "$ref": "#/components/schemas/obj.price" - }, - "regular": { - "$ref": "#/components/schemas/obj.price" - }, - "cut": { - "type": "integer", - "minimum": 0, - "maximum": 100 - }, - "voucher": { - "type": [ - "string", - "null" - ] - }, - "flag": { - "$ref": "#/components/schemas/obj.deal-flag" - }, - "drm": { - "$ref": "#/components/schemas/obj.drm-list" - }, - "platforms": { - "$ref": "#/components/schemas/obj.platform-list" - }, - "timestamp": { - "type": "string", - "format": "date-time" - }, - "expiry": { - "type": [ - "string", - "null" - ], - "format": "date" - }, - "url": { - "type": "string", - "format": "uri" - } - } - }, - "obj.historylow": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Historical Low", - "type": "object", - "required": [ - "shop", - "price", - "regular", - "cut", - "timestamp" - ], - "properties": { - "shop": { - "$ref": "#/components/schemas/obj.shop" - }, - "price": { - "$ref": "#/components/schemas/obj.price" - }, - "regular": { - "$ref": "#/components/schemas/obj.price" - }, - "cut": { - "type": "integer", - "minimum": 0, - "maximum": 100 - }, - "timestamp": { - "type": "string", - "format": "date-time" - } - } - }, - "resp.games.overview": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Games Overview Response", - "type": "object", - "required": [ - "prices", - "bundles" - ], - "properties": { - "prices": { - "type": "array", - "items": { - "type": "object", - "required": [ - "id", - "current", - "lowest", - "bundled", - "urls" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "current": { - "oneOf": [ - { - "$ref": "#/components/schemas/obj.deal-overview" - }, - { - "type": "null" - } - ] - }, - "lowest": { - "oneOf": [ - { - "$ref": "#/components/schemas/obj.historylow" - }, - { - "type": "null" - } - ] - }, - "bundled": { - "type": "integer", - "minimum": 0 - }, - "urls": { - "type": "object", - "required": [ - "game" - ], - "properties": { - "game": { - "type": "string", - "format": "uri" - } - } - } - } - } - }, - "bundles": { - "type": "array", - "items": { - "$ref": "#/components/schemas/obj.bundle" - } - } - } - }, - "resp.games.historylow": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Historical Lows Response", - "type": "array", - "items": { - "title": "Historical Low Record", - "type": "object", - "required": [ - "id", - "low" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "low": { - "$ref": "#/components/schemas/obj.historylow" - } - } - } - }, - "resp.games.storelow": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Store Lows Response", - "type": "array", - "items": { - "title": "Store Lows", - "type": "object", - "required": [ - "id", - "lows" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "lows": { - "type": "array", - "minItems": 1, - "items": { - "type": "object", - "required": [ - "shop", - "price", - "regular", - "cut", - "timestamp" - ], - "properties": { - "shop": { - "$ref": "#/components/schemas/obj.shop" - }, - "price": { - "$ref": "#/components/schemas/obj.price" - }, - "regular": { - "$ref": "#/components/schemas/obj.price" - }, - "cut": { - "type": "integer", - "minimum": 0, - "maximum": 100 - }, - "timestamp": { - "type": "string", - "format": "date-time" - } - } - } - } - } - } - }, - "resp.games.history": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "History response", - "type": "array", - "items": { - "type": "object", - "required": [ - "timestamp", - "shop", - "deal" - ], - "properties": { - "timestamp": { - "type": "string", - "format": "date-time" - }, - "shop": { - "$ref": "#/components/schemas/obj.shop" - }, - "deal": { - "oneOf": [ - { - "type": "object", - "required": [ - "price", - "regular", - "cut" - ], - "properties": { - "price": { - "$ref": "#/components/schemas/obj.price" - }, - "regular": { - "$ref": "#/components/schemas/obj.price" - }, - "cut": { - "type": "number", - "minimum": 0, - "maximum": 100 - } - } - }, - { - "type": "null" - } - ] - } - } - } - }, - "obj.game.subscription": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Game Subscription", - "type": "object", - "required": [ - "id", - "name", - "leaving" - ], - "properties": { - "id": { - "title": "Subscription ID", - "type": "integer", - "minimum": 1 - }, - "name": { - "title": "Subscription name", - "type": "string" - }, - "leaving": { - "oneOf": [ - { - "type": "string", - "format": "date-time" - }, - { - "type": "null" - } - ] - } - } - }, - "resp.games.subscriptions": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Games Subscriptions Response", - "type": "array", - "items": { - "title": "Game Subscriptions", - "type": "object", - "required": [ - "id", - "subs" - ], - "properties": { - "id": { - "title": "Game ID", - "type": "string", - "format": "uuid" - }, - "subs": { - "type": "array", - "items": { - "$ref": "#/components/schemas/obj.game.subscription" - } - } - } - } - }, - "filter.range": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "description": "Range filter", - "type": "object", - "required": [ - "min", - "max" - ], - "properties": { - "min": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "number" - } - ] - }, - "max": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "number" - } - ] - } - } - }, - "filter.range.bounded": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "description": "Bounded Range filter", - "type": "object", - "required": [ - "min", - "max" - ], - "properties": { - "min": { - "oneOf": [ - { - "type": "number", - "minimum": 0, - "maximum": 100 - }, - { - "type": "null" - } - ] - }, - "max": { - "oneOf": [ - { - "type": "number", - "minimum": 0, - "maximum": 100 - }, - { - "type": "null" - } - ] - } - } - }, - "obj.filters.deals": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "description": "Deal Filters", - "type": "object", - "required": [], - "properties": { - "price": { - "$ref": "#/components/schemas/filter.range" - }, - "regular": { - "$ref": "#/components/schemas/filter.range" - }, - "cut": { - "$ref": "#/components/schemas/filter.range.bounded" - }, - "flag": { - "description": "Deal flag, N for new historical low, H for historical low, S for shop low", - "oneOf": [ - { - "type": "string", - "enum": [ - "N", - "H", - "S" - ] - }, - { - "type": "null" - } - ] - }, - "hlprice": { - "description": "Within `` of historical low", - "type": "number" - }, - "hlperc": { - "description": "Within `` of historical low", - "type": "number" - } - } - }, - "filter.boolean": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "boolean", - "enum": [ - true - ] - }, - "obj.filters.game": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "description": "Game Filters", - "type": "object", - "required": [], - "properties": { - "drm": { - "description": "`1000` for DRM Free or `shopId`\n", - "type": "array", - "items": { - "type": "number" - } - }, - "platform": { - "description": "`1` Windows, `2` Mac, `3` Linux, `5` HTC Vive, `6` Oculus, `7` Windows Mixed Reality\n", - "type": "array", - "items": { - "type": "number" - } - }, - "type": { - "description": "\"Is a\" filter \\\nPossible values: `1` Game, `2` DLC, `3` Package, `7` Software, `9` Hardware\n", - "type": "array", - "items": { - "type": "number" - } - }, - "typeNot": { - "description": "\"Is not a\" filter \\\nSee `type` for possible values\n" - }, - "tradingCards": { - "$ref": "#/components/schemas/filter.boolean" - }, - "achievements": { - "$ref": "#/components/schemas/filter.boolean" - }, - "mature": { - "$ref": "#/components/schemas/filter.boolean" - }, - "earlyAccess": { - "$ref": "#/components/schemas/filter.boolean" - }, - "preOrder": { - "$ref": "#/components/schemas/filter.boolean" - }, - "notPreOrder": { - "$ref": "#/components/schemas/filter.boolean" - }, - "bundled": { - "$ref": "#/components/schemas/filter.boolean" - }, - "wasBundled": { - "$ref": "#/components/schemas/filter.boolean" - }, - "neverBundled": { - "$ref": "#/components/schemas/filter.boolean" - }, - "inCollection": { - "$ref": "#/components/schemas/filter.boolean" - }, - "notInCollection": { - "$ref": "#/components/schemas/filter.boolean" - }, - "inWaitlist": { - "$ref": "#/components/schemas/filter.boolean" - }, - "notInWaitlist": { - "$ref": "#/components/schemas/filter.boolean" - }, - "userDlcs": { - "description": "DLCs for user's games", - "$ref": "#/components/schemas/filter.boolean" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "tagsUnion": { - "type": "array", - "items": { - "type": "string" - } - }, - "inSpotlight": { - "$ref": "#/components/schemas/filter.boolean" - }, - "wasSpotlight": { - "$ref": "#/components/schemas/filter.boolean" - }, - "inBundle": { - "description": "Game is included in bundle ID ``", - "type": "number" - } - } - }, - "obj.filters.reviews": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "description": "Reviews Filters", - "type": "object", - "required": [], - "properties": { - "steamPerc": { - "description": "Steam score", - "$ref": "#/components/schemas/filter.range.bounded" - }, - "steamCount": { - "description": "Steam review count", - "$ref": "#/components/schemas/filter.range" - }, - "metaCritic": { - "description": "OpenCritic critics score", - "$ref": "#/components/schemas/filter.range.bounded" - }, - "metauser": { - "description": "MetaCritic users score", - "$ref": "#/components/schemas/filter.range.bounded" - }, - "openCritic": { - "description": "OpenCritic score", - "$ref": "#/components/schemas/filter.range.bounded" - } - } - }, - "obj.filters.shops": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "description": "Shops Filters", - "type": "object", - "required": [], - "properties": { - "shops": { - "description": "List of shop IDs", - "type": "array", - "items": { - "type": "number" - } - } - } - }, - "obj.filters.time": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "description": "Time Filters", - "type": "object", - "required": [], - "properties": { - "added": { - "description": "Deal found in last `` hours", - "type": "number", - "minimum": 0 - }, - "expiry": { - "description": "Deal expires in next `` hours", - "type": "number", - "minimum": 0 - }, - "releaseDays": { - "description": "Game was released in last `` days", - "type": "number" - }, - "releaseYear": { - "description": "Game was released between `` and ``", - "type": "object", - "required": [ - "min", - "max" - ], - "properties": { - "min": { - "oneOf": [ - { - "type": "number", - "minimum": 0, - "maximum": 100 - }, - { - "type": "null" - } - ] - }, - "max": { - "oneOf": [ - { - "type": "number", - "minimum": 0, - "maximum": 100 - }, - { - "type": "null" - } - ] - } - } - }, - "releaseDate": { - "description": "Game was released between `` and ``", - "type": "object", - "required": [ - "min", - "max" - ], - "properties": { - "min": { - "oneOf": [ - { - "type": "string", - "format": "date" - }, - { - "type": "null" - } - ] - }, - "max": { - "oneOf": [ - { - "type": "string", - "format": "date" - }, - { - "type": "null" - } - ] - } - } - } - } - }, - "req.deals": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Deals Request", - "type": "object", - "properties": { - "country": { - "description": "Two letter country code (ISO 3166-1 alpha-2)", - "type": "string", - "minLength": 2, - "maxLength": 2, - "default": "US" - }, - "offset": { - "description": "Deals list offset", - "type": "integer", - "minimum": 0, - "default": 0 - }, - "limit": { - "description": "How many deals to return", - "type": "integer", - "minimum": 1, - "maximum": 200, - "default": 20 - }, - "sort": { - "description": "Sorting values, same as in deals list on the website", - "type": "string" - }, - "nondeals": { - "description": "Load non-sale prices", - "type": "boolean", - "default": false - }, - "mature": { - "description": "Load games marked as mature", - "type": "boolean", - "default": false - }, - "shops": { - "description": "List of shop IDs", - "type": "array", - "items": { - "type": "number", - "description": "Shop ID" - } - }, - "filter": { - "allOf": [ - { - "$ref": "#/components/schemas/obj.filters.deals" - }, - { - "$ref": "#/components/schemas/obj.filters.game" - }, - { - "$ref": "#/components/schemas/obj.filters.reviews" - }, - { - "$ref": "#/components/schemas/obj.filters.shops" - }, - { - "$ref": "#/components/schemas/obj.filters.time" - } - ] - } - } - }, - "obj.deal": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Deal", - "type": "object", - "required": [ - "shop", - "price", - "regular", - "cut", - "voucher", - "storeLow", - "historyLow", - "historyLow_1y", - "historyLow_3m", - "flag", - "drm", - "platforms", - "timestamp", - "expiry", - "url" - ], - "properties": { - "shop": { - "$ref": "#/components/schemas/obj.shop" - }, - "price": { - "$ref": "#/components/schemas/obj.price" - }, - "regular": { - "$ref": "#/components/schemas/obj.price" - }, - "cut": { - "type": "integer", - "minimum": 0, - "maximum": 100 - }, - "voucher": { - "type": [ - "string", - "null" - ] - }, - "storeLow": { - "oneOf": [ - { - "type": "null" - }, - { - "$ref": "#/components/schemas/obj.price" - } - ] - }, - "historyLow": { - "oneOf": [ - { - "type": "null" - }, - { - "$ref": "#/components/schemas/obj.price" - } - ] - }, - "historyLow_1y": { - "oneOf": [ - { - "type": "null" - }, - { - "$ref": "#/components/schemas/obj.price" - } - ] - }, - "historyLow_3m": { - "oneOf": [ - { - "type": "null" - }, - { - "$ref": "#/components/schemas/obj.price" - } - ] - }, - "flag": { - "$ref": "#/components/schemas/obj.deal-flag" - }, - "drm": { - "$ref": "#/components/schemas/obj.drm-list" - }, - "platforms": { - "$ref": "#/components/schemas/obj.platform-list" - }, - "timestamp": { - "type": "string", - "format": "date-time" - }, - "expiry": { - "type": [ - "string", - "null" - ], - "format": "date-time" - }, - "url": { - "type": "string", - "format": "uri" - } - } - }, - "resp.deals": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Deals Response", - "type": "object", - "required": [ - "nextOffset", - "hasMore", - "list" - ], - "properties": { - "nextOffset": { - "type": "integer", - "format": "int32", - "minimum": 0 - }, - "hasMore": { - "type": "boolean" - }, - "list": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "slug": { - "type": "string" - }, - "title": { - "type": "string" - }, - "type": { - "$ref": "#/components/schemas/obj.game-type" - }, - "mature": { - "type": "boolean" - }, - "assets": { - "$ref": "#/components/schemas/obj.asset-map" - }, - "deal": { - "$ref": "#/components/schemas/obj.deal" - } - }, - "required": [ - "id", - "slug", - "title", - "type", - "deal" - ] - } - } - } - }, - "obj.waitlist.game": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Waitlist Game", - "type": "object", - "required": [ - "id", - "slug", - "title", - "type", - "assets", - "mature", - "added" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "slug": { - "type": "string" - }, - "title": { - "type": "string" - }, - "type": { - "$ref": "#/components/schemas/obj.game-type" - }, - "assets": { - "$ref": "#/components/schemas/obj.asset-map" - }, - "mature": { - "type": "boolean" - }, - "added": { - "oneOf": [ - { - "type": "string", - "format": "date-time" - }, - { - "type": "null" - } - ] - } - } - }, - "resp.waitlist.games": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Waitlist Games Response", - "type": "array", - "items": { - "$ref": "#/components/schemas/obj.waitlist.game" - } - }, - "obj.collection.game": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Collection Game", - "type": "object", - "required": [ - "id", - "slug", - "title", - "type", - "assets", - "mature", - "group", - "added" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "slug": { - "type": "string" - }, - "title": { - "type": "string" - }, - "type": { - "$ref": "#/components/schemas/obj.game-type" - }, - "assets": { - "$ref": "#/components/schemas/obj.asset-map" - }, - "mature": { - "type": "boolean" - }, - "group": { - "type": "number", - "minimum": 0 - }, - "added": { - "oneOf": [ - { - "type": "string", - "format": "date-time" - }, - { - "type": "null" - } - ] - } - } - }, - "obj.user-tag": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Tag", - "type": "object", - "required": [ - "id", - "tag" - ], - "properties": { - "id": { - "type": "number" - }, - "tag": { - "type": "string" - } - } - }, - "obj.collection.copy": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Collection Copy", - "type": "object", - "required": [ - "id", - "game", - "shop", - "redeemed", - "price", - "note", - "tags", - "added" - ], - "properties": { - "id": { - "type": "integer" - }, - "game": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid" - } - } - }, - "shop": { - "oneOf": [ - { - "$ref": "#/components/schemas/obj.shop" - }, - { - "type": "null" - } - ] - }, - "redeemed": { - "type": "boolean" - }, - "price": { - "oneOf": [ - { - "$ref": "#/components/schemas/obj.price" - }, - { - "type": "null" - } - ] - }, - "note": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "tags": { - "type": "array", - "items": { - "$ref": "#/components/schemas/obj.user-tag" - } - }, - "added": { - "type": "string", - "format": "date-time" - } - } - }, - "obj.collection.copy.new": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "New Collection Copy", - "type": "object", - "required": [ - "gameId", - "redeemed" - ], - "properties": { - "gameId": { - "type": "string", - "format": "uuid" - }, - "redeemed": { - "type": "boolean" - }, - "shop": { - "oneOf": [ - { - "type": "number", - "description": "Shop ID" - }, - { - "type": "null" - } - ] - }, - "price": { - "oneOf": [ - { - "type": "object", - "required": [ - "amount", - "currency" - ], - "properties": { - "amount": { - "type": "number", - "format": "float" - }, - "currency": { - "type": "string" - } - } - }, - { - "type": "null" - } - ] - }, - "note": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "tags": { - "oneOf": [ - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "null" - } - ] - } - } - }, - "obj.collection.copy.patch": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Collection Copy Patch", - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "number" - }, - "redeemed": { - "type": "boolean" - }, - "shop": { - "oneOf": [ - { - "type": "number", - "description": "Shop ID" - }, - { - "type": "null" - } - ] - }, - "price": { - "oneOf": [ - { - "type": "object", - "required": [ - "amount", - "currency" - ], - "properties": { - "amount": { - "type": "number", - "format": "float" - }, - "currency": { - "type": "string" - } - } - }, - { - "type": "null" - } - ] - }, - "note": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "tags": { - "oneOf": [ - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "null" - } - ] - } - } - }, - "obj.collection.group": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Collection Category", - "type": "object", - "required": [ - "id", - "title", - "public" - ], - "properties": { - "id": { - "type": "integer" - }, - "title": { - "type": "string" - }, - "public": { - "type": "boolean" - } - } - }, - "obj.collection.group.new": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "New Collection Category", - "type": "object", - "required": [ - "title", - "public" - ], - "properties": { - "title": { - "type": "string" - }, - "public": { - "type": "boolean" - } - } - }, - "obj.collection.group.patch": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Collection Category Patch", - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "integer" - }, - "title": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "public": { - "oneOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - }, - "position": { - "oneOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ] - } - } - }, - "obj.ignored.game": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Ignored Game", - "type": "object", - "required": [ - "id", - "slug", - "title", - "type", - "assets", - "mature", - "added" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "slug": { - "type": "string" - }, - "title": { - "type": "string" - }, - "type": { - "$ref": "#/components/schemas/obj.game-type" - }, - "assets": { - "$ref": "#/components/schemas/obj.asset-map" - }, - "mature": { - "type": "boolean" - }, - "added": { - "type": "string", - "format": "date-time" - } - } - }, - "resp.ignored.games": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Ignore List Games Response", - "type": "array", - "items": { - "$ref": "#/components/schemas/obj.ignored.game" - } - }, - "bucket": { - "type": "object", - "required": [ - "bucket", - "count", - "percentile" - ], - "properties": { - "bucket": { - "type": "number", - "minimum": 0 - }, - "count": { - "type": "number", - "minimum": 0 - }, - "percentile": { - "type": "number", - "minimum": 0, - "maximum": 100 - } - } - }, - "resp.stats.waitlist": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Waitlist Stats Response", - "type": "object", - "required": [ - "count", - "price", - "cut" - ], - "properties": { - "count": { - "type": "integer", - "minimum": 0 - }, - "price": { - "type": "object", - "required": [ - "currency", - "any", - "average", - "buckets" - ], - "properties": { - "currency": { - "type": "string", - "minLength": 3, - "maxLength": 3, - "pattern": "^[A-Z]{3}$", - "description": "Currency in which the prices are listed" - }, - "any": { - "type": "integer", - "minimum": 0, - "description": "How many users did not set price limit" - }, - "average": { - "type": "number", - "minimum": 0 - }, - "buckets": { - "type": "array", - "items": { - "$ref": "#/components/schemas/bucket" - } - } - } - }, - "cut": { - "type": "object", - "required": [ - "average", - "buckets" - ], - "properties": { - "average": { - "type": "number", - "minimum": 0 - }, - "buckets": { - "type": "array", - "items": { - "$ref": "#/components/schemas/bucket" - } - } - } - } - }, - "$defs": { - "bucket": { - "type": "object", - "required": [ - "bucket", - "count", - "percentile" - ], - "properties": { - "bucket": { - "type": "number", - "minimum": 0 - }, - "count": { - "type": "number", - "minimum": 0 - }, - "percentile": { - "type": "number", - "minimum": 0, - "maximum": 100 - } - } - } - } - }, - "obj.game-ranked": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Ranked Game", - "type": "object", - "required": [ - "position", - "id", - "slug", - "title", - "type", - "mature", - "count" - ], - "properties": { - "position": { - "type": "integer", - "minimum": 1 - }, - "id": { - "type": "string", - "format": "uuid" - }, - "slug": { - "type": "string" - }, - "title": { - "type": "string" - }, - "type": { - "$ref": "#/components/schemas/obj.game-type" - }, - "mature": { - "type": "boolean" - }, - "count": { - "type": "integer", - "minimum": 0 - } - } - }, - "resp.stats.ranked-games": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Ranked Games Response", - "type": "array", - "items": { - "$ref": "#/components/schemas/obj.game-ranked" - } - }, - "resp.user.info": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "User Info Response", - "type": "object", - "required": [ - "username" - ], - "properties": { - "username": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - } - }, - "obj.note": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "User game note", - "type": "object", - "required": [ - "gid", - "note" - ], - "properties": { - "gid": { - "description": "Game ID", - "type": "string", - "format": "uuid" - }, - "note": { - "description": "Non-empty string", - "type": "string" - } - } - }, - "resp.notes.get": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Get Notes Response", - "type": "array", - "items": { - "$ref": "#/components/schemas/obj.note" - } - }, - "obj.profile": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Profile", - "description": "Description of the account", - "type": "object", - "required": [ - "accountId", - "accountName" - ], - "properties": { - "accountId": { - "type": "string", - "description": "Per-app unique ID. This can be any string, but it needs to uniquely identify the account within your app." - }, - "accountName": { - "type": "string", - "description": "Name of the account. Does not need to be unique, it's meant to be a human-friendly name." - } - } - }, - "resp.link.put": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Link Profile Response", - "type": "object", - "required": [ - "token" - ], - "properties": { - "token": { - "type": "string" - } - } - }, - "obj.waitlist.entry": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Waitlist Sync Entry", - "type": "object", - "required": [ - "shop", - "id", - "title" - ], - "properties": { - "shop": { - "type": "number", - "description": "Shop ID" - }, - "id": { - "type": "string", - "description": "ID can be any string that will identify the game. It should be stable and not change in the future.\n\nID can also used to identify the game, if you use same IDs that we use for tracking shops. If a game is not identified\nwith shop and id, we will use title. \n\nFor Steam we use full ids, i.e. app/{id}, sub/{id} or bundle/{id}.\n" - }, - "title": { - "type": "string", - "description": "Title of the game.\n" - } - } - }, - "resp.sync.waitlist": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Sync Response", - "type": "object", - "required": [ - "total", - "added", - "removed" - ], - "properties": { - "total": { - "description": "Number of games that were successfully parsed", - "type": "number", - "minimum": 0 - }, - "added": { - "description": "Number of games that were added to Waitlist", - "type": "number", - "minimum": 0 - }, - "removed": { - "description": "Number of games that were removed from Waitlist", - "type": "number", - "minimum": 0 - } - } - }, - "obj.collection.entry": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Collection Sync Entry", - "type": "object", - "required": [ - "shop", - "id", - "title" - ], - "properties": { - "shop": { - "type": "number", - "description": "Shop ID" - }, - "id": { - "type": "string", - "description": "ID can be any string that will identify the game. It should be stable and not change in the future.\n\nID can also used to identify the game, if you use same IDs that we use for tracking shops. If a game is not identified\nwith shop and id, we will use title. \n\nFor Steam we use full ids, i.e. app/{id}, sub/{id} or bundle/{id}.\n" - }, - "title": { - "type": "string", - "description": "Title of the game.\n" - }, - "playtime": { - "description": "Play time in minutes", - "oneOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ] - }, - "lastPlayed": { - "oneOf": [ - { - "type": "string", - "format": "date-time" - }, - { - "type": "null" - } - ] - } - } - }, - "resp.sync.collection": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Sync Response", - "type": "object", - "required": [ - "total", - "added", - "removed" - ], - "properties": { - "total": { - "description": "Number of copies that were successfully parsed", - "type": "number", - "minimum": 0 - }, - "added": { - "description": "Number of copies that were added to Collection", - "type": "number", - "minimum": 0 - }, - "removed": { - "description": "Number of copies that were removed from Collection", - "type": "number", - "minimum": 0 - } - } - }, - "obj.notification": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Notification", - "type": "object", - "required": [ - "id", - "type", - "title", - "timestamp", - "read" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "type": { - "type": "string", - "enum": [ - "waitlist" - ] - }, - "title": { - "type": "string" - }, - "timestamp": { - "type": "string", - "format": "date-time" - }, - "read": { - "oneOf": [ - { - "type": "string", - "format": "date-time" - }, - { - "type": "null" - } - ] - } - } - }, - "obj.price-nullable": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Price", - "oneOf": [ - { - "$ref": "#/components/schemas/obj.price" - }, - { - "type": "null" - } - ] - }, - "obj.notification.deal": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Waitlist Notification Deal", - "type": "object", - "required": [ - "shop", - "price", - "regular", - "cut", - "voucher", - "storeLow", - "flag", - "drm", - "platforms", - "timestamp", - "expiry", - "url" - ], - "properties": { - "shop": { - "$ref": "#/components/schemas/obj.shop" - }, - "price": { - "$ref": "#/components/schemas/obj.price" - }, - "regular": { - "$ref": "#/components/schemas/obj.price" - }, - "cut": { - "type": "integer", - "minimum": 0, - "maximum": 100 - }, - "voucher": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "storeLow": { - "$ref": "#/components/schemas/obj.price-nullable" - }, - "flag": { - "$ref": "#/components/schemas/obj.deal-flag" - }, - "drm": { - "$ref": "#/components/schemas/obj.drm-list" - }, - "platforms": { - "$ref": "#/components/schemas/obj.platform-list" - }, - "timestamp": { - "type": "string", - "format": "date-time" - }, - "expiry": { - "oneOf": [ - { - "type": "string", - "format": "date-time" - }, - { - "type": "null" - } - ] - }, - "url": { - "type": "string", - "format": "uri" - } - } - }, - "obj.notification.game": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Waitlist Notification Game", - "type": "object", - "required": [ - "id", - "slug", - "title", - "type", - "mature", - "historyLow", - "lastPrice", - "deals" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "slug": { - "type": "string" - }, - "title": { - "type": "string" - }, - "type": { - "$ref": "#/components/schemas/obj.game-type" - }, - "mature": { - "type": "boolean" - }, - "historyLow": { - "$ref": "#/components/schemas/obj.price-nullable" - }, - "lastPrice": { - "$ref": "#/components/schemas/obj.price-nullable" - }, - "deals": { - "type": "array", - "items": { - "$ref": "#/components/schemas/obj.notification.deal" - } - } - } - }, - "obj.notification.waitlist": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Waitlist Notification", - "type": "object", - "required": [ - "id", - "timestamp", - "read", - "games" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "timestamp": { - "type": "string", - "format": "date-time" - }, - "read": { - "oneOf": [ - { - "type": "string", - "format": "date-time" - }, - { - "type": "null" - } - ] - }, - "games": { - "type": "array", - "items": { - "$ref": "#/components/schemas/obj.notification.game" - } - } - } - }, - "resp.service.shops": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Shops response", - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "number" - }, - "title": { - "type": "string" - }, - "deals": { - "type": "number" - }, - "games": { - "type": "number" - }, - "update": { - "type": [ - "string", - "null" - ], - "format": "date-time" - } - }, - "required": [ - "id", - "title", - "deals", - "games", - "update" - ] - } - }, - "resp.service.shops.map": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Shops response", - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "number" - }, - "title": { - "type": "string" - } - }, - "required": [ - "id", - "title" - ] - } - }, - "obj.webhook": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", - "required": [ - "url", - "events" - ], - "properties": { - "url": { - "type": "string", - "format": "uri" - }, - "events": { - "type": "array", - "minItems": 1, - "items": { - "type": "string", - "enum": [ - "notification-waitlist" - ] - } - } - } - }, - "resp.webhook.add": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid" - } - } - }, - "resp.games.list": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "array", - "items": { - "type": "object", - "required": [ - "id", - "title", - "appid" - ], - "properties": { - "id": { - "title": "Game Id", - "type": "string", - "format": "uuid" - }, - "title": { - "title": "Game title", - "type": "string" - }, - "appid": { - "oneOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ] - } - } - } - }, - "resp.games.dots": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "array", - "items": { - "type": "object", - "required": [ - "id", - "product_id", - "old_game_id", - "new_game_id", - "timestamp", - "date" - ], - "properties": { - "id": { - "title": "Change ID", - "type": "integer" - }, - "product_id": { - "title": "Product ID", - "type": "string", - "format": "uuid" - }, - "old_game_id": { - "title": "Old game ID", - "type": "string", - "format": "uuid" - }, - "new_game_id": { - "title": "New game ID", - "type": "string", - "format": "uuid" - }, - "timestamp": { - "title": "Unix timestamp of the change", - "type": "integer" - }, - "date": { - "title": "Datetime of the change", - "type": "string", - "format": "datetime" - } - } - } - }, - "resp.internal.players": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Players Statistics Response", - "type": "object", - "required": [ - "current", - "day", - "peak" - ], - "properties": { - "current": { - "type": "number", - "minimum": 0 - }, - "day": { - "type": "number", - "minimum": 0 - }, - "peak": { - "type": "number", - "minimum": 0 - } - } - }, - "resp.internal.hltb": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "HowLongToBeat Overview Response", - "type": "object", - "required": [ - "id", - "main", - "extra", - "complete" - ], - "properties": { - "id": { - "type": "number", - "minimum": 0 - }, - "main": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "number", - "minimum": 0 - } - ] - }, - "extra": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "number", - "minimum": 0 - } - ] - }, - "complete": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "number", - "minimum": 0 - } - ] - } - } - }, - "resp.internal.wsgf": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "WSGF Overview Response", - "type": "object", - "required": [ - "url", - "wide", - "ultrawide", - "multi_monitor", - "4k" - ], - "properties": { - "url": { - "type": "string", - "format": "url" - }, - "wide": { - "type": "string", - "enum": [ - "A", - "B", - "C", - "Incomplete", - "Unsupported" - ] - }, - "ultrawide": { - "type": "string", - "enum": [ - "A", - "B", - "C", - "Incomplete", - "Unsupported" - ] - }, - "multi_monitor": { - "type": "string", - "enum": [ - "A", - "B", - "C", - "Incomplete", - "Unsupported" - ] - }, - "4k": { - "type": "string", - "enum": [ - "A", - "B", - "C", - "Incomplete", - "Unsupported" - ] - } - } - }, - "resp.internal.reviews": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Reviews Overview Response", - "type": "object", - "required": [ - "metauser", - "opencritic" - ], - "properties": { - "metauser": { - "oneOf": [ - { - "type": "object", - "properties": { - "score": { - "type": [ - "integer", - "null" - ] - }, - "verdict": { - "type": [ - "string", - "null" - ] - }, - "url": { - "type": "string", - "format": "uri" - } - } - }, - { - "type": "null" - } - ] - }, - "opencritic": { - "oneOf": [ - { - "type": "object", - "properties": { - "score": { - "type": [ - "integer", - "null" - ] - }, - "verdict": { - "type": [ - "string", - "null" - ] - }, - "url": { - "type": "string", - "format": "uri" - } - } - }, - { - "type": "null" - } - ] - } - } - }, - "resp.internal.rates": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Currency Rates Response", - "type": "array", - "items": { - "type": "object", - "required": [ - "from", - "to", - "rate" - ], - "properties": { - "from": { - "type": "string", - "pattern": "^[A-Z]{3}$" - }, - "to": { - "type": "string", - "pattern": "^[A-Z]{3}$" - }, - "rate": { - "type": "number", - "exclusiveMinimum": 0 - } - } - } - }, - "resp.internal.exfgls": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Excluded from Family Sharing Response", - "type": "object", - "additionalProperties": { - "x-additionalPropertiesName": "appid", - "type": "boolean" - } - }, - "resp.internal.twitchstream": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "oneOf": [ - { - "title": "Players Statistics Response", - "type": "object", - "required": [ - "user_name", - "title", - "thumbnail_url", - "viewer_count", - "game" - ], - "properties": { - "user_name": { - "type": "string" - }, - "title": { - "type": "string" - }, - "thumbnail_url": { - "type": "string" - }, - "viewer_count": { - "type": "integer", - "minimum": 0 - }, - "game": { - "type": "string" - } - } - }, - { - "type": "null" - } - ] - } - }, - "examples": { - "resp.gid-by-title.post.v1.success": { - "value": { - "Baldurs Gate 3": "018d9584-24d6-7010-b82b-df1f0b154cc7", - "Half-Life 2": "018d937f-012f-73b8-ab2c-898516969e6a", - "Unknown game": null - } - }, - "resp.gid-by-shopid.post.v1.success": { - "value": { - "bundle/27508": "018d95bc-fe96-73e6-a9f7-10afc28c0c03", - "bundle/28796": "018d937f-6671-7056-b419-aac8a69a625e", - "sub/467072": "018d937f-42c6-70a5-a29b-9d8c2e0f7b84", - "sub/752476": "018d937f-6128-7151-8d2e-b4a9ad2e1ce8", - "sub/137730": "018d937f-6ee4-73f5-858c-2fde3407462f", - "app/137730": null, - "bundle/33608": "018d937f-7596-706f-b75d-834d76172237" - } - }, - "resp.shopid-by-gid.post.v1.success": { - "value": { - "018d95bc-fe96-73e6-a9f7-10afc28c0c03": [ - "bundle/27508" - ], - "018d937f-6671-7056-b419-aac8a69a625e": [ - "bundle/32380", - "bundle/28796" - ], - "018d937f-42c6-70a5-a29b-9d8c2e0f7b84": [ - "app/1336490", - "sub/467072" - ], - "018d937f-6128-7151-8d2e-b4a9ad2e1ce8": [ - "sub/637996", - "app/1777620", - "sub/752476" - ] - } - }, - "resp.bundles.v1.success": { - "value": [ - { - "id": 11631, - "title": "Rimworld with all Expansions Bundle", - "page": { - "id": 8, - "name": "Fanatical", - "shopId": 6 - }, - "url": "https://www.dpbolvw.net/click-6305441-13212017?url=https%3A%2F%2Fwww.fanatical.com%2Fen%2Fbundle%2Frimworld-with-all-expansions", - "details": "https://isthereanydeal.com/bundles/11631/", - "isMature": false, - "publish": "2024-03-04T19:00:00+01:00", - "expiry": "2024-03-22T00:59:46+01:00", - "note": "* Bundle being relaunched...again and again.", - "counts": { - "games": 4, - "media": 1 - }, - "tiers": [ - { - "price": { - "amount": 87.96, - "amountInt": 8796, - "currency": "USD" - }, - "addon": false, - "games": [ - { - "id": "018d937f-12e9-71ca-a5d5-f31985870694", - "slug": "rimworld", - "title": "RimWorld", - "type": "game", - "mature": false, - "assets": { - "boxart": "https://assets.isthereanydeal.com/018d937f-12e9-71ca-a5d5-f31985870694/boxart.jpg?t=1734155400", - "banner145": "https://assets.isthereanydeal.com/018d937f-12e9-71ca-a5d5-f31985870694/banner145.jpg?t=1734155400", - "banner300": "https://assets.isthereanydeal.com/018d937f-12e9-71ca-a5d5-f31985870694/banner300.jpg?t=1734155400", - "banner400": "https://assets.isthereanydeal.com/018d937f-12e9-71ca-a5d5-f31985870694/banner400.jpg?t=1734155400", - "banner600": "https://assets.isthereanydeal.com/018d937f-12e9-71ca-a5d5-f31985870694/banner600.jpg?t=1734155400" - } - }, - { - "id": "018d937f-3e88-718b-b99d-9a45bb69be55", - "slug": "rimworld-royalty", - "title": "RimWorld - Royalty", - "type": "dlc", - "mature": false, - "assets": { - "boxart": "https://assets.isthereanydeal.com/018d937f-3e88-718b-b99d-9a45bb69be55/boxart.jpg?t=1732764965", - "banner145": "https://assets.isthereanydeal.com/018d937f-3e88-718b-b99d-9a45bb69be55/banner145.jpg?t=1732764965", - "banner300": "https://assets.isthereanydeal.com/018d937f-3e88-718b-b99d-9a45bb69be55/banner300.jpg?t=1732764965", - "banner400": "https://assets.isthereanydeal.com/018d937f-3e88-718b-b99d-9a45bb69be55/banner400.jpg?t=1732764965", - "banner600": "https://assets.isthereanydeal.com/018d937f-3e88-718b-b99d-9a45bb69be55/banner600.jpg?t=1732764966" - } - }, - { - "id": "018d937f-5256-73e1-bba6-66fd3f4d9cd7", - "slug": "rimworld-ideology", - "title": "RimWorld - Ideology", - "type": "dlc", - "mature": false, - "assets": { - "boxart": "https://assets.isthereanydeal.com/018d937f-5256-73e1-bba6-66fd3f4d9cd7/boxart.jpg?t=1732782945", - "banner145": "https://assets.isthereanydeal.com/018d937f-5256-73e1-bba6-66fd3f4d9cd7/banner145.jpg?t=1732782945", - "banner300": "https://assets.isthereanydeal.com/018d937f-5256-73e1-bba6-66fd3f4d9cd7/banner300.jpg?t=1732782945", - "banner400": "https://assets.isthereanydeal.com/018d937f-5256-73e1-bba6-66fd3f4d9cd7/banner400.jpg?t=1732782945", - "banner600": "https://assets.isthereanydeal.com/018d937f-5256-73e1-bba6-66fd3f4d9cd7/banner600.jpg?t=1732782945" - } - }, - { - "id": "018d937f-65f0-70d3-83fe-71fac1505a13", - "slug": "rimworld-biotech", - "title": "RimWorld - Biotech", - "type": "dlc", - "mature": false, - "assets": { - "boxart": "https://assets.isthereanydeal.com/018d937f-65f0-70d3-83fe-71fac1505a13/boxart.jpg?t=1732751175", - "banner145": "https://assets.isthereanydeal.com/018d937f-65f0-70d3-83fe-71fac1505a13/banner145.jpg?t=1732751175", - "banner300": "https://assets.isthereanydeal.com/018d937f-65f0-70d3-83fe-71fac1505a13/banner300.jpg?t=1732751175", - "banner400": "https://assets.isthereanydeal.com/018d937f-65f0-70d3-83fe-71fac1505a13/banner400.jpg?t=1732751175", - "banner600": "https://assets.isthereanydeal.com/018d937f-65f0-70d3-83fe-71fac1505a13/banner600.jpg?t=1732751176" - } - } - ] - } - ] - } - ] - }, - "resp.giveaways.v1.success": { - "value": [ - { - "id": 16541, - "title": "State of Mind - Free on GOG", - "shop": { - "id": 35, - "name": "GOG" - }, - "url": "https://www.dpbolvw.net/click-6305441-15456889?url=https%3A%2F%2Fwww.gog.com%2Fen%2Fgame%2Fstate_of_mind", - "details": "https://isthereanydeal.com/giveaways/16541/", - "isMature": false, - "publish": "2026-09-07T19:04:40+02:00", - "expiry": "2026-09-10T15:00:44+02:00", - "note": null, - "games": [ - { - "id": "018d937f-3807-7238-b56e-d219b2c2da64", - "slug": "state-of-mind", - "title": "State of Mind", - "type": "game", - "mature": false, - "assets": { - "boxart": "https://assets.isthereanydeal.com/018d937f-3807-7238-b56e-d219b2c2da64/boxart.jpg?t=1786392990", - "banner145": "https://assets.isthereanydeal.com/018d937f-3807-7238-b56e-d219b2c2da64/banner145.jpg?t=1786392990", - "banner300": "https://assets.isthereanydeal.com/018d937f-3807-7238-b56e-d219b2c2da64/banner300.jpg?t=1786392990", - "banner400": "https://assets.isthereanydeal.com/018d937f-3807-7238-b56e-d219b2c2da64/banner400.jpg?t=1786392990", - "banner600": "https://assets.isthereanydeal.com/018d937f-3807-7238-b56e-d219b2c2da64/banner600.jpg?t=1786392991" - }, - "drmFree": false, - "keys": [ - { - "id": 35, - "name": "GOG" - } - ], - "platforms": [ - { - "id": 1, - "name": "Windows" - }, - { - "id": 2, - "name": "Mac" - }, - { - "id": 3, - "name": "Linux" - } - ] - } - ] - } - ] - }, - "resp.search.v1.results": { - "value": [ - { - "id": "018d937f-07fc-72ed-8517-d8e24cb1eb22", - "slug": "europa-universalis-iv", - "title": "Europa Universalis IV", - "type": "game", - "mature": false, - "assets": { - "banner145": "https://assets.isthereanydeal.com/018d937f-07fc-72ed-8517-d8e24cb1eb22/banner145.jpg?t=1738002003", - "banner300": "https://assets.isthereanydeal.com/018d937f-07fc-72ed-8517-d8e24cb1eb22/banner300.jpg?t=1738002003", - "banner400": "https://assets.isthereanydeal.com/018d937f-07fc-72ed-8517-d8e24cb1eb22/banner400.jpg?t=1738002003", - "banner600": "https://assets.isthereanydeal.com/018d937f-07fc-72ed-8517-d8e24cb1eb22/banner600.jpg?t=1738002003", - "boxart": "https://assets.isthereanydeal.com/018d937f-07fc-72ed-8517-d8e24cb1eb22/boxart.jpg?t=1738002003" - } - }, - { - "id": "018d937e-f083-72b5-bfdf-5459a8948636", - "slug": "europa-universalis-iv-american-dream", - "title": "Europa Universalis IV: American Dream", - "type": "dlc", - "mature": false, - "assets": { - "banner145": "https://assets.isthereanydeal.com/018d937e-f083-72b5-bfdf-5459a8948636/banner145.jpg?t=1733619419", - "banner300": "https://assets.isthereanydeal.com/018d937e-f083-72b5-bfdf-5459a8948636/banner300.jpg?t=1733619419", - "banner400": "https://assets.isthereanydeal.com/018d937e-f083-72b5-bfdf-5459a8948636/banner400.jpg?t=1733619419", - "boxart": "https://assets.isthereanydeal.com/018d937e-f083-72b5-bfdf-5459a8948636/boxart.jpg?t=1733619418" - } - }, - { - "id": "018d937e-f4e0-71ad-add5-c2642abc7a55", - "slug": "europa-universalis-iv-rights-of-man", - "title": "Europa Universalis IV: Rights of Man", - "type": "dlc", - "mature": false, - "assets": { - "banner145": "https://assets.isthereanydeal.com/018d937e-f4e0-71ad-add5-c2642abc7a55/banner145.jpg?t=1732741281", - "banner300": "https://assets.isthereanydeal.com/018d937e-f4e0-71ad-add5-c2642abc7a55/banner300.jpg?t=1732741281", - "banner400": "https://assets.isthereanydeal.com/018d937e-f4e0-71ad-add5-c2642abc7a55/banner400.jpg?t=1732741281", - "banner600": "https://assets.isthereanydeal.com/018d937e-f4e0-71ad-add5-c2642abc7a55/banner600.jpg?t=1732741281", - "boxart": "https://assets.isthereanydeal.com/018d937e-f4e0-71ad-add5-c2642abc7a55/boxart.jpg?t=1732741281" - } - }, - { - "id": "018d937e-f999-71c8-b0a0-932f481087f9", - "slug": "expansion-europa-universalis-iv-res-publica", - "title": "Expansion - Europa Universalis IV: Res Publica", - "type": "dlc", - "mature": false, - "assets": { - "banner145": "https://assets.isthereanydeal.com/018d937e-f999-71c8-b0a0-932f481087f9/banner145.jpg?t=1732801577", - "banner300": "https://assets.isthereanydeal.com/018d937e-f999-71c8-b0a0-932f481087f9/banner300.jpg?t=1732801577", - "banner400": "https://assets.isthereanydeal.com/018d937e-f999-71c8-b0a0-932f481087f9/banner400.jpg?t=1732801577", - "banner600": "https://assets.isthereanydeal.com/018d937e-f999-71c8-b0a0-932f481087f9/banner600.jpg?t=1732801578", - "boxart": "https://assets.isthereanydeal.com/018d937e-f999-71c8-b0a0-932f481087f9/boxart.jpg?t=1732801577" - } - }, - { - "id": "018d937f-27ec-71c5-a8a4-21b0b76b3e77", - "slug": "europa-universalis-iv-songs-of-yuletide", - "title": "Europa Universalis IV: Songs of Yuletide", - "type": "dlc", - "mature": false, - "assets": { - "banner145": "https://assets.isthereanydeal.com/018d937f-27ec-71c5-a8a4-21b0b76b3e77/banner145.jpg", - "banner300": "https://assets.isthereanydeal.com/018d937f-27ec-71c5-a8a4-21b0b76b3e77/banner300.jpg", - "banner400": "https://assets.isthereanydeal.com/018d937f-27ec-71c5-a8a4-21b0b76b3e77/banner400.jpg", - "banner600": "https://assets.isthereanydeal.com/018d937f-27ec-71c5-a8a4-21b0b76b3e77/banner600.png", - "boxart": "https://assets.isthereanydeal.com/018d937f-27ec-71c5-a8a4-21b0b76b3e77/boxart.jpg" - } - } - ] - }, - "resp.lookup.v1.found": { - "value": { - "found": true, - "game": { - "id": "018d937f-07fc-72ed-8517-d8e24cb1eb22", - "slug": "europa-universalis-iv", - "title": "Europa Universalis IV", - "type": "game", - "mature": false, - "assets": { - "boxart": "https://assets.isthereanydeal.com/018d937f-07fc-72ed-8517-d8e24cb1eb22/boxart.jpg?t=1738002003", - "banner145": "https://assets.isthereanydeal.com/018d937f-07fc-72ed-8517-d8e24cb1eb22/banner145.jpg?t=1738002003", - "banner300": "https://assets.isthereanydeal.com/018d937f-07fc-72ed-8517-d8e24cb1eb22/banner300.jpg?t=1738002003", - "banner400": "https://assets.isthereanydeal.com/018d937f-07fc-72ed-8517-d8e24cb1eb22/banner400.jpg?t=1738002003", - "banner600": "https://assets.isthereanydeal.com/018d937f-07fc-72ed-8517-d8e24cb1eb22/banner600.jpg?t=1738002003" - } - } - } - }, - "resp.lookup.v1.not-found": { - "value": { - "found": false - } - }, - "info.v2.found": { - "value": { - "id": "018d937f-07fc-72ed-8517-d8e24cb1eb22", - "slug": "europa-universalis-iv", - "title": "Europa Universalis IV", - "type": "game", - "mature": false, - "assets": { - "boxart": "https://dbxce1spal1df.cloudfront.net/018d937f-07fc-72ed-8517-d8e24cb1eb22/boxart.jpg", - "banner145": "https://dbxce1spal1df.cloudfront.net/018d937f-07fc-72ed-8517-d8e24cb1eb22/banner145.jpg", - "banner300": "https://dbxce1spal1df.cloudfront.net/018d937f-07fc-72ed-8517-d8e24cb1eb22/banner300.jpg", - "banner400": "https://dbxce1spal1df.cloudfront.net/018d937f-07fc-72ed-8517-d8e24cb1eb22/banner400.jpg", - "banner600": "https://dbxce1spal1df.cloudfront.net/018d937f-07fc-72ed-8517-d8e24cb1eb22/banner600.jpg" - }, - "earlyAccess": false, - "achievements": true, - "tradingCards": true, - "appid": 236850, - "tags": [ - "Grand Strategy", - "Strategy", - "Historical", - "Simulation", - "4X" - ], - "releaseDate": "2013-08-13", - "developers": [ - { - "id": 434, - "name": "Paradox Development Studio" - }, - { - "id": 8188, - "name": "Paradox" - }, - { - "id": 8765, - "name": "Paradox Development Studio / Paradox Tinto" - }, - { - "id": 514, - "name": "Paradox Tinto" - } - ], - "publishers": [ - { - "id": 84, - "name": "Paradox Interactive" - }, - { - "id": 16, - "name": "Paradox Interactive AB" - }, - { - "id": 8188, - "name": "Paradox" - } - ], - "reviews": [ - { - "score": 86, - "source": "Steam", - "count": 84184, - "url": "https://store.steampowered.com/app/236850/" - }, - { - "score": 87, - "source": "Metascore", - "count": 31, - "url": "https://metacritic.com/game/europa-universalis-iv/critic-reviews/?platform=pc" - }, - { - "score": 87, - "source": "Metacritic User Score", - "count": 1399, - "url": "https://metacritic.com/game/europa-universalis-iv/user-reviews/?platform=pc" - } - ], - "stats": { - "rank": 529, - "waitlisted": 3368, - "collected": 18718 - }, - "players": { - "recent": 16763, - "day": 16967, - "week": 22451, - "peak": 46940 - }, - "urls": { - "game": "https://isthereanydeal.com/game/europa-universalis-iv/" - } - } - }, - "resp.prices.post.v3.success": { - "value": [ - { - "id": "018d937f-012f-73b8-ab2c-898516969e6a", - "historyLow": { - "all": { - "amount": 0.99, - "amountInt": 99, - "currency": "USD" - }, - "y1": { - "amount": 0.99, - "amountInt": 99, - "currency": "USD" - }, - "m3": { - "amount": 9.99, - "amountInt": 999, - "currency": "USD" - } - }, - "deals": [ - { - "shop": { - "id": 61, - "name": "Steam" - }, - "price": { - "amount": 9.99, - "amountInt": 999, - "currency": "USD" - }, - "regular": { - "amount": 9.99, - "amountInt": 999, - "currency": "USD" - }, - "cut": 0, - "voucher": null, - "storeLow": { - "amount": 0.99, - "amountInt": 99, - "currency": "USD" - }, - "flag": null, - "drm": [], - "platforms": [ - { - "id": 1, - "name": "Windows" - }, - { - "id": 2, - "name": "Mac" - }, - { - "id": 3, - "name": "Linux" - } - ], - "timestamp": "2024-02-11T01:47:46+01:00", - "expiry": null, - "url": "https://next.isthereanydeal.com/link/018d9386-7132-719b-89e1-e11b8c591ee7/" - } - ] - } - ] - }, - "resp.bundles.v2.success": { - "value": [ - { - "id": 11631, - "title": "Rimworld with all Expansions Bundle", - "page": { - "id": 8, - "name": "Fanatical", - "shopId": 6 - }, - "url": "https://www.dpbolvw.net/click-6305441-13212017?url=https%3A%2F%2Fwww.fanatical.com%2Fen%2Fbundle%2Frimworld-with-all-expansions", - "details": "https://isthereanydeal.com/bundles/11631/", - "isMature": false, - "publish": "2024-03-04T19:00:00+01:00", - "expiry": "2024-03-22T00:59:46+01:00", - "note": "* Bundle being relaunched...again and again.", - "counts": { - "games": 4, - "media": 1 - }, - "tiers": [ - { - "price": { - "amount": 87.96, - "amountInt": 8796, - "currency": "USD" - }, - "addon": false, - "games": [ - { - "id": "018d937f-12e9-71ca-a5d5-f31985870694", - "slug": "rimworld", - "title": "RimWorld", - "type": "game", - "mature": false, - "assets": { - "boxart": "https://assets.isthereanydeal.com/018d937f-12e9-71ca-a5d5-f31985870694/boxart.jpg?t=1734155400", - "banner145": "https://assets.isthereanydeal.com/018d937f-12e9-71ca-a5d5-f31985870694/banner145.jpg?t=1734155400", - "banner300": "https://assets.isthereanydeal.com/018d937f-12e9-71ca-a5d5-f31985870694/banner300.jpg?t=1734155400", - "banner400": "https://assets.isthereanydeal.com/018d937f-12e9-71ca-a5d5-f31985870694/banner400.jpg?t=1734155400", - "banner600": "https://assets.isthereanydeal.com/018d937f-12e9-71ca-a5d5-f31985870694/banner600.jpg?t=1734155400" - } - }, - { - "id": "018d937f-3e88-718b-b99d-9a45bb69be55", - "slug": "rimworld-royalty", - "title": "RimWorld - Royalty", - "type": "dlc", - "mature": false, - "assets": { - "boxart": "https://assets.isthereanydeal.com/018d937f-3e88-718b-b99d-9a45bb69be55/boxart.jpg?t=1732764965", - "banner145": "https://assets.isthereanydeal.com/018d937f-3e88-718b-b99d-9a45bb69be55/banner145.jpg?t=1732764965", - "banner300": "https://assets.isthereanydeal.com/018d937f-3e88-718b-b99d-9a45bb69be55/banner300.jpg?t=1732764965", - "banner400": "https://assets.isthereanydeal.com/018d937f-3e88-718b-b99d-9a45bb69be55/banner400.jpg?t=1732764965", - "banner600": "https://assets.isthereanydeal.com/018d937f-3e88-718b-b99d-9a45bb69be55/banner600.jpg?t=1732764966" - } - }, - { - "id": "018d937f-5256-73e1-bba6-66fd3f4d9cd7", - "slug": "rimworld-ideology", - "title": "RimWorld - Ideology", - "type": "dlc", - "mature": false, - "assets": { - "boxart": "https://assets.isthereanydeal.com/018d937f-5256-73e1-bba6-66fd3f4d9cd7/boxart.jpg?t=1732782945", - "banner145": "https://assets.isthereanydeal.com/018d937f-5256-73e1-bba6-66fd3f4d9cd7/banner145.jpg?t=1732782945", - "banner300": "https://assets.isthereanydeal.com/018d937f-5256-73e1-bba6-66fd3f4d9cd7/banner300.jpg?t=1732782945", - "banner400": "https://assets.isthereanydeal.com/018d937f-5256-73e1-bba6-66fd3f4d9cd7/banner400.jpg?t=1732782945", - "banner600": "https://assets.isthereanydeal.com/018d937f-5256-73e1-bba6-66fd3f4d9cd7/banner600.jpg?t=1732782945" - } - }, - { - "id": "018d937f-65f0-70d3-83fe-71fac1505a13", - "slug": "rimworld-biotech", - "title": "RimWorld - Biotech", - "type": "dlc", - "mature": false, - "assets": { - "boxart": "https://assets.isthereanydeal.com/018d937f-65f0-70d3-83fe-71fac1505a13/boxart.jpg?t=1732751175", - "banner145": "https://assets.isthereanydeal.com/018d937f-65f0-70d3-83fe-71fac1505a13/banner145.jpg?t=1732751175", - "banner300": "https://assets.isthereanydeal.com/018d937f-65f0-70d3-83fe-71fac1505a13/banner300.jpg?t=1732751175", - "banner400": "https://assets.isthereanydeal.com/018d937f-65f0-70d3-83fe-71fac1505a13/banner400.jpg?t=1732751175", - "banner600": "https://assets.isthereanydeal.com/018d937f-65f0-70d3-83fe-71fac1505a13/banner600.jpg?t=1732751176" - } - } - ] - } - ] - } - ] - }, - "resp.overview.v2.success": { - "value": { - "prices": [ - { - "id": "018d937f-12e9-71ca-a5d5-f31985870694", - "current": { - "shop": { - "id": 61, - "name": "Steam" - }, - "price": { - "amount": 31.99, - "amountInt": 3199, - "currency": "EUR" - }, - "regular": { - "amount": 31.99, - "amountInt": 3199, - "currency": "EUR" - }, - "cut": 0, - "voucher": null, - "flag": null, - "drm": [], - "platforms": [ - { - "id": 1, - "name": "Windows" - }, - { - "id": 2, - "name": "Mac" - }, - { - "id": 3, - "name": "Linux" - } - ], - "timestamp": "2025-02-06T19:21:30+01:00", - "expiry": null, - "url": "https://itad.link/018d9386-b9c8-71ea-8724-47f829db21bd/" - }, - "lowest": { - "shop": { - "id": 6, - "name": "Fanatical" - }, - "price": { - "amount": 22.07, - "amountInt": 2207, - "currency": "EUR" - }, - "regular": { - "amount": 31.99, - "amountInt": 3199, - "currency": "EUR" - }, - "cut": 31, - "timestamp": "2024-07-01T17:15:49+02:00" - }, - "bundled": 1, - "urls": { - "game": "https://isthereanydeal.com/game/id:018d937f-12e9-71ca-a5d5-f31985870694/" - } - }, - { - "id": "018d937f-6ee4-73f5-858c-2fde3407462f", - "current": { - "shop": { - "id": 67, - "name": "eTail.Market" - }, - "price": { - "amount": 34.19, - "amountInt": 3419, - "currency": "EUR" - }, - "regular": { - "amount": 39.99, - "amountInt": 3999, - "currency": "EUR" - }, - "cut": 15, - "voucher": null, - "flag": null, - "drm": [ - { - "id": 61, - "name": "Steam" - } - ], - "platforms": [], - "timestamp": "2025-02-24T05:11:43+01:00", - "expiry": null, - "url": "https://itad.link/018dbf61-5f64-7073-a201-d4d25151bfb0/" - }, - "lowest": { - "shop": { - "id": 67, - "name": "eTail.Market" - }, - "price": { - "amount": 26.48, - "amountInt": 2648, - "currency": "EUR" - }, - "regular": { - "amount": 39.99, - "amountInt": 3999, - "currency": "EUR" - }, - "cut": 34, - "timestamp": "2024-12-13T12:31:59+01:00" - }, - "bundled": 0, - "urls": { - "game": "https://isthereanydeal.com/game/id:018d937f-6ee4-73f5-858c-2fde3407462f/" - } - } - ], - "bundles": [ - { - "id": 11631, - "title": "Rimworld with all Expansions Bundle", - "page": { - "id": 8, - "name": "Fanatical", - "shopId": 6 - }, - "url": "https://www.dpbolvw.net/click-6305441-13212017?url=https%3A%2F%2Fwww.fanatical.com%2Fen%2Fbundle%2Frimworld-with-all-expansions", - "details": "https://isthereanydeal.com/bundles/11631/", - "isMature": false, - "publish": "2024-03-04T19:00:00+01:00", - "expiry": "2024-03-22T00:59:46+01:00", - "note": null, - "counts": { - "games": 4, - "media": 1 - }, - "tiers": [ - { - "price": { - "amount": 87.96, - "amountInt": 8796, - "currency": "USD" - }, - "addon": false, - "games": [ - { - "id": "018d937f-12e9-71ca-a5d5-f31985870694", - "slug": "rimworld", - "title": "RimWorld", - "type": "game", - "mature": false, - "assets": { - "boxart": "https://assets.isthereanydeal.com/018d937f-12e9-71ca-a5d5-f31985870694/boxart.jpg?t=1734155400", - "banner145": "https://assets.isthereanydeal.com/018d937f-12e9-71ca-a5d5-f31985870694/banner145.jpg?t=1734155400", - "banner300": "https://assets.isthereanydeal.com/018d937f-12e9-71ca-a5d5-f31985870694/banner300.jpg?t=1734155400", - "banner400": "https://assets.isthereanydeal.com/018d937f-12e9-71ca-a5d5-f31985870694/banner400.jpg?t=1734155400", - "banner600": "https://assets.isthereanydeal.com/018d937f-12e9-71ca-a5d5-f31985870694/banner600.jpg?t=1734155400" - } - }, - { - "id": "018d937f-3e88-718b-b99d-9a45bb69be55", - "slug": "rimworld-royalty", - "title": "RimWorld - Royalty", - "type": "dlc", - "mature": false, - "assets": { - "boxart": "https://assets.isthereanydeal.com/018d937f-3e88-718b-b99d-9a45bb69be55/boxart.jpg?t=1732764965", - "banner145": "https://assets.isthereanydeal.com/018d937f-3e88-718b-b99d-9a45bb69be55/banner145.jpg?t=1732764965", - "banner300": "https://assets.isthereanydeal.com/018d937f-3e88-718b-b99d-9a45bb69be55/banner300.jpg?t=1732764965", - "banner400": "https://assets.isthereanydeal.com/018d937f-3e88-718b-b99d-9a45bb69be55/banner400.jpg?t=1732764965", - "banner600": "https://assets.isthereanydeal.com/018d937f-3e88-718b-b99d-9a45bb69be55/banner600.jpg?t=1732764966" - } - }, - { - "id": "018d937f-5256-73e1-bba6-66fd3f4d9cd7", - "slug": "rimworld-ideology", - "title": "RimWorld - Ideology", - "type": "dlc", - "mature": false, - "assets": { - "boxart": "https://assets.isthereanydeal.com/018d937f-5256-73e1-bba6-66fd3f4d9cd7/boxart.jpg?t=1732782945", - "banner145": "https://assets.isthereanydeal.com/018d937f-5256-73e1-bba6-66fd3f4d9cd7/banner145.jpg?t=1732782945", - "banner300": "https://assets.isthereanydeal.com/018d937f-5256-73e1-bba6-66fd3f4d9cd7/banner300.jpg?t=1732782945", - "banner400": "https://assets.isthereanydeal.com/018d937f-5256-73e1-bba6-66fd3f4d9cd7/banner400.jpg?t=1732782945", - "banner600": "https://assets.isthereanydeal.com/018d937f-5256-73e1-bba6-66fd3f4d9cd7/banner600.jpg?t=1732782945" - } - }, - { - "id": "018d937f-65f0-70d3-83fe-71fac1505a13", - "slug": "rimworld-biotech", - "title": "RimWorld - Biotech", - "type": "dlc", - "mature": false, - "assets": { - "boxart": "https://assets.isthereanydeal.com/018d937f-65f0-70d3-83fe-71fac1505a13/boxart.jpg?t=1732751175", - "banner145": "https://assets.isthereanydeal.com/018d937f-65f0-70d3-83fe-71fac1505a13/banner145.jpg?t=1732751175", - "banner300": "https://assets.isthereanydeal.com/018d937f-65f0-70d3-83fe-71fac1505a13/banner300.jpg?t=1732751175", - "banner400": "https://assets.isthereanydeal.com/018d937f-65f0-70d3-83fe-71fac1505a13/banner400.jpg?t=1732751175", - "banner600": "https://assets.isthereanydeal.com/018d937f-65f0-70d3-83fe-71fac1505a13/banner600.jpg?t=1732751176" - } - } - ] - } - ] - } - ] - } - }, - "historylow.v1.success": { - "value": [ - { - "id": "01849782-1017-7389-8de4-c97c587fd7e3", - "low": { - "shop": { - "id": 47, - "name": "MacGameStore" - }, - "price": { - "amount": 3.99, - "amountInt": 399, - "currency": "USD" - }, - "regular": { - "amount": 21.99, - "amountInt": 2199, - "currency": "USD" - }, - "cut": 82, - "timestamp": "2022-11-27T21:33:36+01:00" - } - }, - { - "id": "01849783-6a26-7147-ab32-71804ca47e8e", - "low": { - "shop": { - "id": 47, - "name": "MacGameStore" - }, - "price": { - "amount": 5.99, - "amountInt": 599, - "currency": "USD" - }, - "regular": { - "amount": 39.99, - "amountInt": 3999, - "currency": "USD" - }, - "cut": 85, - "timestamp": "2022-12-23T03:22:14+01:00" - } - } - ] - }, - "storelow.v2.success": { - "value": [ - { - "id": "01849782-1017-7389-8de4-c97c587fd7e3", - "lows": [ - { - "shop": { - "id": 13, - "name": "DLGamer" - }, - "price": { - "amount": 6.6, - "amountInt": 660, - "currency": "USD" - }, - "regular": { - "amount": 21.99, - "amountInt": 2199, - "currency": "USD" - }, - "cut": 70, - "timestamp": "2022-11-29T02:14:37+01:00" - }, - { - "shop": { - "id": 61, - "name": "Steam" - }, - "price": { - "amount": 6.59, - "amountInt": 659, - "currency": "USD" - }, - "regular": { - "amount": 21.99, - "amountInt": 2199, - "currency": "USD" - }, - "cut": 70, - "timestamp": "2022-12-21T00:29:04+01:00" - } - ] - }, - { - "id": "01849783-6a26-7147-ab32-71804ca47e8e", - "lows": [ - { - "shop": { - "id": 13, - "name": "DLGamer" - }, - "price": { - "amount": 10, - "amountInt": 1000, - "currency": "USD" - }, - "regular": { - "amount": 39.99, - "amountInt": 3999, - "currency": "USD" - }, - "cut": 75, - "timestamp": "2022-11-29T02:14:36+01:00" - }, - { - "shop": { - "id": 61, - "name": "Steam" - }, - "price": { - "amount": 39.99, - "amountInt": 3999, - "currency": "USD" - }, - "regular": { - "amount": 39.99, - "amountInt": 3999, - "currency": "USD" - }, - "cut": 0, - "timestamp": "2022-12-14T00:28:40+01:00" - } - ] - } - ] - }, - "history.v2.success": { - "value": [ - { - "timestamp": "2022-12-27T11:21:08+01:00", - "shop": { - "id": 61, - "name": "Steam" - }, - "deal": { - "price": { - "amount": 9.99, - "amountInt": 999, - "currency": "EUR" - }, - "regular": { - "amount": 39.99, - "amountInt": 3999, - "currency": "EUR" - }, - "cut": 75 - } - }, - { - "timestamp": "2022-12-14T00:12:29+01:00", - "shop": { - "id": 61, - "name": "Steam" - }, - "deal": { - "price": { - "amount": 39.99, - "amountInt": 3999, - "currency": "EUR" - }, - "regular": { - "amount": 39.99, - "amountInt": 3999, - "currency": "EUR" - }, - "cut": 0 - } - } - ] - }, - "resp.games.subs.v1.success": { - "value": [ - { - "id": "018d937f-24b7-731c-a789-8307ae059efa", - "subs": [ - { - "id": 1, - "name": "Prime Gaming", - "leaving": "2025-02-26T18:00:00+00:00" - } - ] - }, - { - "id": "018d937f-700e-7161-9c8d-5423af1b7c99", - "subs": [ - { - "id": 6, - "name": "Game Pass", - "leaving": null - } - ] - } - ] - }, - "resp.deals.get.v2.success": { - "value": { - "nextOffset": 3, - "hasMore": true, - "list": [ - { - "id": "018d937e-e9ce-718b-9715-111f50820ed4", - "slug": "lego-marvels-avengers-season-pass", - "title": "LEGO Marvel's Avengers Season Pass", - "type": "dlc", - "mature": false, - "assets": { - "boxart": "https://assets.isthereanydeal.com/018d937e-e9ce-718b-9715-111f50820ed4/boxart.jpg?t=1732868120", - "banner145": "https://assets.isthereanydeal.com/018d937e-e9ce-718b-9715-111f50820ed4/banner145.jpg?t=1732868120", - "banner300": "https://assets.isthereanydeal.com/018d937e-e9ce-718b-9715-111f50820ed4/banner300.jpg?t=1732868120", - "banner400": "https://assets.isthereanydeal.com/018d937e-e9ce-718b-9715-111f50820ed4/banner400.jpg?t=1732868120", - "banner600": "https://assets.isthereanydeal.com/018d937e-e9ce-718b-9715-111f50820ed4/banner600.jpg?t=1732868121" - }, - "deal": { - "shop": { - "id": 50, - "name": "Nuuvem" - }, - "price": { - "amount": 1.49, - "amountInt": 149, - "currency": "BRL" - }, - "regular": { - "amount": 29.9, - "amountInt": 2990, - "currency": "BRL" - }, - "cut": 95, - "voucher": null, - "storeLow": { - "amount": 1.49, - "amountInt": 149, - "currency": "BRL" - }, - "historyLow": { - "amount": 1.49, - "amountInt": 149, - "currency": "BRL" - }, - "historyLow_1y": { - "amount": 1.49, - "amountInt": 149, - "currency": "BRL" - }, - "historyLow_3m": { - "amount": 1.49, - "amountInt": 149, - "currency": "BRL" - }, - "flag": "H", - "drm": [ - { - "id": 61, - "name": "Steam" - } - ], - "platforms": [ - { - "id": 1, - "name": "Windows" - } - ], - "timestamp": "2024-10-01T15:25:52+02:00", - "expiry": "2024-11-01T03:59:59+01:00", - "url": "https://itad.link/018d9386-8be1-7319-8ecc-ab31d44c64d8/" - } - }, - { - "id": "018d937e-e9ec-7103-97a0-732d4301eb72", - "slug": "shift-quantum", - "title": "Shift Quantum", - "type": "game", - "mature": false, - "assets": { - "boxart": "https://assets.isthereanydeal.com/018d937e-e9ec-7103-97a0-732d4301eb72/boxart.jpg", - "banner145": "https://assets.isthereanydeal.com/018d937e-e9ec-7103-97a0-732d4301eb72/banner145.jpg", - "banner300": "https://assets.isthereanydeal.com/018d937e-e9ec-7103-97a0-732d4301eb72/banner300.jpg", - "banner400": "https://assets.isthereanydeal.com/018d937e-e9ec-7103-97a0-732d4301eb72/banner400.jpg", - "banner600": "https://assets.isthereanydeal.com/018d937e-e9ec-7103-97a0-732d4301eb72/banner600.jpg" - }, - "deal": { - "shop": { - "id": 50, - "name": "Nuuvem" - }, - "price": { - "amount": 11.4, - "amountInt": 1140, - "currency": "BRL" - }, - "regular": { - "amount": 37.99, - "amountInt": 3799, - "currency": "BRL" - }, - "cut": 70, - "voucher": null, - "storeLow": { - "amount": 9.49, - "amountInt": 949, - "currency": "BRL" - }, - "historyLow": { - "amount": 7.59, - "amountInt": 759, - "currency": "BRL" - }, - "historyLow_1y": { - "amount": 9.49, - "amountInt": 949, - "currency": "BRL" - }, - "historyLow_3m": { - "amount": 9.49, - "amountInt": 949, - "currency": "BRL" - }, - "flag": null, - "drm": [ - { - "id": 61, - "name": "Steam" - } - ], - "platforms": [ - { - "id": 1, - "name": "Windows" - } - ], - "timestamp": "2024-12-05T04:26:01+01:00", - "expiry": "2024-12-19T03:59:59+01:00", - "url": "https://itad.link/018d9386-c580-739b-bac6-06f2a7eb5d61/" - } - }, - { - "id": "018d937e-f7f5-70ea-a1dd-e1901a199f3d", - "slug": "grand-theft-auto-v-cesp-and-great-white-shark-card-bundle", - "title": "Grand Theft Auto V - CESP + Great White Shark Card Bundle", - "type": null, - "mature": false, - "assets": { - "boxart": "https://assets.isthereanydeal.com/018d937e-f7f5-70ea-a1dd-e1901a199f3d/boxart.jpg", - "banner145": "https://assets.isthereanydeal.com/018d937e-f7f5-70ea-a1dd-e1901a199f3d/banner145.jpg", - "banner300": "https://assets.isthereanydeal.com/018d937e-f7f5-70ea-a1dd-e1901a199f3d/banner300.jpg", - "banner400": "https://assets.isthereanydeal.com/018d937e-f7f5-70ea-a1dd-e1901a199f3d/banner400.jpg" - }, - "deal": { - "shop": { - "id": 50, - "name": "Nuuvem" - }, - "price": { - "amount": 49.23, - "amountInt": 4923, - "currency": "BRL" - }, - "regular": { - "amount": 109.41, - "amountInt": 10941, - "currency": "BRL" - }, - "cut": 55, - "voucher": null, - "storeLow": { - "amount": 38.39, - "amountInt": 3839, - "currency": "BRL" - }, - "historyLow": { - "amount": 38.39, - "amountInt": 3839, - "currency": "BRL" - }, - "historyLow_1y": { - "amount": 49.23, - "amountInt": 4923, - "currency": "BRL" - }, - "historyLow_3m": { - "amount": 49.23, - "amountInt": 4923, - "currency": "BRL" - }, - "flag": null, - "drm": [ - { - "id": 61, - "name": "Steam" - } - ], - "platforms": [ - { - "id": 1, - "name": "Windows" - } - ], - "timestamp": "2024-12-10T05:15:41+01:00", - "expiry": "2024-12-14T03:29:00+01:00", - "url": "https://itad.link/018d9386-6e38-705c-9b92-958ee5e10f77/" - } - } - ] - } - }, - "resp.games.get.v1.success": { - "value": [ - { - "id": "018d937e-e9e5-72fa-a1dc-e7e090b64d2f", - "slug": "dwarven-skykeep", - "title": "Dwarven Skykeep", - "type": "game", - "assets": { - "boxart": "https://cdn.example.com//018d937e-e9e5-72fa-a1dc-e7e090b64d2f/boxart.jpg", - "banner145": "https://cdn.example.com//018d937e-e9e5-72fa-a1dc-e7e090b64d2f/banner145.jpg", - "banner300": "https://cdn.example.com//018d937e-e9e5-72fa-a1dc-e7e090b64d2f/banner300.jpg", - "banner400": "https://cdn.example.com//018d937e-e9e5-72fa-a1dc-e7e090b64d2f/banner400.jpg", - "banner600": "https://cdn.example.com//018d937e-e9e5-72fa-a1dc-e7e090b64d2f/banner600.jpg" - }, - "mature": false, - "added": "2023-02-01T21:04:21+01:00" - }, - { - "id": "018d937e-e9f4-71bb-9413-3b25175df416", - "slug": "orcish-inn", - "title": "Orcish Inn", - "type": "game", - "assets": { - "boxart": "https://cdn.example.com//018d937e-e9f4-71bb-9413-3b25175df416/boxart.jpg", - "banner145": "https://cdn.example.com//018d937e-e9f4-71bb-9413-3b25175df416/banner145.jpg", - "banner300": "https://cdn.example.com//018d937e-e9f4-71bb-9413-3b25175df416/banner300.jpg", - "banner400": "https://cdn.example.com//018d937e-e9f4-71bb-9413-3b25175df416/banner400.jpg", - "banner600": "https://cdn.example.com//018d937e-e9f4-71bb-9413-3b25175df416/banner600.jpg" - }, - "mature": false, - "added": "2023-02-01T21:04:21+01:00" - }, - { - "id": "018d937e-e9f9-734c-8413-5a447e993a8c", - "slug": "take-on-mars", - "title": "Take On Mars", - "type": "game", - "assets": {}, - "mature": false, - "added": "2019-01-13T02:41:06+01:00" - }, - { - "id": "018d937e-ea40-7125-bab3-feb2fba446a1", - "slug": "surviving-mars", - "title": "Surviving Mars", - "type": "game", - "assets": { - "boxart": "https://cdn.example.com//018d937e-ea40-7125-bab3-feb2fba446a1/boxart.jpg", - "banner145": "https://cdn.example.com//018d937e-ea40-7125-bab3-feb2fba446a1/banner145.jpg", - "banner300": "https://cdn.example.com//018d937e-ea40-7125-bab3-feb2fba446a1/banner300.jpg", - "banner400": "https://cdn.example.com//018d937e-ea40-7125-bab3-feb2fba446a1/banner400.jpg", - "banner600": "https://cdn.example.com//018d937e-ea40-7125-bab3-feb2fba446a1/banner600.jpg" - }, - "mature": false, - "added": "2019-01-13T02:41:06+01:00" - } - ] - }, - "resp.games.get.v1.success-2": { - "value": [ - { - "id": "018d937f-20d1-7349-9963-b278a98f2fb0", - "slug": "abyss-odyssey", - "title": "Abyss Odyssey", - "type": "game", - "assets": {}, - "mature": false, - "group": 0, - "added": "2015-10-02T03:00:04+02:00" - }, - { - "id": "018d937f-11d2-70c4-9b73-0a6cf40fe771", - "slug": "abzu", - "title": "ABZU", - "type": "game", - "assets": { - "boxart": "https://cdn.example.com/018d937f-11d2-70c4-9b73-0a6cf40fe771/boxart.jpg", - "banner145": "https://cdn.example.com/018d937f-11d2-70c4-9b73-0a6cf40fe771/banner145.jpg", - "banner300": "https://cdn.example.com/018d937f-11d2-70c4-9b73-0a6cf40fe771/banner300.jpg", - "banner400": "https://cdn.example.com/018d937f-11d2-70c4-9b73-0a6cf40fe771/banner400.jpg", - "banner600": "https://cdn.example.com/018d937f-11d2-70c4-9b73-0a6cf40fe771/banner600.jpg" - }, - "mature": false, - "group": 38437, - "added": "2015-10-02T03:00:04+02:00" - } - ] - }, - "resp.copies.get.v1": { - "value": [ - { - "id": 145742693, - "game": { - "id": "018d937e-e9ab-70f4-bd05-1db7a138eb39" - }, - "shop": { - "id": 61, - "name": "Steam" - }, - "redeemed": true, - "price": { - "amount": 15, - "amountInt": 1500, - "currency": "EUR" - }, - "note": "My note for this copy", - "tags": [ - { - "id": 21, - "tag": "tag 1" - }, - { - "id": 22, - "tag": "tag 2" - } - ], - "added": "2024-02-16T21:16:17+01:00" - }, - { - "id": 9128925, - "game": { - "id": "018d937e-e9ac-7156-83a6-7d27fd9f857a" - }, - "shop": null, - "redeemed": true, - "price": null, - "note": null, - "tags": [], - "added": "2015-10-02T03:00:04+02:00" - } - ] - }, - "resp.groups.get.v1.success": { - "value": [ - { - "id": 3857, - "title": "Favorites", - "public": true - }, - { - "id": 5662, - "title": "Playing now", - "public": true - }, - { - "id": 5663, - "title": "Not yet played", - "public": true - }, - { - "id": 0, - "title": "Default Category", - "public": false - } - ] - }, - "resp.groups.post.v1.success": { - "value": { - "id": 5669, - "title": "New Collection Category", - "public": true - } - }, - "resp.notifications.get.v1": { - "value": [ - { - "id": "01921bab-b582-73bc-8473-9f125837107b", - "type": "waitlist", - "title": "Stardew Valley and 3 more games", - "timestamp": "2024-09-24T02:43:04+02:00", - "read": "2024-10-06T16:06:47+02:00" - }, - { - "id": "019216c1-0c76-7373-98f0-a1790c6e65f7", - "type": "waitlist", - "title": "Potion Permit and 42 more games", - "timestamp": "2024-09-24T02:43:04+02:00", - "read": "2024-10-06T16:06:47+02:00" - }, - { - "id": "019216c1-0c74-704e-b590-cce7a5fc8ec6", - "type": "waitlist", - "title": "Dwarven Skykeep and 74 more games", - "timestamp": "2024-09-24T02:43:04+02:00", - "read": "2024-10-06T16:06:47+02:00" - } - ] - }, - "resp.notifications.waitlist.get.v1": { - "value": { - "id": "01921bab-b582-73bc-8473-9f125837107b", - "timestamp": "2024-09-24T02:43:04+02:00", - "read": "2024-10-06T16:06:47+02:00", - "games": [ - { - "id": "018d937e-f835-710c-b95b-928e277b187e", - "slug": "stardew-valley", - "title": "Stardew Valley", - "type": "game", - "mature": false, - "historyLow": { - "amount": 6.99, - "amountInt": 699, - "currency": "EUR" - }, - "lastPrice": { - "amount": 13.99, - "amountInt": 1399, - "currency": "EUR" - }, - "deals": [ - { - "shop": { - "id": 35, - "name": "GOG" - }, - "price": { - "amount": 13.99, - "amountInt": 1399, - "currency": "EUR" - }, - "regular": { - "amount": 13.99, - "amountInt": 1399, - "currency": "EUR" - }, - "cut": 0, - "voucher": null, - "storeLow": { - "amount": 7, - "amountInt": 700, - "currency": "EUR" - }, - "flag": null, - "drm": [ - { - "id": 1000, - "name": "Drm Free" - } - ], - "platforms": [ - { - "id": 1, - "name": "Windows" - }, - { - "id": 2, - "name": "Mac" - }, - { - "id": 3, - "name": "Linux" - } - ], - "timestamp": "2024-02-11T01:20:50+01:00", - "expiry": null, - "url": "https://itad.link/018d9386-d141-7169-a0af-3349dedb00d2/" - } - ] - } - ] - } - }, - "shops.v1.success": { - "value": [ - { - "id": 19, - "title": "2game", - "deals": 3170, - "games": 3785, - "update": "2023-06-06T21:51:13+02:00" - }, - { - "id": 2, - "title": "AllYouPlay", - "deals": 435, - "games": 4926, - "update": "2023-06-06T22:10:25+02:00" - }, - { - "id": 3, - "title": "Amazon", - "deals": 0, - "games": 0, - "update": null - } - ] - }, - "shops.map.v1.success": { - "value": [ - { - "id": 19, - "title": "2game" - }, - { - "id": 2, - "title": "AllYouPlay" - }, - { - "id": 3, - "title": "Amazon" - } - ] - }, - "resp.games.list.v1.success": { - "value": [ - { - "id": "018d937f-0680-71f6-a2c0-30660ed59d79", - "title": "Eternal Lore", - "appid": 601790 - }, - { - "id": "018d937f-0681-7345-8d53-d0b6170cf842", - "title": "Zooloretto", - "appid": null - } - ] - }, - "resp.games.dots.v1.success": { - "value": [ - { - "id": 7574, - "product_id": "018dbf3c-8009-7199-b27d-eca502aa0192", - "old_game_id": "018dbf3c-80f9-73d2-aa30-b39b52a6c7f7", - "new_game_id": "018d937f-51cf-71a2-8359-bde441247ae1", - "timestamp": 1777055407, - "date": "Fri, 24 Apr 2026 18:30:07 +0000" - }, - { - "id": 7573, - "product_id": "018d9578-ed32-7201-b1eb-586ccf9d3de6", - "old_game_id": "018d937f-7466-727c-8331-8f9c8e239e9e", - "new_game_id": "018d937f-15f9-7056-8edf-2e8fa4b8f357", - "timestamp": 1777055393, - "date": "Fri, 24 Apr 2026 18:29:53 +0000" - } - ] - }, - "event.notification-waitlist": { - "value": [ - { - "id": "018d937e-f835-710c-b95b-928e277b187e", - "slug": "stardew-valley", - "title": "Stardew Valley", - "type": "game", - "mature": false, - "historyLow": { - "amount": 6.99, - "amountInt": 699, - "currency": "EUR" - }, - "lastPrice": { - "amount": 13.99, - "amountInt": 1399, - "currency": "EUR" - }, - "deals": [ - { - "shop": { - "id": 35, - "name": "GOG" - }, - "price": { - "amount": 13.99, - "amountInt": 1399, - "currency": "EUR" - }, - "regular": { - "amount": 13.99, - "amountInt": 1399, - "currency": "EUR" - }, - "cut": 0, - "voucher": null, - "storeLow": { - "amount": 7, - "amountInt": 700, - "currency": "EUR" - }, - "flag": null, - "drm": [ - { - "id": 1000, - "name": "Drm Free" - } - ], - "platforms": [ - { - "id": 1, - "name": "Windows" - }, - { - "id": 2, - "name": "Mac" - }, - { - "id": 3, - "name": "Linux" - } - ], - "timestamp": "2024-02-11T01:20:50+01:00", - "expiry": null, - "url": "https://itad.link/018d9386-d141-7169-a0af-3349dedb00d2/" - } - ] - } - ] - } - } - }, - "paths": { - "/lookup/id/title/v1": { - "post": { - "operationId": "lookup-gid-title-v1", - "tags": [ - "Lookup" - ], - "summary": "Lookup ITAD game IDs by title", - "description": "Lookup IsThereAnyDeal's game IDs by title\nThis is not a full fledged search. Some title preprocessing will happen, but the lookup will only return IDs for titles, that match precisely.\nTypos or variations in title may not give you expected result.", - "security": [ - {}, - { - "ApiKeyParamAuth": [] - }, - { - "ApiKeyHeaderAuth": [] - } - ], - "requestBody": { - "description": "List of titles", - "content": { - "application/json": { - "schema": { - "type": "array", - "minItems": 1, - "items": { - "type": "string" - } - }, - "example": [ - "Baldurs Gate 3", - "Half-Life 2", - "Unknown game" - ] - } - } - }, - "responses": { - "200": { - "description": "Success response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.lookup.gid-by-title" - }, - "examples": { - "success": { - "$ref": "#/components/examples/resp.gid-by-title.post.v1.success" - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/lookup/id/shop/{shopId}/v1": { - "post": { - "operationId": "lookup-gid-shopid-v1", - "tags": [ - "Lookup" - ], - "summary": "Lookup ITAD game IDs by IDs on shop", - "description": "Lookup IsThereAnyDeal's game IDs by shop's game IDs", - "security": [ - {}, - { - "ApiKeyParamAuth": [] - }, - { - "ApiKeyHeaderAuth": [] - } - ], - "parameters": [ - { - "name": "shopId", - "in": "path", - "required": true, - "schema": { - "type": "number" - } - } - ], - "requestBody": { - "description": "List of shop's game IDs", - "content": { - "application/json": { - "schema": { - "type": "array", - "minItems": 1, - "items": { - "type": "string" - } - }, - "example": [ - "app/220" - ] - } - } - }, - "responses": { - "200": { - "description": "Success response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.lookup.gid-by-shopid" - }, - "examples": { - "success": { - "$ref": "#/components/examples/resp.gid-by-shopid.post.v1.success" - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/lookup/shop/{shopId}/id/v1": { - "post": { - "operationId": "lookup-shopid-gid-v1", - "tags": [ - "Lookup" - ], - "summary": "Lookup game IDs on shop by ITAD game IDs", - "description": "Lookup shop's game IDs by IsThereAnyDeal game IDs", - "security": [ - {}, - { - "ApiKeyParamAuth": [] - }, - { - "ApiKeyHeaderAuth": [] - } - ], - "parameters": [ - { - "name": "shopId", - "in": "path", - "required": true, - "schema": { - "type": "number" - } - } - ], - "requestBody": { - "description": "List of game IDs", - "content": { - "application/json": { - "schema": { - "type": "array", - "minItems": 1, - "items": { - "type": "string", - "format": "uuid" - } - } - } - } - }, - "responses": { - "200": { - "description": "Success response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.lookup.shopid-by-gid" - }, - "examples": { - "success": { - "$ref": "#/components/examples/resp.shopid-by-gid.post.v1.success" - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/bundles/v1": { - "get": { - "operationId": "bundles-v1", - "tags": [ - "Bundles" - ], - "summary": "Bundle List", - "description": "Get bundles", - "security": [ - { - "ApiKeyParamAuth": [] - }, - { - "ApiKeyHeaderAuth": [] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/country" - }, - { - "name": "offset", - "in": "query", - "schema": { - "type": "number", - "minimum": 0, - "default": 0 - } - }, - { - "name": "limit", - "in": "query", - "schema": { - "type": "number", - "minimum": 1, - "maximum": 50, - "default": 20 - } - }, - { - "name": "mature", - "in": "query", - "description": "Include bundles marked as mature", - "schema": { - "type": "boolean", - "default": false - } - }, - { - "name": "expired", - "in": "query", - "description": "Include expired bundles", - "schema": { - "type": "boolean", - "default": false - } - }, - { - "name": "sort", - "in": "query", - "description": "Sort value, same as on website", - "schema": { - "type": "string", - "default": "-publish" - } - } - ], - "responses": { - "200": { - "description": "Success response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.bundles" - }, - "examples": { - "success": { - "$ref": "#/components/examples/resp.bundles.v1.success" - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/giveaways/v1": { - "get": { - "operationId": "giveaways-v1", - "tags": [ - "Giveaways" - ], - "summary": "Giveaways List", - "description": "Get giveaways", - "security": [ - { - "ApiKeyParamAuth": [] - }, - { - "ApiKeyHeaderAuth": [] - } - ], - "parameters": [ - { - "name": "offset", - "in": "query", - "schema": { - "type": "number", - "minimum": 0, - "default": 0 - } - }, - { - "name": "limit", - "in": "query", - "schema": { - "type": "number", - "minimum": 1, - "maximum": 50, - "default": 20 - } - }, - { - "name": "mature", - "in": "query", - "description": "Include bundles marked as mature", - "schema": { - "type": "boolean", - "default": false - } - }, - { - "name": "expired", - "in": "query", - "description": "Include expired bundles", - "schema": { - "type": "boolean", - "default": false - } - }, - { - "name": "sort", - "in": "query", - "description": "Sort value, same as on website", - "schema": { - "type": "string", - "default": "-publish" - } - } - ], - "responses": { - "200": { - "description": "Success response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.giveaways" - }, - "examples": { - "success": { - "$ref": "#/components/examples/resp.giveaways.v1.success" - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/games/search/v1": { - "get": { - "operationId": "games-search-v1", - "tags": [ - "Game", - "Lookup" - ], - "summary": "Search", - "description": "Search for games by title", - "security": [ - { - "ApiKeyParamAuth": [] - }, - { - "ApiKeyHeaderAuth": [] - } - ], - "parameters": [ - { - "name": "title", - "in": "query", - "description": "Find games by name", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "results", - "in": "query", - "description": "Maximum number of results to return", - "schema": { - "type": "number", - "minimum": 1, - "maximum": 100, - "default": 20 - } - } - ], - "responses": { - "200": { - "description": "Search response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.games.search" - }, - "examples": { - "results": { - "description": "Europa Universalis IV search", - "$ref": "#/components/examples/resp.search.v1.results" - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/games/lookup/v1": { - "get": { - "operationId": "games-lookup-v1", - "tags": [ - "Game", - "Lookup" - ], - "summary": "Lookup Game", - "description": "Lookup game based on title or Steam appid", - "security": [ - { - "ApiKeyParamAuth": [] - }, - { - "ApiKeyHeaderAuth": [] - } - ], - "parameters": [ - { - "name": "title", - "in": "query", - "description": "Find game by it's name", - "schema": { - "type": "string" - } - }, - { - "name": "appid", - "in": "query", - "description": "Find game by Steam appid", - "schema": { - "type": "number" - } - } - ], - "responses": { - "200": { - "description": "Lookup response with found game", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.games.lookup" - }, - "examples": { - "found": { - "description": "Game found", - "$ref": "#/components/examples/resp.lookup.v1.found" - }, - "not-found": { - "description": "Game not found", - "$ref": "#/components/examples/resp.lookup.v1.not-found" - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/games/info/v2": { - "get": { - "operationId": "games-info-v2", - "tags": [ - "Game" - ], - "summary": "Game Info", - "description": "Get basic game information", - "security": [ - { - "ApiKeyParamAuth": [] - }, - { - "ApiKeyHeaderAuth": [] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/gid" - } - ], - "responses": { - "200": { - "description": "Info response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.games.info" - }, - "examples": { - "found": { - "description": "Europa Universalis IV info", - "$ref": "#/components/examples/info.v2.found" - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "404": { - "$ref": "#/components/responses/error-response", - "description": "Game not found" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/games/prices/v3": { - "post": { - "operationId": "games-prices-v3", - "tags": [ - "Prices" - ], - "summary": "Prices", - "description": "Get games' prices", - "security": [ - { - "ApiKeyParamAuth": [] - }, - { - "ApiKeyHeaderAuth": [] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/country" - }, - { - "name": "deals", - "in": "query", - "description": "Only load deals, omit prices that have no price cut", - "schema": { - "type": "boolean" - } - }, - { - "name": "vouchers", - "in": "query", - "description": "Allow vouchers in prices", - "schema": { - "type": "boolean" - } - }, - { - "name": "capacity", - "in": "query", - "description": "How many prices to load per each game, 0 or omit for no limit", - "schema": { - "type": "integer", - "minimum": 0 - } - }, - { - "$ref": "#/components/parameters/shops", - "description": "List of shop IDs for which you want to load prices" - } - ], - "requestBody": { - "description": "List of Game IDs for which to load prices", - "$ref": "#/components/requestBodies/gids-200" - }, - "responses": { - "200": { - "description": "Info response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.games.prices" - }, - "examples": { - "success": { - "description": "Successful response", - "$ref": "#/components/examples/resp.prices.post.v3.success" - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/games/bundles/v2": { - "get": { - "operationId": "games-bundles-v2", - "tags": [ - "Bundles" - ], - "summary": "Bundles with Game", - "description": "Get all bundles which contain the game", - "security": [ - { - "ApiKeyParamAuth": [] - }, - { - "ApiKeyHeaderAuth": [] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/gid" - }, - { - "$ref": "#/components/parameters/country" - }, - { - "name": "expired", - "in": "query", - "description": "Include expired bundles", - "schema": { - "type": "boolean" - } - } - ], - "responses": { - "200": { - "description": "Success response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.games.bundles" - }, - "examples": { - "success": { - "description": "Successful response", - "$ref": "#/components/examples/resp.bundles.v2.success" - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/games/giveaways/v1": { - "get": { - "operationId": "games-giveaways-v1", - "tags": [ - "Giveaways" - ], - "summary": "Giveaways with Game", - "description": "Get all giveaways which contain the game", - "security": [ - { - "ApiKeyParamAuth": [] - }, - { - "ApiKeyHeaderAuth": [] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/gid" - }, - { - "name": "expired", - "in": "query", - "description": "Include expired giveaways", - "schema": { - "type": "boolean", - "default": false - } - } - ], - "responses": { - "200": { - "description": "Success response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.games.giveaways" - }, - "examples": { - "success": { - "description": "Successful response", - "$ref": "#/components/examples/resp.giveaways.v1.success" - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/games/overview/v2": { - "post": { - "operationId": "games-overview-v2", - "tags": [ - "Prices" - ], - "summary": "Price Overview", - "description": "Get basic price overview for selected games.\n\nFor each game current best price will be loaded (optionally, only from selected shops),\nhistorical low price (among all covered shops).\n\nFurthermore, result will also contain list of currently active bundles,\nwhich contain at least one of the queried games.\n", - "security": [ - { - "ApiKeyParamAuth": [] - }, - { - "ApiKeyHeaderAuth": [] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/country" - }, - { - "$ref": "#/components/parameters/shops" - }, - { - "name": "vouchers", - "in": "query", - "description": "Allow vouchers in prices", - "required": false, - "schema": { - "type": "boolean", - "default": true - } - } - ], - "requestBody": { - "$ref": "#/components/requestBodies/gids-200" - }, - "responses": { - "200": { - "description": "Success response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.games.overview" - }, - "examples": { - "success": { - "description": "Successful response", - "$ref": "#/components/examples/resp.overview.v2.success" - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/games/historylow/v1": { - "post": { - "operationId": "games-historylow-v1", - "tags": [ - "History" - ], - "summary": "History Low", - "description": "Get historically lowest prices", - "security": [ - { - "ApiKeyParamAuth": [] - }, - { - "ApiKeyHeaderAuth": [] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/country" - } - ], - "requestBody": { - "description": "List of Game IDs for which to load historical lows", - "$ref": "#/components/requestBodies/gids-200" - }, - "responses": { - "200": { - "description": "Success response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.games.historylow" - }, - "examples": { - "success": { - "description": "Successful response", - "$ref": "#/components/examples/historylow.v1.success" - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/games/storelow/v2": { - "post": { - "operationId": "games-storelow-v2", - "tags": [ - "History" - ], - "summary": "Store Low", - "description": "Get historically lowest prices for individual stores", - "security": [ - { - "ApiKeyParamAuth": [] - }, - { - "ApiKeyHeaderAuth": [] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/country" - }, - { - "$ref": "#/components/parameters/shops" - } - ], - "requestBody": { - "description": "List of Game IDs for which to load store lows", - "$ref": "#/components/requestBodies/gids-200" - }, - "responses": { - "200": { - "description": "Success response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.games.storelow" - }, - "examples": { - "success": { - "description": "Successful response", - "$ref": "#/components/examples/storelow.v2.success" - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/games/history/v2": { - "get": { - "operationId": "games-history-v2", - "tags": [ - "History" - ], - "summary": "History log", - "description": "Get log of historical prices", - "security": [ - { - "ApiKeyParamAuth": [] - }, - { - "ApiKeyHeaderAuth": [] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/gid" - }, - { - "$ref": "#/components/parameters/country" - }, - { - "$ref": "#/components/parameters/shops" - }, - { - "name": "since", - "in": "query", - "description": "Load only price changes after this date. \nBy default, only last 3 months are loaded\n", - "schema": { - "type": "string", - "format": "date-time" - } - } - ], - "responses": { - "200": { - "description": "Success response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.games.history" - }, - "examples": { - "success": { - "description": "Successful response", - "$ref": "#/components/examples/history.v2.success" - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/games/subs/v1": { - "post": { - "operationId": "games-subscriptions-v1", - "tags": [ - "Subscriptions" - ], - "summary": "Game Subscriptions", - "description": "Get list of subscriptions the game is listed in.\n", - "security": [ - { - "ApiKeyParamAuth": [] - }, - { - "ApiKeyHeaderAuth": [] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/country" - } - ], - "requestBody": { - "$ref": "#/components/requestBodies/gids-200" - }, - "responses": { - "200": { - "description": "Success response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.games.subscriptions" - }, - "examples": { - "success": { - "description": "Successful response", - "$ref": "#/components/examples/resp.games.subs.v1.success" - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/deals/v2": { - "get": { - "operationId": "deals-v2", - "tags": [ - "Deals List" - ], - "summary": "Deals List", - "description": "Get current deals. Follows the same rules as deals list displayed on the website, which means that\nyou will not get one game more than once in the list.\n\nFor each game, the best price is displayed, ignoring stores that currently don't have game on sale,\neven if they currently have a better price. If you want to included non-sale prices, use `nondeals` parameter.\n\nYou can define parameters either in a query part of a URL, or you can sent them in a request body.\nSince the specification for GET requests with body is unclear, we also provide more standard POST endpoint\nas a fallback.\n\nYou can authorize with either api key, or OAuth. If you use OAuth, the user data filters will work,\ne.g. in Waitlist filter.\n", - "security": [ - { - "ApiKeyParamAuth": [] - }, - { - "ApiKeyHeaderAuth": [] - }, - { - "OAuth2": [ - "wait_read", - "coll_read" - ] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/country" - }, - { - "name": "offset", - "in": "query", - "description": "Deals list offset", - "schema": { - "type": "integer", - "minimum": 0, - "default": 0 - } - }, - { - "name": "limit", - "in": "query", - "description": "How many deals to return", - "schema": { - "type": "integer", - "minimum": 1, - "maximum": 200, - "default": 20 - } - }, - { - "name": "sort", - "in": "query", - "description": "Sorting values, same as in deals list on the website", - "examples": { - "cut": { - "summary": "Highest cut", - "value": "-cut" - }, - "price": { - "summary": "Lowest price", - "value": "price" - } - }, - "schema": { - "type": "string" - } - }, - { - "name": "nondeals", - "in": "query", - "description": "Load non-sale prices", - "schema": { - "type": "boolean", - "default": false - } - }, - { - "name": "mature", - "in": "query", - "description": "Load deals for mature prices", - "schema": { - "type": "boolean", - "default": false - } - }, - { - "name": "shops", - "in": "query", - "description": "List of shop IDs separated by comma", - "explode": false, - "style": "form", - "schema": { - "type": "array", - "items": { - "type": "number", - "description": "Shop ID" - } - }, - "examples": { - "e1": { - "summary": "Only Steam (61) and GOG (35)", - "value": [ - 61, - 35 - ] - } - } - }, - { - "name": "filter", - "in": "query", - "description": "There are two ways how you can supply filters.\n\n- A base64 encoded lz compressed filter json - this is what ITAD uses, you can copy and paste filters from the URL\n- Filter JSON (see request body for specification). Examples are omitting URL encoding for clarity, \nbut make sure to URL encode these.\n", - "examples": { - "encoded": { - "summary": "At least 50% off, base64 lz string", - "value": "N4IgxgrgLiBcoFsCWA7OBWADAGhAghgB5wCMmmAvhUA=" - }, - "json": { - "summary": "At least 50% off, json", - "value": "{\"cut\":{\"min\":50,\"max\":null}}\n" - } - }, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "description": "You can use either request body or query parameters, but not both at the same time.\nIf you use request body, you must include `Content-Type: application/json` header in your request.\n", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/req.deals" - } - } - } - }, - "responses": { - "200": { - "description": "Deals list", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.deals" - }, - "examples": { - "success": { - "summary": "Deals list response example", - "$ref": "#/components/examples/resp.deals.get.v2.success" - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - }, - "post": { - "operationId": "deals-post-v2", - "tags": [ - "Deals List" - ], - "summary": "Deals List", - "description": "Get current deals. Fallback method if you want to use request body to provide parameters and for whatever reason\nyou can't use GET request. See [GET request documentation](#tag/Deals-List/operation/deals-v2) for more details.\n\nThis endpoint does not support query parameters.\n", - "security": [ - { - "ApiKeyParamAuth": [] - }, - { - "ApiKeyHeaderAuth": [] - }, - { - "OAuth2": [ - "wait_read", - "coll_read" - ] - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/req.deals" - } - } - } - }, - "responses": { - "200": { - "description": "Deals list", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.deals" - }, - "examples": { - "success": { - "summary": "Deals list response example", - "$ref": "#/components/examples/resp.deals.get.v2.success" - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/waitlist/games/v1": { - "get": { - "operationId": "waitlist-games-v1-get", - "tags": [ - "Waitlist Games" - ], - "summary": "Games in Waitlist", - "description": "Get games in user's Waitlist", - "security": [ - { - "OAuth2": [ - "wait_read" - ] - } - ], - "responses": { - "200": { - "description": "Success response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.waitlist.games" - }, - "examples": { - "success": { - "description": "Successful response", - "$ref": "#/components/examples/resp.games.get.v1.success" - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - }, - "put": { - "operationId": "waitlist-games-v1-put", - "tags": [ - "Waitlist Games" - ], - "summary": "Add to Waitlist", - "description": "Add games to user's Waitlist", - "security": [ - { - "OAuth2": [ - "wait_write" - ] - } - ], - "requestBody": { - "$ref": "#/components/requestBodies/gids" - }, - "responses": { - "204": { - "description": "Successful response" - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - }, - "delete": { - "operationId": "waitlist-games-v1-delete", - "tags": [ - "Waitlist Games" - ], - "summary": "Delete from Waitlist", - "description": "Delete games from user's Waitlist", - "security": [ - { - "OAuth2": [ - "wait_write" - ] - } - ], - "requestBody": { - "$ref": "#/components/requestBodies/gids" - }, - "responses": { - "204": { - "description": "Successful response" - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/collection/games/v1": { - "get": { - "operationId": "collection-games-v1-get", - "tags": [ - "Collection Games" - ], - "summary": "Games in Collection", - "description": "Get games in user's Collection", - "security": [ - { - "OAuth2": [ - "coll_read" - ] - } - ], - "responses": { - "200": { - "description": "Success response", - "content": { - "application/json": { - "schema": { - "title": "Collection Games Response", - "type": "array", - "items": { - "$ref": "#/components/schemas/obj.collection.game" - } - }, - "examples": { - "success": { - "description": "Successful response", - "$ref": "#/components/examples/resp.games.get.v1.success-2" - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - }, - "put": { - "operationId": "collection-games-v1-put", - "tags": [ - "Collection Games" - ], - "summary": "Add to Collection", - "description": "Add games to user's Collection", - "security": [ - { - "OAuth2": [ - "coll_write" - ] - } - ], - "requestBody": { - "$ref": "#/components/requestBodies/gids" - }, - "responses": { - "204": { - "description": "Successful response" - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - }, - "delete": { - "operationId": "collection-games-v1-delete", - "tags": [ - "Collection Games" - ], - "summary": "Delete from Collection", - "description": "Delete games from user's Collection", - "security": [ - { - "OAuth2": [ - "coll_write" - ] - } - ], - "requestBody": { - "$ref": "#/components/requestBodies/gids" - }, - "responses": { - "204": { - "description": "Successful response" - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/collection/copies/v1": { - "get": { - "operationId": "collection-copies-v1-get", - "tags": [ - "Collection Copies" - ], - "summary": "List Copies", - "description": "Get all copies user has in their Collection. Copies are returned as a simple list.\n\nIt is not necessary to have copy for each game in Collection, so you should not rely on this endpoint\nif you need to know about all games in user's Collection.\n", - "security": [ - { - "OAuth2": [ - "coll_read" - ] - } - ], - "responses": { - "200": { - "description": "Success response", - "content": { - "application/json": { - "schema": { - "title": "Collection Copies Response", - "type": "array", - "items": { - "$ref": "#/components/schemas/obj.collection.copy" - } - }, - "examples": { - "success": { - "description": "Successful response", - "$ref": "#/components/examples/resp.copies.get.v1" - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - }, - "post": { - "operationId": "collection-copies-v1-post", - "tags": [ - "Collection Copies" - ], - "summary": "Add Copies", - "description": "Add new copies. If the game is not already in a Collection, it will be added. Similarly, new tags will also be created.\n\nSame copies may exist multiple times for a single game, ITAD does not check for duplicates.\n\nThis operation is atomic, either all copies are added or none.\n", - "security": [ - { - "OAuth2": [ - "coll_write" - ] - } - ], - "requestBody": { - "description": "Copies to add", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/obj.collection.copy.new" - } - }, - "example": [ - { - "gameId": "018d937e-e9ab-70f4-bd05-1db7a138eb39", - "redeemed": false, - "shop": 61, - "price": { - "amount": 33.33, - "currency": "EUR" - }, - "note": "Api note", - "tags": [ - "From Api", - "Second tag" - ] - }, - { - "gameId": "018d937e-e9ab-70f4-bd05-1db7a138eb39", - "redeemed": false, - "shop": 4, - "price": null, - "note": null, - "tags": [ - "From Api" - ] - } - ] - } - } - }, - "responses": { - "201": { - "description": "Successful response" - }, - "400": { - "$ref": "#/components/responses/resp.error.array-of-objects-validation" - }, - "default": { - "$ref": "#/components/responses/resp.error.array-of-objects-validation" - } - } - }, - "patch": { - "operationId": "collection-copies-v1-patch", - "tags": [ - "Collection Copies" - ], - "summary": "Update Copies", - "description": "Update one or more copies.\n\nYou can issue partial updates on copy, only properties that are included for a copy will be updated.\n \nThis operation is atomic, either all copies are updated or none.\n", - "security": [ - { - "OAuth2": [ - "coll_write" - ] - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/obj.collection.copy.patch" - }, - "example": [ - { - "id": 145742693, - "shop": 61, - "price": { - "amount": 12.34, - "currency": "USD" - } - } - ] - } - } - } - }, - "responses": { - "200": { - "description": "Success response" - }, - "400": { - "$ref": "#/components/responses/resp.error.array-of-objects-validation" - }, - "default": { - "$ref": "#/components/responses/resp.error.array-of-objects-validation" - } - } - }, - "delete": { - "operationId": "collection-copies-v1-delete", - "tags": [ - "Collection Copies" - ], - "summary": "Delete Copies", - "description": "Delete Collection copies.\n\nCopies that do not exist or don't belong to user will be silently ignored.\n\nOperation is atomic. Either all copies are deleted or none.\n", - "security": [ - { - "OAuth2": [ - "coll_write" - ] - } - ], - "requestBody": { - "description": "List of copy IDs", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "integer" - } - }, - "example": [ - 123, - 124, - 125 - ] - } - } - }, - "responses": { - "200": { - "description": "Successful response" - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/collection/groups/v1": { - "get": { - "operationId": "collection-groups-v1-get", - "tags": [ - "Collection Groups" - ], - "summary": "Get all Categories", - "description": "Get all Collection categories, both the user created ones and default one.\nDefault category has id 0 and will always be listed last. User set order of categories is respected in the response.\n", - "security": [ - { - "OAuth2": [ - "coll_read" - ] - } - ], - "responses": { - "200": { - "description": "Success response", - "content": { - "application/json": { - "schema": { - "title": "Collection Categories Response", - "type": "array", - "items": { - "$ref": "#/components/schemas/obj.collection.group" - } - }, - "examples": { - "success": { - "description": "Successful response", - "$ref": "#/components/examples/resp.groups.get.v1.success" - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - }, - "post": { - "operationId": "collection-groups-v1-post", - "tags": [ - "Collection Groups" - ], - "summary": "Create new Category", - "description": "Create Collection category. Categories with same name may exist.\n\nSuccessful response will return the created category.\n", - "security": [ - { - "OAuth2": [ - "coll_write" - ] - } - ], - "requestBody": { - "description": "Category to create", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/obj.collection.group.new" - }, - "example": { - "title": "New Collection Category", - "public": true - } - } - } - }, - "responses": { - "200": { - "description": "Created category", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/obj.collection.group", - "title": "Newly created category" - }, - "examples": { - "success": { - "$ref": "#/components/examples/resp.groups.post.v1.success" - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/resp.error.object-validation" - }, - "default": { - "$ref": "#/components/responses/resp.error.object-validation" - } - } - }, - "patch": { - "operationId": "collection-groups-v1-patch", - "tags": [ - "Collection Groups" - ], - "summary": "Update Categories", - "description": "Update one or more categories.\n\nFor each category that you are going to update, only `id` is required. Fields that you do not want to update may be\nset to `null` or omitted fully. Categories that do not exist or user does not own will be ignored.\n\nDefault category (id: `0`) may have only `public` property updated. Other properties will be ignored.\n\nThis operation is atomic, either all categories update or none. Successful response is the full category list,\nincluding categories that were not updated.\n", - "security": [ - { - "OAuth2": [ - "coll_write" - ] - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/obj.collection.group.patch" - }, - "example": [ - { - "id": 123, - "title": "Full update", - "public": false, - "position": "1\"" - }, - { - "id": 0, - "public": false - } - ] - } - } - } - }, - "responses": { - "200": { - "description": "Success response", - "content": { - "application/json": { - "schema": { - "title": "Collection Categories Response", - "type": "array", - "items": { - "$ref": "#/components/schemas/obj.collection.group" - } - }, - "examples": { - "success": { - "description": "Successful response", - "$ref": "#/components/examples/resp.groups.get.v1.success" - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/resp.error.array-of-objects-validation" - }, - "default": { - "$ref": "#/components/responses/resp.error.array-of-objects-validation" - } - } - }, - "delete": { - "operationId": "collection-groups-v1-delete", - "tags": [ - "Collection Groups" - ], - "summary": "Delete Categories", - "description": "Delete Collection categories.\n\nDefault category or categories that do not exist or user does not own will be silently ignored.\n", - "security": [ - { - "OAuth2": [ - "coll_write" - ] - } - ], - "requestBody": { - "description": "List of category IDs", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "integer" - } - }, - "example": [ - 123, - 124, - 125 - ] - } - } - }, - "responses": { - "200": { - "description": "Successful response" - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/ignored/games/v1": { - "get": { - "operationId": "ignored-games-v1-get", - "tags": [ - "Ignored Games" - ], - "summary": "Games in Ignore List", - "description": "Get games in user's Ignore List", - "security": [ - { - "OAuth2": [ - "ignored_read" - ] - } - ], - "responses": { - "200": { - "description": "Success response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.ignored.games" - }, - "examples": { - "success": { - "description": "Successful response", - "$ref": "#/components/examples/resp.games.get.v1.success" - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - }, - "put": { - "operationId": "ignored-games-v1-put", - "tags": [ - "Ignored Games" - ], - "summary": "Add to Ignore List", - "description": "Add games to user's Ignore List", - "security": [ - { - "OAuth2": [ - "ignored_write" - ] - } - ], - "requestBody": { - "$ref": "#/components/requestBodies/gids" - }, - "responses": { - "204": { - "description": "Successful response" - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - }, - "delete": { - "operationId": "ignored-games-v1-delete", - "tags": [ - "Ignored Games" - ], - "summary": "Delete from Ignore List", - "description": "Delete games from user's Ignore List", - "security": [ - { - "OAuth2": [ - "ignored_write" - ] - } - ], - "requestBody": { - "$ref": "#/components/requestBodies/gids" - }, - "responses": { - "204": { - "description": "Successful response" - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/stats/waitlist/v1": { - "get": { - "operationId": "stats-waitlist-v1", - "tags": [ - "Stats", - "Waitlist Stats" - ], - "summary": "Waitlist Stats", - "description": "Get Waitlist statistics for a game\n\n> Note: stats do not take into consideration users' regions.\n> If they have set their price limit to be a historical low, stats will be computed\n> for all users as if they were in the region you specify\n", - "security": [ - { - "ApiKeyParamAuth": [] - }, - { - "ApiKeyHeaderAuth": [] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/gid" - }, - { - "$ref": "#/components/parameters/country" - }, - { - "name": "bucket_price", - "in": "query", - "description": "Price bucket size", - "schema": { - "type": "integer", - "minimum": 0, - "default": 5 - } - }, - { - "name": "bucket_cut", - "in": "query", - "description": "Cut bucket size", - "schema": { - "type": "integer", - "minimum": 0, - "default": 5 - } - } - ], - "responses": { - "200": { - "description": "Success response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.stats.waitlist" - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/stats/most-waitlisted/v1": { - "get": { - "operationId": "stats-most-waitlisted-v1", - "tags": [ - "Stats", - "Waitlist Stats" - ], - "summary": "Most Waitlisted", - "description": "Get list of most Waitlisted games\n", - "security": [ - { - "ApiKeyParamAuth": [] - }, - { - "ApiKeyHeaderAuth": [] - } - ], - "parameters": [ - { - "name": "offset", - "in": "query", - "schema": { - "type": "integer", - "minimum": 0, - "default": 0 - } - }, - { - "name": "limit", - "in": "query", - "schema": { - "type": "integer", - "minimum": 1, - "maximum": 500, - "default": 20 - } - } - ], - "responses": { - "200": { - "description": "Success response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.stats.ranked-games" - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/stats/most-collected/v1": { - "get": { - "operationId": "stats-most-collected-v1", - "tags": [ - "Stats", - "Collection Stats" - ], - "summary": "Most Collected", - "description": "Get list of most Collected games\n", - "security": [ - { - "ApiKeyParamAuth": [] - }, - { - "ApiKeyHeaderAuth": [] - } - ], - "parameters": [ - { - "name": "offset", - "in": "query", - "schema": { - "type": "integer", - "minimum": 0, - "default": 0 - } - }, - { - "name": "limit", - "in": "query", - "schema": { - "type": "integer", - "minimum": 1, - "maximum": 500, - "default": 20 - } - } - ], - "responses": { - "200": { - "description": "Success response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.stats.ranked-games" - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/stats/most-popular/v1": { - "get": { - "operationId": "stats-most-popular-v1", - "tags": [ - "Stats" - ], - "summary": "Most Popular", - "description": "Get list of most popular games. Popularity for each game is computed as Waitlisted count + Collected count.\n", - "security": [ - { - "ApiKeyParamAuth": [] - }, - { - "ApiKeyHeaderAuth": [] - } - ], - "parameters": [ - { - "name": "offset", - "in": "query", - "schema": { - "type": "integer", - "minimum": 0, - "default": 0 - } - }, - { - "name": "limit", - "in": "query", - "schema": { - "type": "integer", - "minimum": 1, - "maximum": 500, - "default": 20 - } - } - ], - "responses": { - "200": { - "description": "Success response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.stats.ranked-games" - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/user/info/v2": { - "get": { - "operationId": "user-info-v2", - "tags": [ - "User" - ], - "summary": "User Info", - "description": "Get user info, currently just a username", - "security": [ - { - "OAuth2": [ - "user_info" - ] - } - ], - "responses": { - "200": { - "description": "Success response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.user.info" - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/user/notes/v1": { - "get": { - "operationId": "user-notes-v1-get", - "tags": [ - "User Notes" - ], - "summary": "Get notes", - "description": "Get user's game notes\n", - "security": [ - { - "OAuth2": [ - "notes_read" - ] - } - ], - "responses": { - "200": { - "description": "Success response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.notes.get" - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - }, - "put": { - "operationId": "user-notes-v1-put", - "tags": [ - "User Notes" - ], - "summary": "Add or edit notes", - "description": "Add or edit game notes. This operation is atomic and idempotent.\n", - "security": [ - { - "OAuth2": [ - "notes_write" - ] - } - ], - "requestBody": { - "required": true, - "description": "List of notes", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/obj.note" - } - } - } - } - }, - "responses": { - "200": { - "description": "Success response" - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - }, - "delete": { - "operationId": "user-notes-v1-delete", - "tags": [ - "User Notes" - ], - "summary": "Delete notes", - "description": "Delete game notes. This operation is atomic.\n", - "security": [ - { - "OAuth2": [ - "notes_write" - ] - } - ], - "requestBody": { - "required": true, - "description": "List of game IDs", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "string", - "format": "uuid" - } - } - } - } - }, - "responses": { - "200": { - "description": "Success response" - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/profiles/link/v1": { - "put": { - "operationId": "profiles-link-v1-put", - "tags": [ - "Profiles" - ], - "summary": "Link profile", - "description": "Profile is an object identifying remote account. You need linked profile to use sync endpoints.\n\nAfter successful link you will get profile token, which is used in subsequent profile operations,\nusually as an `ITAD-Profile` header. \n\nLinking is idempotent, if you lose your token, or you need it in different instance of your app,\nyou can link the same profile again.\n", - "security": [ - { - "OAuth2": [ - "profiles" - ] - } - ], - "requestBody": { - "required": true, - "description": "Profile to link", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/obj.profile" - }, - "example": { - "accountId": "acc7896132977", - "accountName": "My Account" - } - } - } - }, - "responses": { - "200": { - "description": "Success response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.link.put" - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - }, - "delete": { - "operationId": "profiles-link-v1-delete", - "tags": [ - "Profiles" - ], - "summary": "Unlink profile", - "security": [ - { - "OAuth2": [ - "profiles" - ] - } - ], - "parameters": [ - { - "name": "ITAD-Profile", - "in": "header", - "required": true, - "schema": { - "type": "string", - "description": "Profile token" - } - } - ], - "responses": { - "200": { - "description": "Success response" - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/profiles/sync/waitlist/v1": { - "put": { - "operationId": "profiles-sync-waitlist-v1-put", - "tags": [ - "Sync" - ], - "summary": "Sync Waitlist", - "description": "Sync Waitlist with IsThereAnyDeal. User can set category for your profile and default notification rules\nin their [settings](https://isthereanydeal.com/settings/profiles/), same as with natively supported profiles.\n", - "security": [ - { - "OAuth2": [ - "profiles" - ] - } - ], - "parameters": [ - { - "name": "ITAD-Profile", - "in": "header", - "required": true, - "schema": { - "type": "string", - "description": "Profile token" - } - } - ], - "requestBody": { - "required": true, - "description": "Games to sync with IsThereAnyDeal", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/obj.waitlist.entry" - } - }, - "example": [ - { - "shop": 61, - "id": "my-waitlist-id-1", - "title": "Creatures of Ava: Deluxe Edition" - }, - { - "shop": 4, - "id": "my-waitlist-id-3", - "title": ">observer_" - } - ] - } - } - }, - "responses": { - "200": { - "description": "Success response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.sync.waitlist" - } - } - } - }, - "400": { - "$ref": "#/components/responses/resp.error.array-of-objects-validation" - }, - "default": { - "$ref": "#/components/responses/resp.error.array-of-objects-validation" - } - } - } - }, - "/profiles/sync/collection/v1": { - "put": { - "operationId": "profiles-sync-collection-v1-put", - "tags": [ - "Sync" - ], - "summary": "Sync Collection", - "description": "Sync Collection with IsThereAnyDeal. User can set category for your profile\nin their [settings](https://isthereanydeal.com/settings/profiles/), same as with natively supported profiles.\n\nGames are synced as redeemed copies. If there already is a redemeed copy with the same shop in user's Collection,\nnew copy will not be added.\n", - "security": [ - { - "OAuth2": [ - "profiles" - ] - } - ], - "parameters": [ - { - "name": "ITAD-Profile", - "in": "header", - "required": true, - "schema": { - "type": "string", - "description": "Profile token" - } - } - ], - "requestBody": { - "required": true, - "description": "Games to sync with IsThereAnyDeal", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/obj.collection.entry" - } - }, - "example": [ - { - "shop": 61, - "id": "my-tracking-id-2", - "title": "Creatures of Ava: Deluxe Edition", - "playtime": 100, - "lastPlayed": "2024-08-26T22:04:08+01:00" - }, - { - "shop": 4, - "id": "my-tracking-id-3", - "title": ">observer_" - } - ] - } - } - }, - "responses": { - "200": { - "description": "Success response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.sync.collection" - } - } - } - }, - "400": { - "$ref": "#/components/responses/resp.error.array-of-objects-validation" - }, - "default": { - "$ref": "#/components/responses/resp.error.array-of-objects-validation" - } - } - } - }, - "/notifications/v1": { - "get": { - "operationId": "notifications-list-v1-get", - "tags": [ - "Notifications" - ], - "summary": "List notifications", - "description": "Get user's notifications", - "security": [ - { - "OAuth2": [ - "notifications" - ] - } - ], - "responses": { - "200": { - "description": "Success response", - "content": { - "application/json": { - "schema": { - "title": "Notifications Response", - "type": "array", - "items": { - "$ref": "#/components/schemas/obj.notification" - } - }, - "examples": { - "success": { - "description": "Successful response", - "$ref": "#/components/examples/resp.notifications.get.v1" - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/notifications/waitlist/v1": { - "get": { - "operationId": "notifications-waitlist-v1-get", - "tags": [ - "Notifications", - "Waitlist Notifications" - ], - "summary": "Waitlist notification detail", - "description": "Get details of Waitlist notification", - "security": [ - { - "OAuth2": [ - "notifications" - ] - } - ], - "parameters": [ - { - "in": "query", - "name": "id", - "description": "Notification ID", - "required": true, - "schema": { - "type": "string", - "format": "uuid" - } - } - ], - "responses": { - "200": { - "description": "Success response", - "content": { - "application/json": { - "schema": { - "title": "Waitlist Notification Detail Response", - "$ref": "#/components/schemas/obj.notification.waitlist" - }, - "examples": { - "success": { - "description": "Successful response", - "$ref": "#/components/examples/resp.notifications.waitlist.get.v1" - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/notifications/read/v1": { - "put": { - "operationId": "notifications-read-v1-put", - "tags": [ - "Notifications" - ], - "summary": "Mark notification read", - "description": "Mark single notification as read", - "security": [ - { - "OAuth2": [ - "notifications" - ] - } - ], - "parameters": [ - { - "in": "query", - "name": "id", - "description": "Notification ID", - "required": true, - "schema": { - "type": "string", - "format": "uuid" - } - } - ], - "responses": { - "204": { - "description": "Success response" - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/notifications/read/all/v1": { - "put": { - "operationId": "notifications-read-all-v1-put", - "tags": [ - "Notifications" - ], - "summary": "Mark all notifications read", - "description": "Mark all notifications as read", - "security": [ - { - "OAuth2": [ - "notifications" - ] - } - ], - "responses": { - "204": { - "description": "Success response" - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/service/shops/v1": { - "get": { - "operationId": "service-shops-v1", - "tags": [ - "Shops" - ], - "summary": "Active shops", - "description": "Return active shops for specified country, with basic information about number of games and shop's last update.", - "security": [], - "parameters": [ - { - "$ref": "#/components/parameters/country" - } - ], - "responses": { - "200": { - "description": "List of shops and their details", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.service.shops" - }, - "examples": { - "success": { - "summary": "Short shop list example", - "$ref": "#/components/examples/shops.v1.success" - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/service/shops/map/v1": { - "get": { - "operationId": "service-shops-map-v1", - "tags": [ - "Shops" - ], - "summary": "Shop Map", - "description": "Get list of all shops that were ever covered by IsThereAnyDeal, including inactive shops. Only id and title of the shop is included in the response, since the shop details may differ by region.", - "security": [], - "responses": { - "200": { - "description": "Shop map", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.service.shops.map" - }, - "examples": { - "success": { - "summary": "Short shop map example", - "$ref": "#/components/examples/shops.map.v1.success" - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/webhooks/v1": { - "put": { - "operationId": "webhooks-add-v1", - "tags": [ - "Webhooks" - ], - "summary": "Add webhook", - "description": "Register a webhook for the user. All webhooks should implicitly support ping event. You don't have to specify ping event in the list of supported ones, it will be added automatically.\nUpon successful registration, the response will include webhook's ID that can be used to remove the webhook.", - "security": [ - { - "OAuth2": [ - "webhooks" - ] - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/obj.webhook" - } - } - } - }, - "responses": { - "200": { - "description": "Successful webhook registration", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.webhook.add" - } - } - } - }, - "400": { - "$ref": "#/components/responses/resp.error.object-validation" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - }, - "delete": { - "operationId": "webhooks-delete-v1", - "tags": [ - "Webhooks" - ], - "summary": "Remove webhook", - "description": "Remove previously registered webhook", - "security": [ - { - "OAuth2": [ - "webhooks" - ] - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid" - } - } - } - } - } - }, - "responses": { - "204": { - "description": "Successful response" - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/unstable/games/list/v1": { - "get": { - "operationId": "unstable-games-list-v1", - "tags": [ - "Unstable" - ], - "summary": "Game List", - "description": "> We are looking for a feedback for this endpoint. Please let us know whether you find this useful or not,\n> or suggest changes. If we won't hear any feedback, we will assume this endpoint\n> is useless and will be removed in the future.\n\nGet list of currently recognized active games.\n\nOne of the biggest hurdles to communicate with the ITAD API is to get game IDs that are needed by our endpoints.\nUsually, you will get these IDs by doing a lookup or search when you are trying to get to specific game,\nor they will be a part of the response of other endpoints, e.g. Deals list.\n\nWith this endpoint we are experimenting with returning a list of all currently active games, which could be used to\nbootstrap your application.\n\nHowever, this is not a load once and forget solution. Each game on IsThereAnyDeal has associated products,\nwhich are basically entries from shops that we cover. Think about \"game\" on ITAD as a _container_,\nthat includes products and has some other associated information or metadata.\n\nOnce a game loses its products, it will become inactive. This can happen for example if the game is renamed.\nIn such cases, new game entry will be created, and products will be reassigned to the new game.\nThis can happen automatically by a system, or manually.\n\nThe automatic product to game assignment is not perfect, and sometimes needs to be fixed manually.\nThis may happen because of various sitations, for example:\n- developer changes the game's name, but some of the shops don't reflect the change and keep using the old name\n- shop lists a game in a slightly different way that our system can't manage automatically \n- remaster of the game is released with the same name as the old entry\n- a different game with the same name exists and products needs to be split to correct entries\n\n> To make things even more complicated, the shop may change their product ID,\n> or may use different product IDs for different regions, based on their internal structure.\n> To get a better understanding of this, you can check any game on ITAD for its products. As an example,\n> here's [Red Dead Redemption 2](https://isthereanydeal.com/game/red-dead-redemption-2/products/). \n\nThe game IDs are ensured to be ascending. You can check for new entries by using your last known game ID\nto get only new entries. However, there may be a case, where an old inactive game becomes active again\n- it stopped being sold, but has since returned and is being sold again.\n\nWe are looking for a feedback about this endpoint. You can currently use it to bootstrap your application,\nbut it should not be relied upon for 100% coverage all the time. At the very least, if you end up relying on this map\nand omit doing lookups, you should check for new entries, and periodically (e.g. once a week) recheck the entire list.\n\nThere is a possiblity to return all known game entries, including the inactive ones, but this would include\na lot of dead entries that will never be used again, like when a shop listed a game with typo and such.\n\nThe maximum number of games you will get is 10000. Use `last` parameter to get more entries.\n\n> This endpoint is supposed to be used in concert with [Game Changes endpoint](#tag/Unstable/operation/unstable-games-dots-v1).\n", - "security": [ - { - "ApiKeyParamAuth": [] - }, - { - "ApiKeyHeaderAuth": [] - } - ], - "parameters": [ - { - "name": "last", - "in": "query", - "required": false, - "description": "Last known game ID, use to get newer entries", - "schema": { - "type": "string", - "format": "uuid" - } - } - ], - "responses": { - "200": { - "description": "Info response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.games.list" - }, - "examples": { - "list": { - "$ref": "#/components/examples/resp.games.list.v1.success" - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/unstable/games/dots/v1": { - "get": { - "operationId": "unstable-games-dots-v1", - "tags": [ - "Unstable" - ], - "summary": "Game Changes", - "description": "> We are looking for a feedback for this endpoint. Please let us know whether you find this useful or not,\n> or suggest changes. If we won't hear any feedback, we will assume this endpoint\n> is useless and will be removed in the future.\n\nGet list of product assignment changes.\n\nAs explained in the [Games List endpoint](#tag/Unstable/operation/unstable-games-list-v1), game on IsThereAnyDeal\nis a container that has products assigned, and products may move between game entries.\n\nThis endpoint will return these products changes. The intention is that if you use Games List endpoint\nto get the game map, you will also use this endpoint in concert, and recheck games that had their products reassigned.\n\nNumber of entries returned is limited to 1000. You can use `last` parameter to get newer entries since your last known id,\nor `since` parameter to get newer entries since supplied unix timestamp.\nIf none are used, you will get the newest 1000 entries.\n\n> This endpoint is supposed to be used in concert with [Game List endpoint](#tag/Unstable/operation/unstable-games-list-v1).\n", - "security": [ - { - "ApiKeyParamAuth": [] - }, - { - "ApiKeyHeaderAuth": [] - } - ], - "parameters": [ - { - "name": "last", - "in": "query", - "required": false, - "description": "Last known change ID, use to get newer entries", - "schema": { - "type": "number" - } - }, - { - "name": "since", - "in": "query", - "required": false, - "description": "Unix timestamp, to return newer entries than supplied timestamp", - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "description": "Successful response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.games.dots" - }, - "examples": { - "changes": { - "$ref": "#/components/examples/resp.games.dots.v1.success" - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/internal/early-access/v1": { - "get": { - "operationId": "internal-earlyaccess-v1", - "tags": [ - "Internal" - ], - "summary": "Early Access Games", - "description": "Returns list of Steam appids, which are currently considered to be early in early access", - "security": [ - { - "ApiKeyParamAuth": [] - }, - { - "ApiKeyHeaderAuth": [] - } - ], - "responses": { - "200": { - "description": "Success response", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "integer" - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/internal/players/v1": { - "get": { - "operationId": "internal-players-v1", - "tags": [ - "Internal" - ], - "summary": "Number of Players Statistics", - "security": [ - { - "ApiKeyParamAuth": [] - }, - { - "ApiKeyHeaderAuth": [] - } - ], - "parameters": [ - { - "name": "appid", - "in": "query", - "required": true, - "schema": { - "type": "number" - } - } - ], - "responses": { - "200": { - "description": "Success response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.internal.players" - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/internal/hltb/v1": { - "get": { - "operationId": "internal-hltb-v1", - "tags": [ - "Internal" - ], - "summary": "HowLongToBeat Overview", - "security": [ - { - "ApiKeyParamAuth": [] - }, - { - "ApiKeyHeaderAuth": [] - } - ], - "parameters": [ - { - "name": "appid", - "in": "query", - "required": true, - "schema": { - "type": "number" - } - } - ], - "responses": { - "200": { - "description": "Success response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.internal.hltb" - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/internal/wsgf/v1": { - "get": { - "operationId": "internal-wsgf-v1", - "tags": [ - "Internal" - ], - "summary": "WSGF Overview", - "security": [ - { - "ApiKeyParamAuth": [] - }, - { - "ApiKeyHeaderAuth": [] - } - ], - "parameters": [ - { - "name": "appid", - "in": "query", - "required": true, - "schema": { - "type": "number" - } - } - ], - "responses": { - "200": { - "description": "Success response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.internal.wsgf" - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/internal/reviews/v1": { - "get": { - "operationId": "internal-reviews-v1", - "tags": [ - "Internal" - ], - "summary": "Reviews Score", - "description": "Returns Metacritic user reviews overview and OpenCritic overview for a given game", - "security": [ - { - "ApiKeyParamAuth": [] - }, - { - "ApiKeyHeaderAuth": [] - } - ], - "parameters": [ - { - "name": "appid", - "in": "query", - "required": true, - "schema": { - "type": "number" - } - } - ], - "responses": { - "200": { - "description": "Success response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.internal.reviews" - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/internal/rates/v1": { - "get": { - "operationId": "internal-rates-v1", - "tags": [ - "Internal" - ], - "summary": "Conversion Rates", - "security": [ - { - "ApiKeyParamAuth": [] - }, - { - "ApiKeyHeaderAuth": [] - } - ], - "responses": { - "200": { - "description": "Success response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.internal.rates" - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/internal/exfgls/v1": { - "get": { - "operationId": "internal-exfgls-v1", - "tags": [ - "Internal" - ], - "summary": "Excluded from Family Sharing", - "security": [ - { - "ApiKeyParamAuth": [] - }, - { - "ApiKeyHeaderAuth": [] - } - ], - "requestBody": { - "description": "List of appids", - "required": true, - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "integer" - } - } - } - } - }, - "responses": { - "200": { - "description": "Success response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.internal.exfgls" - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - }, - "/internal/twitch/stream/v1": { - "get": { - "operationId": "internal-twitchstream-v1", - "tags": [ - "Internal" - ], - "summary": "Current stream of Twitch channel", - "security": [ - { - "ApiKeyParamAuth": [] - }, - { - "ApiKeyHeaderAuth": [] - } - ], - "parameters": [ - { - "name": "channel", - "in": "query", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Success response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/resp.internal.twitchstream" - } - } - } - }, - "400": { - "$ref": "#/components/responses/error-response" - }, - "default": { - "$ref": "#/components/responses/error-response" - } - } - } - } - }, - "webhooks": { - "ping": { - "post": { - "operationId": "webhook-ping-post", - "tags": [ - "Webhooks" - ], - "summary": "Ping event", - "description": "Event you can use to test if the webhook is set up correctly.\nCan be triggered manually from [settings](https://isthereanydeal.com/settings/webhooks/).\n", - "security": [], - "parameters": [ - { - "$ref": "#/components/parameters/headers.user-agent" - }, - { - "$ref": "#/components/parameters/headers.content-type" - }, - { - "$ref": "#/components/parameters/headers.hook-id" - }, - { - "$ref": "#/components/parameters/headers.event", - "schema": { - "type": "string", - "const": "ping" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "string", - "const": "pong", - "description": "Ping even will always send \"pong\" string in a body" - } - } - } - }, - "responses": { - "200": { - "description": "Return 200 to indicate webhook request was received successfuly" - }, - "default": { - "description": "Frequent or prolonged error responses (other than in 200 range) may in some cases cause webhook to be disabled\n" - } - } - } - }, - "notification": { - "post": { - "operationId": "webhook-notification-post", - "tags": [ - "Webhooks", - "Waitlist Notifications" - ], - "summary": "Waitlist notification event", - "description": "This event is trigger on new Waitlist notifications\n\nEvent's payload is a list of games and their deals that passed user's notification settings,\nsimilar to the Waitlist email notification you may receive.\n", - "security": [], - "parameters": [ - { - "$ref": "#/components/parameters/headers.user-agent" - }, - { - "$ref": "#/components/parameters/headers.content-type" - }, - { - "$ref": "#/components/parameters/headers.hook-id" - }, - { - "$ref": "#/components/parameters/headers.event", - "schema": { - "type": "string", - "const": "notification-waitlist" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "title": "Waitlist Notification Payload", - "type": "array", - "items": { - "$ref": "#/components/schemas/obj.notification.game" - } - }, - "examples": { - "success": { - "description": "Payload", - "$ref": "#/components/examples/event.notification-waitlist" - } - } - } - } - }, - "responses": { - "200": { - "description": "Return 200 to indicate webhook request was received successfuly" - }, - "default": { - "description": "Frequent or prolonged error responses (other than in 200 range) may in some cases cause webhook to be disabled\n" - } - } - } - } - } -} \ No newline at end of file diff --git a/steam_scan.py b/steam_scan.py deleted file mode 100644 index 7c24613..0000000 --- a/steam_scan.py +++ /dev/null @@ -1,188 +0,0 @@ -#!/usr/bin/env python3 -""" -Scan Steam app IDs, fetch review metadata, and save the IDs whose positive-review -percentage is near a target (default 20 / 40 / 70) with at least N reviews (default 500). - -Usage examples: - python steam_scan.py --start 10 --end 3000000 --step 10 - python steam_scan.py --ids-file my_ids.txt # one appid per line instead of incrementing - python steam_scan.py --targets 20 40 70 --tolerance 2 --min-reviews 1000 - -Output (in --out, default ./steam_out): - interesting.csv matching games (appended as found) - state.json checkpoint, so re-running resumes where it stopped -""" -import argparse -import csv -import json -import os -import sys -import time - -import requests - -URL = "https://store.steampowered.com/appreviews/{appid}" -FIELDS = ["appid", "bucket", "pct_positive", "positive", "negative", - "total", "review_score_desc", "store_url"] - - -def fetch_summary(session, appid, retries=6): - """Return the query_summary dict, or None if the app doesn't exist / has no data.""" - wait = 5 - for _ in range(retries): - try: - r = session.get( - URL.format(appid=appid), - params={"json": 1, "language": "all", "purchase_type": "all", - "num_per_page": 0, "filter": "all"}, - timeout=20, - ) - except requests.RequestException: - time.sleep(wait) - wait = min(wait * 2, 300) - continue - if r.status_code == 429: # rate limited -> back off - print(f" rate limited, sleeping {wait}s", file=sys.stderr) - time.sleep(wait) - wait = min(wait * 2, 300) - continue - if r.status_code != 200: - return None - try: - data = r.json() - except ValueError: - return None - if data.get("success") != 1: - return None - return data.get("query_summary") - raise RuntimeError(f"Giving up on appid {appid} after {retries} retries") - - -def pick_bucket(pct, targets, tol): - best = min(targets, key=lambda t: abs(pct - t)) - return best if abs(pct - best) <= tol else None - - -def load_state(path): - if os.path.exists(path): - with open(path) as f: - return json.load(f) - return {"last_id": None} - - -def save_state(path, last_id): - tmp = path + ".tmp" - with open(tmp, "w") as f: - json.dump({"last_id": last_id}, f) - os.replace(tmp, path) - - -def id_stream(args, last_id): - if args.ids_file: - with open(args.ids_file) as f: - ids = [int(line.strip()) for line in f if line.strip().isdigit()] - if last_id is not None: - ids = [i for i in ids if i > last_id] - yield from ids - else: - start = args.start if last_id is None else max(args.start, last_id + args.step) - yield from range(start, args.end, args.step) - - -def main(): - p = argparse.ArgumentParser() - p.add_argument("--start", type=int, default=10) - p.add_argument("--end", type=int, default=3_000_000) - p.add_argument("--step", type=int, default=10, help="Steam app IDs are almost all multiples of 10") - p.add_argument("--ids-file", help="read app IDs from a file instead of incrementing") - p.add_argument("--targets", type=float, nargs="+", default=[20, 40, 70]) - p.add_argument("--tolerance", type=float, default=10.0, help="+/- percentage points") - p.add_argument("--min-reviews", type=int, default=500) - p.add_argument("--delay", type=float, default=1.0, help="seconds between requests") - p.add_argument("--out", default="steam_out") - args = p.parse_args() - - os.makedirs(args.out, exist_ok=True) - csv_path = os.path.join(args.out, "interesting.csv") - state_path = os.path.join(args.out, "state.json") - - state = load_state(state_path) - last_id = state["last_id"] - if last_id is not None: - print(f"Resuming after appid {last_id}") - - new_file = not os.path.exists(csv_path) - session = requests.Session() - session.headers["User-Agent"] = "steam-review-scan/1.0" - - found = scanned = 0 - current = last_id - - # per-bucket match counters (seeded from the CSV so they survive a resume) - bucket_counts = {t: 0 for t in args.targets} - if not new_file: - with open(csv_path, newline="") as rf: - for row in csv.DictReader(rf): - try: - b = float(row["bucket"]) - except (KeyError, ValueError): - continue - if b in bucket_counts: - bucket_counts[b] += 1 - - def counter_line(appid): - per_bucket = " ".join(f"{t:g}%:{n}" for t, n in bucket_counts.items()) - return f"scanned {scanned} | appid {appid} | matches {found} this run | saved [{per_bucket}]" - with open(csv_path, "a", newline="") as f: - writer = csv.DictWriter(f, fieldnames=FIELDS) - if new_file: - writer.writeheader() - try: - for appid in id_stream(args, last_id): - current = appid - summary = fetch_summary(session, appid) - scanned += 1 - - if summary: - pos = summary.get("total_positive", 0) - neg = summary.get("total_negative", 0) - total = pos + neg - if total >= args.min_reviews: - pct = 100 * pos / total - bucket = pick_bucket(pct, args.targets, args.tolerance) - if bucket is not None: - writer.writerow({ - "appid": appid, "bucket": bucket, - "pct_positive": round(pct, 1), - "positive": pos, "negative": neg, "total": total, - "review_score_desc": summary.get("review_score_desc", ""), - "store_url": f"https://store.steampowered.com/app/{appid}/", - }) - f.flush() - found += 1 - bucket_counts[bucket] += 1 - sys.stdout.write("\r" + " " * 100 + "\r") # clear live counter line - print(f"[MATCH] {appid}: {pct:.1f}% of {total} reviews (target {bucket:g}%)") - - if scanned % 50 == 0: - save_state(state_path, appid) - sys.stdout.write("\r" + counter_line(appid)) # live counter - sys.stdout.flush() - time.sleep(args.delay) - except KeyboardInterrupt: - print("\nInterrupted.") - except RuntimeError as e: - print(e, file=sys.stderr) - finally: - if current is not None: - # resume from the last fully processed id - save_state(state_path, current) - - print() - print(f"Done. Scanned {scanned}, saved {found} new matches to {csv_path}") - for t, n in bucket_counts.items(): - print(f" {t:g}% bucket: {n} total saved") - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/test_label.py b/test_label.py deleted file mode 100644 index 267d9e7..0000000 --- a/test_label.py +++ /dev/null @@ -1,169 +0,0 @@ -import glob -import os - -import numpy as np -import pandas as pd -import pyfixest as pf - -THRESH = 0.95 -CLIP_Q = 0.995 # winsorize, don't drop - -DATA_GLOB = "data/*.csv" -TAGS_FILE = "game_tags.csv" -W = 0.02 # window half-width in score; also try 0.01 and 0.03 -MIN_REVIEWS = 500 - - -def load(pattern): - frames = [] - for path in glob.glob(pattern): - d = pd.read_csv(path, parse_dates=["date"])[["date", "positive", "negative"]].copy() - if d.empty: - print(f"skipping {path}: no rows") - continue - full = pd.date_range(d["date"].min(), d["date"].max(), freq="D") - d = (d.groupby("date")[["positive", "negative"]].sum() - .reindex(full, fill_value=0) - .rename_axis("date").reset_index()) - d["sheet"] = os.path.splitext(os.path.basename(path))[0] - frames.append(d) - if not frames: - raise SystemExit(f"No files found for {pattern}") - df = pd.concat(frames, ignore_index=True) - print(len(frames), "files loaded,", df["sheet"].nunique(), "games") - return df - -def add_groups(df): - tags = pd.read_csv(TAGS_FILE, dtype={"sheet": str})[["sheet", "group", "price"]].drop_duplicates("sheet") - tags["sheet"] = tags["sheet"].str.strip() - tags["group"] = tags["group"].astype(str).str.strip().str.lower() - tags["price"] = pd.to_numeric(tags["price"], errors="coerce") # "NA" / blank -> NaN - df["sheet"] = df["sheet"].astype(str) - df = df.merge(tags, on="sheet", how="left") - print("Games per group:", df.groupby("group")["sheet"].nunique().to_dict()) - missing = df.loc[df["group"].isna(), "sheet"].nunique() - if missing: - print(f"WARNING: {missing} games have no entry in {TAGS_FILE} and are dropped") - - - - return df - - - -def build(df): - cols = ["positive", "negative"] - df[cols] = df[cols].apply(pd.to_numeric, errors="coerce").fillna(0).abs().astype(int) - df = df.sort_values(["sheet", "date"]).reset_index(drop=True) - - df["R"] = df["positive"] + df["negative"] - g = df.groupby("sheet") - df["cum_pos"] = g["positive"].cumsum() - df["cum_tot"] = g["R"].cumsum() - df["score"] = df["cum_pos"] / df["cum_tot"].replace(0, np.nan) - - # lagged label state (what the store page showed at the start of the day) - g = df.groupby("sheet") - df["S_lag"] = g["score"].shift(1) - df["N_lag"] = g["cum_tot"].shift(1) - - # winsorize bursts per game - cap = df.groupby("sheet")["R"].transform(lambda x: x.quantile(CLIP_Q)) - df["R_w"] = df["R"].clip(upper=cap) - - # baseline: mean reviews/day over days -120..-30 (ends well before today) - df["base"] = (df.groupby("sheet")["R_w"] - .transform(lambda x: x.shift(30).rolling(90, min_periods=60).mean())) - df["y"] = df["R_w"] / df["base"].where(df["base"] > 0.2) # min baseline - df["ly"] = np.log1p(df["y"]) - return df.dropna(subset=["S_lag", "N_lag", "ly"]) - - -def rd(df, thresh=THRESH, w=W): - d = df[(df["N_lag"] >= MIN_REVIEWS) & ((df["S_lag"] - thresh).abs() <= w)].copy() - d["x"] = d["S_lag"] - thresh - d["above"] = (d["x"] >= 0).astype(int) - d["xa"] = d["x"] * d["above"] - # date FE = your cross-sectional normalization; cluster by game - m = pf.feols("ly ~ above + x + xa | date", data=d, vcov={"CRV1": "sheet"}) - return m -TIERS = [0.20, 0.40, 0.70, 0.80, 0.95] # label cutoffs (500+ review regime) - -def add_label(df): - df = df.sort_values(["sheet", "date"]).copy() - pct = (df["S_lag"] * 100).round() / 100 # Steam shows rounded % - df["L"] = np.searchsorted(TIERS, pct.values, side="right") - df.loc[df["N_lag"] < MIN_REVIEWS, "L"] = np.nan # ignore low-count regime - g = df.groupby("sheet")["L"] - df["dL"] = g.diff() - return df - -def stack(df, pre=56, post=56, gap=70, ncontrol=60, seed=0): - rng = np.random.default_rng(seed) - flips = df[df["dL"].fillna(0) != 0][["sheet", "date", "dL"]] - flip_by_game = {s: d["date"].values for s, d in flips.groupby("sheet")} - games = {s: d.set_index("date")["R_w"] for s, d in df.groupby("sheet")} - out = [] - for k, (_, e) in enumerate(flips.iterrows()): - t0 = e["date"] - # clean event: no other flip for this game within +-gap days - fl = flip_by_game[e["sheet"]] - if (np.abs((fl - np.datetime64(t0)) / np.timedelta64(1, "D")) <= gap).sum() > 1: - continue - cand = [] - for s, r in games.items(): - f = flip_by_game.get(s, np.array([], dtype="datetime64[ns]")) - clean = not (np.abs((f - np.datetime64(t0)) / np.timedelta64(1, "D")) <= gap).any() - if s == e["sheet"] or clean: - cand.append(s) - ctrl = [s for s in cand if s != e["sheet"]] - ctrl = list(rng.choice(ctrl, min(ncontrol, len(ctrl)), replace=False)) - for s in [e["sheet"]] + ctrl: - r = games[s] - base = r.loc[t0 - pd.Timedelta(days=120): t0 - pd.Timedelta(days=31)] - win = r.loc[t0 - pd.Timedelta(days=pre): t0 + pd.Timedelta(days=post - 1)] - if len(base) < 60 or len(win) < pre + post or base.mean() < 0.2: - continue - w = pd.DataFrame({"date": win.index, "ly": np.log1p(win.values / base.mean())}) - w["rel"] = (w["date"] - t0).dt.days - w["wk"] = w["rel"] // 7 - w["treated"] = int(s == e["sheet"]) - w["sheet"], w["stack"], w["dir"] = s, k, np.sign(e["dL"]) - out.append(w) - S = pd.concat(out, ignore_index=True) - S["gs"] = S["stack"].astype(str) + "_" + S["sheet"] - S["ds"] = S["stack"].astype(str) + "_" + S["date"].dt.strftime("%Y%m%d") - return S - -def event_study(S, direction): - d = S[S["dir"] == direction].copy() - d["post"] = (d["rel"] >= 0).astype(int) - m_avg = pf.feols("ly ~ treated:post | gs + ds", data=d, vcov={"CRV1": "sheet"}) - m_es = pf.feols("ly ~ i(wk, treated, ref=-1) | gs + ds", data=d, vcov={"CRV1": "sheet"}) - return m_avg, m_es - - - -if __name__ == "__main__": - import warnings - warnings.filterwarnings("ignore", category=UserWarning, module="pyfixest") - - df = add_label(build(add_groups(load(DATA_GLOB)))) - full = add_label(build(add_groups(load(DATA_GLOB)))) # build with no dropna - S = stack(full) - df = full.dropna(subset=["S_lag", "N_lag", "ly"]) # RD only - for direction in (1, -1): - m_avg, m_es = event_study(S, direction) - print("UP" if direction == 1 else "DOWN", m_avg.coef().iloc[0], m_avg.se().iloc[0]) - m_es.iplot() if False else print(m_es.tidy()[["Estimate", "Std. Error"]]) - - - - pd.set_option("display.float_format", lambda x: f"{x:.4f}") - pd.set_option("display.width", 220) - - for w in (0.01, 0.02, 0.03): - m = rd(df2, THRESH, w) - print(w, m.coef()["above"], m.se()["above"], m.pvalue()["above"]) - - results = [] \ No newline at end of file