Skip to content

Conversation

@anonymort
Copy link
Contributor

Summary

  • Adds username availability checking for Battle.net via Overwatch player search API
  • Uses generic_validate to check JSON response: empty array = available, non-empty = taken
  • Includes BattleTag username pre-validation (3-12 chars, starts with letter, alphanumeric only)

Implementation Details

Endpoint: https://overwatch.blizzard.com/en-us/search/account-by-name/{username}

API behavior:

  • 200 with [{...player data...}] → Username taken
  • 200 with [] → Username available

File: user_scanner/user_scan/gaming/battlenet.py

Test Results

Username Expected Result
Faker Taken Taken
Blizzard Taken Taken
zzqnoexist Available Available
ab Error (too short) Error
123test Error (starts with number) Error

Caveats (documented in code)

  • This checks Overwatch profiles specifically via the Blizzard player search
  • A Battle.net account may exist without an Overwatch profile (and vice versa)
  • BattleTag discriminators (#1234) are stripped if provided

Closes #97

Add support for checking username availability on Battle.net via the
Overwatch player search API. The endpoint returns a JSON array of
matching players - empty array means available, non-empty means taken.

Includes username pre-validation for BattleTag rules:
- 3-12 characters
- Must start with a letter
- Only letters and numbers allowed
- Strips #1234 discriminator if provided

Note: This checks Overwatch profiles specifically. Some Battle.net
accounts may not have Overwatch profiles.

Closes kaifcodec#97
@kaifcodec
Copy link
Owner

@anonymort Thanks for the PR. We’ll test it locally against edge cases, make any necessary adjustments, and then merge it.

@kaifcodec kaifcodec requested review from VamatoHD and json-hunter07 and removed request for json-hunter07 December 29, 2025 02:12
@json-hunter07
Copy link
Collaborator

I don't know whether it is needed or not because Battle.net doesn't use unique usernames, they assign a tag by themselves at the end to make it unique.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add username support for Battle.net

3 participants