- Introduction
- General Usage
- Endpoints
GET
/mcje/versions
GET
/mcje/versions/:version/block_states
GET
/mcje/versions/:version/commands
GET
/mcje/versions/:version/registries
GET
/mcje/versions/:version/vanilla-assets-tiny/tarball
GET
/mcje/versions/:version/vanilla-data/tarball
GET
/vanilla-mcdoc/symbols
GET
/vanilla-mcdoc/tarball
POST
/hooks/github
Introduction
The Spyglass Web API provides access to various information that is helpful for data pack/resource pack toolings. It uses misode/mcmeta and SpyglassMC/vanilla-mcdoc under the hood and provides a few advantages over using the GitHub API directly:
-
Accessible within regions that have blocked
raw.githubusercontent.com
access. -
Cache invalidation is handled through standard HTTP headers like
ETag
andIf-None-Match
; no more git commit sha hackery needed on client side. -
Cleaner?
General Usage
The Spyglass API root endpoint is https://api.spyglassmc.com/
. Clients must identify themselves using the User-Agent
HTTP header; requests without the User-Agent
header will be rejected.
Error Handling
All error responses (HTTP status code 4xx
and 5xx
) will include a JSON body with the following structure:
-
message
: (str
) A human readable message describing the error details.
Conditional Requests
All API endpoints include an ETag
header in the response. Clients should cache the value of ETag
along with the response body if possible, which can be achieved using the CacheStorage API on browsers. For future requests at the same endpoint, clients should include the value of ETag
in the If-None-Match
request header. A 304 Not Modified
response will be returned if the resource has not changed since the last response.