I play Zenless Zone Zero, and like most gacha games, HoYoverse drops redemption codes for free currency. The annoying part? I kept missing codes.
So I built zenlesscodes.com - a simple aggregator that pulls from multiple sources and shows all active codes in one place.
The Stack
Nothing fancy:
- Python/Flask for the backend
- BeautifulSoup for scraping(respectfully) the Fandom wiki
- APScheduler for hourly background updates
- Gunicorn as the WSGI server
- Runs on a $3/month VPS
How It Works
The site fetches codes from 3 sources every hour:
def fetch_all_codes():
primary_codes = fetch_primary_api() # hoyo-codes API
github_codes = fetch_github() # community GitHub list
fandom_codes, expired = fetch_fandom() # wiki scraping
return aggregate_codes(primary_codes, github_codes, fandom_codes, expired)
The tricky part was deduplication and expiration detection. Different sources report the same codes with slightly different formatting, and the Fandom wiki is actually the most reliable for knowing when codes expire.
The Fandom Scraping
Fandom uses a MediaWiki backend, so instead of fighting Cloudflare, I just use their API:
def fetch_fandom_via_api():
params = {
"action": "parse",
"page": "Redemption_Code",
"format": "json",
"prop": "text",
}
response = requests.get(FANDOM_API_URL, params=params)
return response.json()["parse"]["text"]["*"]
Then I parse the HTML table, checking for bg-green (active) vs bg-red (expired) CSS classes on the status cells.
SEO Stuff
Threw in IndexNow pings so search engines know when content updates. It's literally one API call to Bing and they share it with the other search engines.
What I'd Do Differently
Honestly, not much. Flask might be overkill - this could probably be a static site generated by a cron job. But the Flask setup gives me a /api/codes endpoint for free, and the scheduling is cleaner.
Cost
- Domain: ~$10/year
- VPS: ~$3/month(Already had this, prepaid for 3 years)
- Cloudflare: Free tier
That's it. Launched a couple days ago.
zenlesscodes.com if you play ZZZ and want to stop missing codes.
Top comments (1)
This is a lifesaver for ZZZ players! Building this in a weekend is a great example of solving your own problem with code. Do you think you'll add a 'one-click copy' or a direct link to the HoYoverse redemption site next to make the UX even faster?