Add authenticated developer API for public stats and streaming data - #201
Open
Zulut30 wants to merge 1 commit into
Open
Add authenticated developer API for public stats and streaming data#201Zulut30 wants to merge 1 commit into
Zulut30 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This adds a versioned Developer API for the public aggregate data already used by HSGuru's Meta, Archetype, Decks, and Streaming pages.
Developers can sign in with Battle.net, create a key from Profile Settings, and use the documented JSON endpoints without scraping rendered pages.
API surface
GET /api/v1/metaGET /api/v1/archetypesGET /api/v1/archetypes/:archetypeGET /api/v1/decksGET /api/v1/streamersGET /api/v1/streamers/:twitch_login/decksGET /api/v1/streamer-decksGET /api/v1/streams/liveThe endpoints support the corresponding public filters, including format, period, rank, opponent class, coin state, minimum sample sizes, card inclusion/exclusion, streamer rank and activity filters, sorting, and bounded pagination.
Authentication and safety
Authorization: BearerorX-API-Keyand are limited to 60 requests per minute per key by default.This intentionally exposes public aggregate data only. Personal games and the premium-only
regionandforce_freshfilters are not part of the v1 contract.The rate limiter is node-local, consistent with the application's current in-memory cache model. Its module boundary allows a distributed backend to be introduced later without changing the API plugs or public contract.
UI and documentation
/api-docswith endpoint navigation, authentication examples, parameter tables, response conventions, rate-limit headers, and error semantics.API Docslink under the existing Misc menu.Implementation notes
DeckTrackerandStreamingquery paths instead of introducing a second statistics pipeline.Validation
mix compilemix assets.build/api-docsgit diff --check