How to Configure mega_data.json for AAA: Complete Setup Guide for Azeroth Auction Assassin
To configure mega_data.json for Azeroth Auction Assassin (AAA), populate the four required Blizzard API and Discord keys, then adjust optional runtime settings like thread count and scan windows to match your hardware and schedule.
The mega_data.json file serves as the central configuration hub for the ff14-advanced-market-search/azerothauctionassassin repository. When the MegaData class initializes in utils/mega_data_setup.py, it loads this JSON file to determine which realms to scan, how many threads to spawn, and where to send Discord alerts. Properly configuring this file ensures the sniper bot connects to Blizzard's API, respects your rate limits, and delivers accurate market alerts without unnecessary noise.
Understanding the mega_data.json Structure
The configuration file lives at AzerothAuctionAssassinData/mega_data.json and contains a flat JSON object where each key maps to an internal attribute. The constructor in utils/mega_data_setup.py (lines 33-38) attempts to open this file, falling back to environment variables if the file is absent. Once loaded, the __set_mega_vars method (lines 44-143) validates required keys, applies type coercion, and sets defaults for optional parameters.
Required Configuration Keys
Four keys are mandatory. If any are missing, the MegaData constructor raises an exception immediately.
- WOW_CLIENT_ID: Your Blizzard OAuth client ID. Used in
check_access_token()(lines 55-62) to authenticate with the Battle.net API. - WOW_CLIENT_SECRET: Your Blizzard OAuth client secret. Paired with the client ID for token exchange.
- MEGA_WEBHOOK_URL: The Discord webhook URL where snipe alerts are posted. Consumed by
send_discord_messageandsend_discord_embed. - WOW_REGION: Target game region. Accepts
"EU","NA","NACLASSIC","NASODCLASSIC","EUCLASSIC", or"EUSODCLASSIC". This value determines which realm-ID mapping file is loaded and which Blizzard API endpoint is constructed.
Optional Runtime Settings
Tune these parameters to control performance, timing, and alert verbosity.
Performance and Threading
- MEGA_THREADS: Maximum parallel threads for auction scanning. Default is
48. Themega_alerts.pyfile uses this value to initializeThreadPoolExecutor(max_workers=self.THREADS)at line 781.
Scan Scheduling
- SCAN_TIME_MIN and SCAN_TIME_MAX: Define the minute window (relative to each hour) when scans may execute.
SCAN_TIME_MINaccepts -10 to 9;SCAN_TIME_MAXaccepts 1 to 14. Defaults are1and3, meaning scans trigger between 1 and 3 minutes past the hour. - EXTRA_ALERTS: JSON array string of additional minute offsets for extra alert cycles (e.g.,
"[5,15]"). Default isNone.
Alert Behavior
- REFRESH_ALERTS: Boolean (
true/false) determining whether to resend alerts on each scan cycle. Default istrue. - SHOW_BID_PRICES: Boolean to include current bid prices in Discord messages. Default is
false. - NO_LINKS: Boolean to suppress WoW-Head links in alerts. Default is
false. - WOWHEAD_LINK: Boolean to show WoW-Head links (retail only). Default is
truefor retail regions.
Regional and Faction Filters
- NO_RUSSIAN_REALMS: Boolean to exclude Russian realms from scans. Default is
true. - FACTION: For Classic regions, limit scans to
"horde","alliance","booty bay", or"all". Default is"all".
Debugging and Advanced Features
- DEBUG: Boolean for verbose console output. Default is
false. - USE_POST_MIDNIGHT_ILVL: Boolean to enable post-midnight item level calculations requiring extra Raidbots data. Default is
true. - TOKEN_PRICE: Gold threshold (integer) to trigger token-price alerts. Default is
1.
Sample mega_data.json Configuration
Copy the template below into AzerothAuctionAssassinData/mega_data.json and replace the placeholder values with your actual credentials.
{
"WOW_CLIENT_ID": "your-blizzard-client-id",
"WOW_CLIENT_SECRET": "your-blizzard-client-secret",
"MEGA_WEBHOOK_URL": "https://discord.com/api/webhooks/your-webhook-url",
"WOW_REGION": "EU",
"MEGA_THREADS": 32,
"SCAN_TIME_MIN": -5,
"SCAN_TIME_MAX": 10,
"REFRESH_ALERTS": true,
"SHOW_BID_PRICES": true,
"EXTRA_ALERTS": "[5,15]",
"NO_RUSSIAN_REALMS": false,
"USE_POST_MIDNIGHT_ILVL": true,
"DEBUG": false,
"NO_LINKS": false,
"TOKEN_PRICE": 200000,
"WOWHEAD_LINK": true,
"FACTION": "all"
}
When the application starts, the console will log confirmation messages such as loading MEGA_THREADS from AzerothAuctionAssassinData/mega_data.json, verifying that each key was parsed correctly.
How Configuration Values Propagate Through AAA
Understanding the data flow helps troubleshoot issues:
-
Initialization:
MegaData.__init__inutils/mega_data_setup.pyreads the JSON and calls__set_mega_varsto set attributes likeself.THREADS,self.REGION, andself.WEBHOOK_URL. -
API Construction: The
construct_api_urlmethod usesself.REGIONto determine the correct Blizzard API endpoint and selects the appropriate realm-ID mapping file (e.g.,EU-wow-connected-realm-ids.json). -
Thread Pool: In
mega_alerts.py, the scanner initializesThreadPoolExecutor(max_workers=self.THREADS)at line 781, directly using yourMEGA_THREADSvalue to control concurrency. -
Alert Timing: The
SCAN_TIME_MIN,SCAN_TIME_MAX, andEXTRA_ALERTSvalues drive the scheduling logic inmega_alerts.py(lines 755-782), determining exactly when auction scans trigger. -
Discord Output: Alert methods reference
self.WEBHOOK_URLto post messages. Boolean flags likeself.NO_LINKSandself.WOWHEAD_LINKconditionally append WoW-Head URLs to embeds (e.g., line 162 inmega_alerts.py).
Summary
mega_data.jsonis the mandatory configuration file located atAzerothAuctionAssassinData/mega_data.jsonthat controls every aspect of the Azeroth Auction Assassin bot.- Four keys are required:
WOW_CLIENT_ID,WOW_CLIENT_SECRET,MEGA_WEBHOOK_URL, andWOW_REGION. Missing any will cause the application to raise an exception immediately upon startup. - Optional settings allow fine-tuning of thread count (
MEGA_THREADS), scan windows (SCAN_TIME_MIN/MAX), alert verbosity (REFRESH_ALERTS,SHOW_BID_PRICES), and regional filters (NO_RUSSIAN_REALMS,FACTION). - Validation occurs in
utils/mega_data_setup.pywithin the__set_mega_varsmethod, which coerces types, applies defaults, and confirms required fields are present.
Frequently Asked Questions
Where do I obtain the required Blizzard API credentials?
You must register an application at the Blizzard Developer Portal to receive a WOW_CLIENT_ID and WOW_CLIENT_SECRET. These OAuth credentials are required for the MegaData class to authenticate with the Battle.net API and fetch auction data. Without valid credentials, the check_access_token() method in utils/mega_data_setup.py will fail to generate a valid access token.
What happens if I omit optional settings in mega_data.json?
The __set_mega_vars method in utils/mega_data_setup.py automatically applies sensible defaults for any omitted optional keys. For example, MEGA_THREADS defaults to 48, SCAN_TIME_MIN defaults to 1, and REFRESH_ALERTS defaults to true. The loader also falls back to environment variables if a key is missing from the JSON file entirely, providing flexibility for containerized deployments.
How do I exclude Russian realms from my auction scans?
Set the NO_RUSSIAN_REALMS key to true in your mega_data.json file. This boolean flag is processed by the MegaData class and used during realm list generation to filter out Russian-connected realms before scanning begins. The default value is true, meaning Russian realms are excluded by default unless you explicitly set this to false.
Can I use environment variables instead of the mega_data.json file?
Yes. The MegaData constructor in utils/mega_data_setup.py is designed to fall back to environment variables when the JSON file is missing or when specific keys are omitted. If you prefer environment-based configuration, simply export variables matching the key names (e.g., export WOW_CLIENT_ID=your_id) and ensure the mega_data.json file does not contain conflicting values. The loader prints confirmation messages to the console indicating the source of each configuration value.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →