# How to Configure mega_data.json for AAA: Complete Setup Guide for Azeroth Auction Assassin

> Learn to configure mega_data.json for Azeroth Auction Assassin. Add API keys, set thread count, and customize scan windows for optimal performance with this guide.

- Repository: [FF14 Advanced Market Search/azerothauctionassassin](https://github.com/ff14-advanced-market-search/azerothauctionassassin)
- Tags: how-to-guide
- Published: 2026-03-01

---

**To configure [`mega_data.json`](https://github.com/ff14-advanced-market-search/azerothauctionassassin/blob/main/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`](https://github.com/ff14-advanced-market-search/azerothauctionassassin/blob/main/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`](https://github.com/ff14-advanced-market-search/azerothauctionassassin/blob/main/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`](https://github.com/ff14-advanced-market-search/azerothauctionassassin/blob/main/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`](https://github.com/ff14-advanced-market-search/azerothauctionassassin/blob/main/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_message` and `send_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`. The [`mega_alerts.py`](https://github.com/ff14-advanced-market-search/azerothauctionassassin/blob/main/mega_alerts.py) file uses this value to initialize `ThreadPoolExecutor(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_MIN` accepts -10 to 9; `SCAN_TIME_MAX` accepts 1 to 14. Defaults are `1` and `3`, 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 is `None`.

### Alert Behavior

- **REFRESH_ALERTS**: Boolean (`true`/`false`) determining whether to resend alerts on each scan cycle. Default is `true`.
- **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 `true` for 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`](https://github.com/ff14-advanced-market-search/azerothauctionassassin/blob/main/AzerothAuctionAssassinData/mega_data.json) and replace the placeholder values with your actual credentials.

```json
{
  "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:

1. **Initialization**: `MegaData.__init__` in [`utils/mega_data_setup.py`](https://github.com/ff14-advanced-market-search/azerothauctionassassin/blob/main/utils/mega_data_setup.py) reads the JSON and calls `__set_mega_vars` to set attributes like `self.THREADS`, `self.REGION`, and `self.WEBHOOK_URL`.

2. **API Construction**: The `construct_api_url` method uses `self.REGION` to determine the correct Blizzard API endpoint and selects the appropriate realm-ID mapping file (e.g., [`EU-wow-connected-realm-ids.json`](https://github.com/ff14-advanced-market-search/azerothauctionassassin/blob/main/EU-wow-connected-realm-ids.json)).

3. **Thread Pool**: In [`mega_alerts.py`](https://github.com/ff14-advanced-market-search/azerothauctionassassin/blob/main/mega_alerts.py), the scanner initializes `ThreadPoolExecutor(max_workers=self.THREADS)` at line 781, directly using your `MEGA_THREADS` value to control concurrency.

4. **Alert Timing**: The `SCAN_TIME_MIN`, `SCAN_TIME_MAX`, and `EXTRA_ALERTS` values drive the scheduling logic in [`mega_alerts.py`](https://github.com/ff14-advanced-market-search/azerothauctionassassin/blob/main/mega_alerts.py) (lines 755-782), determining exactly when auction scans trigger.

5. **Discord Output**: Alert methods reference `self.WEBHOOK_URL` to post messages. Boolean flags like `self.NO_LINKS` and `self.WOWHEAD_LINK` conditionally append WoW-Head URLs to embeds (e.g., line 162 in [`mega_alerts.py`](https://github.com/ff14-advanced-market-search/azerothauctionassassin/blob/main/mega_alerts.py)).

## Summary

- **[`mega_data.json`](https://github.com/ff14-advanced-market-search/azerothauctionassassin/blob/main/mega_data.json)** is the mandatory configuration file located at [`AzerothAuctionAssassinData/mega_data.json`](https://github.com/ff14-advanced-market-search/azerothauctionassassin/blob/main/AzerothAuctionAssassinData/mega_data.json) that controls every aspect of the Azeroth Auction Assassin bot.
- **Four keys are required**: `WOW_CLIENT_ID`, `WOW_CLIENT_SECRET`, `MEGA_WEBHOOK_URL`, and `WOW_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.py`](https://github.com/ff14-advanced-market-search/azerothauctionassassin/blob/main/utils/mega_data_setup.py) within the `__set_mega_vars` method, 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](https://develop.battle.net/) 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`](https://github.com/ff14-advanced-market-search/azerothauctionassassin/blob/main/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`](https://github.com/ff14-advanced-market-search/azerothauctionassassin/blob/main/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`](https://github.com/ff14-advanced-market-search/azerothauctionassassin/blob/main/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`](https://github.com/ff14-advanced-market-search/azerothauctionassassin/blob/main/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`](https://github.com/ff14-advanced-market-search/azerothauctionassassin/blob/main/mega_data.json) file does not contain conflicting values. The loader prints confirmation messages to the console indicating the source of each configuration value.