Thanks to visit codestin.com
Credit goes to github.com

Skip to content

furina-2/game-codes

Repository files navigation

Game Codes API

banner

Status WispByte Render Python FastAPI

Live code counts:

WuWa NTE Endfield

Auto-scrapes game redeem codes from news sites. Always up-to-date, refreshed hourly.

Endpoints:

Platform URL
WispByte (primary) https://game-codes.wisp.uno
Render https://game-codes.onrender.com
Vercel https://game-codes-psi.vercel.app

All examples below use the WispByte URL. Replace with any deployment URL as needed.

Quick Start

# List all games
curl https://game-codes.wisp.uno/games

# Get verified codes for a game
curl https://game-codes.wisp.uno/codes?game=nte

Games

Slug Game Description Active Codes
wuwa Wuthering Waves Open-world action RPG by Kuro Games 1
nte Neverness to Everness Urban fantasy open-world RPG 6
endfield Arknights: Endfield 3D sci-fi RPG, sequel to Arknights 3

Codes expire from source sites over time. The API auto-detects and removes expired codes hourly.

API Reference

GET /health

Check if the service is alive.

curl https://game-codes.wisp.uno/health
{"status": "ok"}

GET /games

List all supported games.

curl https://game-codes.wisp.uno/games
{
  "wuwa": {
    "name": "Wuthering Waves",
    "description": "Open-world action RPG by Kuro Games"
  },
  "nte": {
    "name": "Neverness to Everness",
    "description": "Urban fantasy open-world RPG"
  },
  "endfield": {
    "name": "Arknights: Endfield",
    "description": "3D sci-fi RPG, sequel to Arknights"
  }
}

GET /codes?game={slug}

Returns verified and unverified codes for a game.

Parameters:

  • game (required) — one of: wuwa, nte, endfield

Response fields:

  • codes — confirmed working, safe to redeem
  • unverified — reported on news sites, not yet confirmed
  • rewards — reward description (auto-extracted from table sources; may be empty for non-table sources)
curl https://game-codes.wisp.uno/codes?game=nte
{
  "game": "nte",
  "codes": [
    {
      "id": 74,
      "code": "LACRIMOSA0603",
      "rewards": "30 Annulith, 20,000 Fons",
      "source": "scraper"
    },
    {
      "id": 76,
      "code": "NTEFUNGAME",
      "rewards": "10,000 Fons",
      "source": "scraper"
    },
    {
      "id": 85,
      "code": "NTEWINFONS",
      "rewards": "10,000 Fons",
      "source": "scraper"
    },
    {
      "id": 90,
      "code": "NTENENE",
      "rewards": "10,000 Clicky Fries, 10 DynamiK",
      "source": "scraper"
    },
    {
      "id": 101,
      "code": "NTEGIFT",
      "rewards": "50 Annulith, 5 Rising Hunter Guides, 5 Light Dye",
      "source": "scraper"
    },
    {
      "id": 102,
      "code": "NTEFREE",
      "rewards": "30,000 Fons",
      "source": "scraper"
    }
  ],
  "unverified": []
}

Auth endpoints

Write operations require a Bearer token. Set API_TOKEN on the server, then pass it in requests:

curl -H "Authorization: Bearer YOUR_TOKEN" ...

POST /codes

Manually add a code.

curl -X POST https://game-codes.wisp.uno/codes \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"code": "MYCODE123", "game": "wuwa"}'
{"id": 42, "code": "MYCODE123"}

DELETE /codes/{id}

Remove a code by its ID.

curl -X DELETE https://game-codes.wisp.uno/codes/42 \
  -H "Authorization: Bearer YOUR_TOKEN"
{"ok": true}

POST /update-codes

Force an immediate scrape of all source sites.

curl -X POST https://game-codes.wisp.uno/update-codes \
  -H "Authorization: Bearer YOUR_TOKEN"
{"ok": true}

POST /check-codes

Re-verify codes against game redemption APIs (only for games that support it).

curl -X POST https://game-codes.wisp.uno/check-codes \
  -H "Authorization: Bearer YOUR_TOKEN"
{"ok": true}

Scheduling

The server runs these jobs automatically:

Job When What it does
update-codes Every hour Scrapes news sites for new codes, expires codes no longer found
check-codes Daily 1:30 AM (Asia/Taipei) Re-verifies known codes against game redemption APIs

Vercel skips the built-in scheduler (no background daemons). Use an external cron service (e.g. cron-job.org) or GitHub Actions to call POST /update-codes hourly, or rely on Render/WispByte to scrape and populate the shared data.

Error Responses

Status Code When
404 Unknown game Invalid game slug
401 Invalid token Missing or wrong Bearer token
409 Code already exists Duplicate on POST /codes
429 Rate limit exceeded Too many requests (see below)

Rate Limits

Endpoints Limit Window
GET /health, GET /games, GET /codes 30 requests per 60 seconds per IP
POST / DELETE (auth required) unlimited

Exceeding the limit returns 429:

{"error": "Rate limit exceeded", "retry_after": 60}

Source Sites

Game Sources
WuWa GamesRadar, GameRant, PCGamesN, wuthering.gg
NTE GamesRadar, Game8, GameWith, Polygon
Endfield GamesRadar, Game8

Self-Host

git clone https://github.com/furina-2/game-codes
cd game-codes

python -m venv .venv
.venv\Scripts\activate  # Windows
pip install -r requirements.txt

# Create .env with:
#   API_TOKEN=your_token
#   PORT=1078

python run.py

Requires Python 3.11+. No database — everything stored in seed.json.

FAQ

How often are codes updated?
Scraping runs every hour via the built-in scheduler. Expired codes are automatically removed in the same pass.

Why are some codes in unverified?
Codes start as unverified when first scraped. The daily check re-verifies them; games without web redemption are immediately marked OK.

Can I add my own codes?
Yes — POST /codes with a Bearer token. See the Auth endpoints section above.

Why isn't a code I found showing up?
The scraper has a noise filter that blocks common words, duplicate halves (e.g. NTEFUNGAMENTEFUNGAME), product IDs (504980102FKGOVNS), and single words shorter than 4 characters. It only extracts uppercase alphanumeric patterns from tables, lists, and article text.

How long do codes stay active?
As long as they appear on at least one source site. The hourly scrape checks all sources — any code no longer found anywhere gets expired to NOT_OK.

Why does the API return fewer codes than a source site lists?
The deduplication merge and noise filter may reject some entries. Also, codes must appear in structured HTML (tables, lists, article bodies) — plain text buried in comments or scripts is skipped.

No database?
Correct. Everything is stored in seed.json with atomic writes and automatic backup recovery. No Postgres, no SQLite.

Notes

  • Primary: WispByte (game-codes.wisp.uno) — always hot, no cold start.
  • Fallback: Render (game-codes.onrender.com) — free tier may spin down after inactivity; first request takes 3-5s to wake up.
  • Vercel: (game-codes-psi.vercel.app) — no background scheduler; relies on webhook from Render's scrape.
  • Codes are stored as data.json (gitignored) seeded from seed.json (tracked). Data resets on fresh deploy but the hourly scheduler re-populates it.
  • The scraper filters noise (nav text, common words, product IDs) and detects duplicate patterns automatically.

About

Scrapes game redeem codes from news sites and exposes them via REST API

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Contributors