### Install steamreviews Library Source: https://github.com/woctezuma/download-steam-reviews/blob/master/README.md Installs the steamreviews library from PyPI, which is required to use the code for downloading Steam reviews. This command-line installation is straightforward. ```bash pip install steamreviews ``` -------------------------------- ### Download Reviews from AppID List File Source: https://github.com/woctezuma/download-steam-reviews/blob/master/README.md Downloads Steam reviews for a batch of game application IDs listed in a text file named 'idlist.txt'. Each appID should be on a new line in the file. If the file is not found, it might default to processing no IDs or raise an error. ```python import steamreviews steamreviews.download_reviews_for_app_id_batch() ``` -------------------------------- ### Batch Download for Multiple Games Source: https://context7.com/woctezuma/download-steam-reviews/llms.txt Efficiently downloads reviews for multiple game appIDs. The library automatically tracks completed downloads, manages rate limits across games, and saves individual review files. It can read appIDs from a list or a file. ```APIDOC ## Batch Download for Multiple Games ### Description Processes multiple game appIDs efficiently with automatic tracking of completed downloads and rate limit management. Reads from a text file or accepts a list directly. ### Method `steamreviews.download_reviews_for_app_id_batch(app_ids=None, user_agent=None, pause=0.1, timeout=10, *, verbose=False) ` ### Parameters * `app_ids` (list of int) - Optional - A list of Steam application IDs to download reviews for. If `None`, the function will attempt to read appIDs from a file named `idlist.txt`. * `user_agent` (str) - Optional - A custom user agent string for the API requests. * `pause` (float) - Optional - Time in seconds to pause between API requests. Defaults to 0.1 seconds. * `timeout` (int) - Optional - Time in seconds to wait for a response from the API. Defaults to 10 seconds. * `verbose` (bool) - Optional - If True, enables detailed progress output during the download. ### Usage **Method 1: Providing a list of appIDs** ```python import steamreviews app_ids = [329070, 573170, 239350] # SpyParty, Phantom Brigade, Spelunky steamreviews.download_reviews_for_app_id_batch(app_ids) ``` **Method 2: Reading appIDs from a file** 1. Create a file named `idlist.txt` in the same directory as your script. 2. Add one Steam appID per line in `idlist.txt`: ``` 329070 573170 239350 ``` 3. Call the function without arguments: ```python import steamreviews steamreviews.download_reviews_for_app_id_batch() ``` ### Automatic Features * **Resumable Downloads**: Skips previously processed games by checking an `idprocessed_on_YYYYMMDD.txt` file. * **Rate Limit Management**: Manages API rate limits automatically across all requested games. * **File Output**: Saves each game's reviews to `data/review_APPID.json`. * **Progress Updates**: Provides progress updates for each game being processed. ### Example Output ``` Loading idlist.txt Loading idprocessed_on_20251210.txt Downloading reviews for appID = 329070 [appID = 329070] expected #reviews = 1234 [appID = 329070] num_reviews = 1234 (expected: 1234) Downloading reviews for appID = 573170 [appID = 573170] expected #reviews = 5432 [appID = 573170] num_reviews = 5432 (expected: 5432) Game records written: 2 ``` ``` -------------------------------- ### Load Previously Downloaded Steam Reviews from Disk Source: https://context7.com/woctezuma/download-steam-reviews/llms.txt Loads review data from a local JSON file without making API calls. This is useful for analyzing previously downloaded data or resuming interrupted downloads. It allows access to individual reviews and query metadata. ```python import steamreviews # Load reviews from local JSON file app_id = 329070 review_dict = steamreviews.load_review_dict(app_id) # Check if data exists if review_dict['query_summary']['total_reviews'] == -1: print("No data found for this appID") else: print(f"Loaded {len(review_dict['reviews'])} reviews from disk") # Access individual reviews for review_id, review_data in review_dict['reviews'].items(): print(f"Review {review_id}:") print(f" Positive: {review_data['voted_up']}") print(f" Text: {review_data['review'][:100]}...") print(f" Playtime: {review_data['author']['playtime_forever']} minutes") print(f" Helpful votes: {review_data['votes_up']}") # Access query metadata summary = review_dict['query_summary'] print(f"\nTotal reviews: {summary['total_reviews']}") print(f"Positive: {summary['total_positive']}") print(f"Negative: {summary['total_negative']}") print(f"Score: {summary['review_score_desc']}") # Check download history via cursors print(f"\nDownload timestamps: {review_dict['cursors']}") ``` -------------------------------- ### Batch Download Steam Reviews with Custom Parameters Source: https://context7.com/woctezuma/download-steam-reviews/llms.txt Downloads reviews for multiple applications in a batch using custom request parameters. This function is useful for downloading reviews for a list of games with specific criteria like language and review type. ```python import steamreviews request_params = { 'language': 'english', 'review_type': 'all', 'purchase_type': 'steam' } steamreviews.download_reviews_for_app_id_batch( input_app_ids=[329070, 573170], chosen_request_params=request_params, verbose=True ) ``` -------------------------------- ### Advanced Filtering for Helpful Steam Reviews Source: https://context7.com/woctezuma/download-steam-reviews/llms.txt Downloads the most helpful reviews within a specific time window using custom request parameters. This allows for focused analysis of reviews based on helpfulness scores and date ranges, rather than all chronological reviews. ```python import steamreviews # Get most helpful reviews from the last 28 days # Note: This will only download a subset of reviews request_params = { 'filter': 'all', # Sort by helpfulness, not chronology 'day_range': '28' # Reviews from last 28 days } app_id = 573170 review_dict, query_count = steamreviews.download_reviews_for_app_id( app_id, chosen_request_params=request_params ) # Sort downloaded reviews by helpfulness score reviews_list = list(review_dict['reviews'].values()) sorted_by_helpful = sorted( reviews_list, key=lambda r: r.get('weighted_vote_score', 0), reverse=True ) print("Top 10 most helpful reviews:") for i, review in enumerate(sorted_by_helpful[:10], 1): print(f"{i}. Score: {review['weighted_vote_score']:.2f}") print(f" Votes up: {review['votes_up']}") print(f" {review['review'][:100]}...") print() ``` -------------------------------- ### Download Reviews with Filtering Parameters Source: https://context7.com/woctezuma/download-steam-reviews/llms.txt Downloads reviews for a specific game using filtering criteria such as language, sentiment, purchase type, or time windows. This allows for targeted data collection and analysis. ```APIDOC ## Download Reviews with Filtering Parameters ### Description Downloads reviews with specific filtering criteria such as language, sentiment (positive/negative), purchase type, or time windows. Useful for targeted analysis or data collection. ### Method `steamreviews.download_reviews_for_app_id(app_id, chosen_request_params=None, ...)` ### Parameters #### Query Parameters (`chosen_request_params` dictionary) * `language` (str) - Optional - Filters reviews by language (e.g., 'english'). * `review_type` (str) - Optional - Filters reviews by sentiment ('positive' or 'negative'). * `purchase_type` (str) - Optional - Filters reviews by purchase origin ('steam', 'key', or 'all'). Defaults to 'all'. * `filter` (str) - Optional - Sorts reviews. Options: 'recent' (most recent first) or 'updated' (most recently updated first). * `day_range` (str) - Optional - Specifies a time window in days for 'recent' or 'updated' filters (e.g., '28' for the last 28 days). ### Request Example ```python import steamreviews app_id = 573170 # Filter by language and sentiment request_params = { 'language': 'english', 'review_type': 'positive', 'purchase_type': 'steam' } review_dict, query_count = steamreviews.download_reviews_for_app_id( app_id, chosen_request_params=request_params ) print(f"Downloaded {len(review_dict['reviews'])} positive English reviews") # Filter by time range - recent reviews from last 28 days time_params = { 'filter': 'recent', 'day_range': '28' } review_dict, query_count = steamreviews.download_reviews_for_app_id( app_id, chosen_request_params=time_params, verbose=True ) # Filter by updated reviews - edited in the last 7 days update_params = { 'filter': 'updated', 'day_range': '7' } review_dict, query_count = steamreviews.download_reviews_for_app_id( 329070, chosen_request_params=update_params ) ``` ### Response #### Success Response (200) Returns a tuple containing: - `review_dict` (dict): A dictionary with the filtered reviews and query metadata. - `query_count` (int): The total number of API queries made. #### Response Example Example structure for `review_dict` (content will vary based on filters): ```json { "reviews": { ... }, "query_summary": { ... }, "cursors": { ... } } ``` ``` -------------------------------- ### Download Reviews with Custom Parameters (Language, Type, Store) Source: https://github.com/woctezuma/download-steam-reviews/blob/master/README.md Downloads Steam reviews for a specific game with custom request parameters, including language, review type (positive/negative/all), and store type. Be cautious when changing parameters like 'review_type' as it may affect total review counts and output filenames. ```python import steamreviews request_params = dict() # Reference: https://partner.steamgames.com/doc/store/localization#supported_languages request_params['language'] = 'english' # Reference: https://partner.steamgames.com/doc/store/getreviews request_params['review_type'] = 'positive' request_params['purchase_type'] = 'steam' app_id = 573170 review_dict, query_count = steamreviews.download_reviews_for_app_id(app_id, chosen_request_params=request_params) ``` -------------------------------- ### Resume Interrupted Steam Review Downloads Source: https://context7.com/woctezuma/download-steam-reviews/llms.txt Resumes downloading Steam reviews from where a previous download stopped using cursor tracking. It automatically merges new reviews with existing ones, updates query summaries, saves cursor positions, and detects redundant reviews. ```python import steamreviews # Initial download (may be interrupted) app_id = 573170 review_dict, query_count = steamreviews.download_reviews_for_app_id(app_id) # Later, resume from a specific cursor # Load existing data first to check cursors review_dict = steamreviews.load_review_dict(app_id) print(f"Available cursors: {review_dict['cursors'].keys()}") # Resume from a specific cursor position last_cursor = list(review_dict['cursors'].keys())[-1] review_dict, query_count = steamreviews.download_reviews_for_app_id( app_id, start_cursor=last_cursor, # Resume from last saved position verbose=True ) # The function automatically: # - Merges new reviews with existing ones (no duplicates) # - Updates query_summary with current totals # - Saves cursor positions for future resumption # - Detects redundant reviews to avoid infinite loops ``` -------------------------------- ### Download Reviews for a Single Game Source: https://context7.com/woctezuma/download-steam-reviews/llms.txt Downloads all Steam reviews for a specific game using its Steam appID. The function returns a dictionary containing all reviews, query metadata, and the number of API queries executed. Reviews are automatically saved locally as JSON files. ```APIDOC ## Download Reviews for a Single Game ### Description Downloads all Steam reviews for a specific game identified by its Steam appID. Returns a dictionary containing all reviews and query metadata, along with the number of API queries executed. Reviews are automatically saved locally as JSON files. ### Method `steamreviews.download_reviews_for_app_id(app_id, chosen_request_params=None, user_agent=None, pause=0.1, timeout=10, *, verbose=False) ` ### Parameters #### Path Parameters * `app_id` (int) - Required - The Steam application ID of the game. #### Query Parameters * `chosen_request_params` (dict) - Optional - A dictionary of filtering parameters. See details in the 'Download reviews with filtering parameters' section. * `user_agent` (str) - Optional - A custom user agent string for the API requests. * `pause` (float) - Optional - Time in seconds to pause between API requests to respect rate limits. Defaults to 0.1 seconds. * `timeout` (int) - Optional - Time in seconds to wait for a response from the API. Defaults to 10 seconds. * `verbose` (bool) - Optional - If True, enables detailed progress output during the download. ### Request Example ```python import steamreviews # Download all reviews for Phantom Brigade (appID: 573170) app_id = 573170 review_dict, query_count = steamreviews.download_reviews_for_app_id(app_id) # Access the downloaded data print(f"Total queries executed: {query_count}") print(f"Reviews downloaded: {len(review_dict['reviews'])}") print(f"Expected total: {review_dict['query_summary']['total_reviews']}") ``` ### Response #### Success Response Returns a tuple containing: - `review_dict` (dict): A dictionary with review data, query summary, and cursors. - `query_count` (int): The total number of API queries made. #### Response Example ```json { "reviews": { "123456789": { "recommendationid": "123456789", "author": {"steamid": "...", "playtime_forever": 1234}, "language": "english", "review": "This is a great game!", "timestamp_created": 1609459200, "timestamp_updated": 1609459200, "voted_up": true, "votes_up": 10, "votes_funny": 2, "weighted_vote_score": 0.95 } }, "query_summary": { "total_reviews": 5432, "total_positive": 4891, "total_negative": 541, "review_score": 9, "review_score_desc": "Overwhelmingly Positive" }, "cursors": {"*": "Mon Dec 10 16:45:00 2025"} } ``` #### File Output Reviews are automatically saved to: `data/review_APPID.json` ``` -------------------------------- ### Download Reviews for Multiple AppIDs (Batch) Source: https://github.com/woctezuma/download-steam-reviews/blob/master/README.md Downloads Steam reviews for a list of game application IDs. This function processes multiple games efficiently in a single operation. It takes a list of integers representing appIDs as input. ```python import steamreviews app_ids = [329070, 573170] steamreviews.download_reviews_for_app_id_batch(app_ids) ``` -------------------------------- ### Batch Download Steam Reviews for Multiple Games - Python Source: https://context7.com/woctezuma/download-steam-reviews/llms.txt Efficiently processes multiple game appIDs for review downloads. The function automatically manages API rate limits, tracks completed downloads to avoid re-processing, and saves each game's reviews to a separate JSON file. It can read appIDs from a list or a file. ```python import steamreviews # Method 1: Download reviews for a list of games app_ids = [329070, 573170, 239350] # SpyParty, Phantom Brigade, Spelunky steamreviews.download_reviews_for_app_id_batch(app_ids) # Method 2: Read appIDs from a file named 'idlist.txt' # Create idlist.txt with one appID per line: # 329070 # 573170 # 239350 steamreviews.download_reviews_for_app_id_batch() # The function automatically: # - Skips previously processed games (tracked in idprocessed_on_YYYYMMDD.txt) # - Manages API rate limits across all games # - Saves each game's reviews to data/review_APPID.json # - Provides progress updates for each game ``` -------------------------------- ### Download Steam Reviews with Filtering Parameters - Python Source: https://context7.com/woctezuma/download-steam-reviews/llms.txt Downloads Steam reviews for a specific game while applying filtering criteria such as language, sentiment (positive/negative), purchase type, or time windows. This allows for targeted data collection. The function supports parameters like 'filter', 'day_range', and 'review_type'. ```python import steamreviews # Filter by language and sentiment request_params = { 'language': 'english', # Only English reviews 'review_type': 'positive', # Only positive reviews 'purchase_type': 'steam' # Only Steam purchases (not keys) } app_id = 573170 review_dict, query_count = steamreviews.download_reviews_for_app_id( app_id, chosen_request_params=request_params ) print(f"Downloaded {len(review_dict['reviews'])} positive English reviews") # Filter by time range - recent reviews from last 28 days time_params = { 'filter': 'recent', # Sort by most recent first 'day_range': '28' # Last 28 days only } review_dict, query_count = steamreviews.download_reviews_for_app_id( app_id, chosen_request_params=time_params, verbose=True # Enable detailed progress output ) # Filter by updated reviews - edited in the last 7 days update_params = { 'filter': 'updated', 'day_range': '7' } review_dict, query_count = steamreviews.download_reviews_for_app_id( 329070, # SpyParty appID chosen_request_params=update_params ) ``` -------------------------------- ### Download Most Helpful Reviews within a Time Window Source: https://github.com/woctezuma/download-steam-reviews/blob/master/README.md Downloads a limited number of the most helpful Steam reviews for a game within a specified time window (e.g., last 28 days). The 'filter' set to 'all' sorts reviews by helpfulness, not chronology. This method is suitable for fetching a sample of top reviews. ```python import steamreviews request_params = dict() # Reference: https://partner.steamgames.com/doc/store/getreviews request_params['filter'] = 'all' # reviews are sorted by helpfulness instead of chronology request_params['day_range'] = '28' # focus on reviews which were published during the past four weeks app_id = 573170 review_dict, query_count = steamreviews.download_reviews_for_app_id(app_id, chosen_request_params=request_params) ``` -------------------------------- ### Load Review Dictionary for One AppID Source: https://github.com/woctezuma/download-steam-reviews/blob/master/README.md Loads a dictionary containing Steam reviews for a single game identified by its appID. This function retrieves already downloaded review data without making new API calls. ```python import steamreviews app_id = 329070 review_dict = steamreviews.load_review_dict(app_id) ``` -------------------------------- ### Download Reviews for One AppID Source: https://github.com/woctezuma/download-steam-reviews/blob/master/README.md Downloads all available Steam reviews for a specific game identified by its appID. This function returns the review data as a dictionary and the count of API queries made. ```python import steamreviews app_id = 573170 review_dict, query_count = steamreviews.download_reviews_for_app_id(app_id) ``` -------------------------------- ### Download Recent Reviews within a Time Window Source: https://github.com/woctezuma/download-steam-reviews/blob/master/README.md Downloads Steam reviews for a game that were posted within a specific recent time window (e.g., last 28 days). The 'filter' is set to 'recent' to prioritize chronologically new reviews. This is useful for tracking recent player feedback. ```python import steamreviews request_params = dict() request_params['filter'] = 'recent' request_params['day_range'] = '28' app_id = 573170 review_dict, query_count = steamreviews.download_reviews_for_app_id(app_id, chosen_request_params=request_params) ``` -------------------------------- ### Download Updated Reviews within a Time Window Source: https://github.com/woctezuma/download-steam-reviews/blob/master/README.md Downloads Steam reviews for a game that have been updated within a specific recent time window (e.g., last 28 days). The 'filter' is set to 'updated' to retrieve reviews that have seen recent modifications. This helps in monitoring how feedback evolves over time. ```python import steamreviews request_params = dict() request_params['filter'] = 'updated' request_params['day_range'] = '28' app_id = 573170 review_dict, query_count = steamreviews.download_reviews_for_app_id(app_id, chosen_request_params=request_params) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.