Unofficial Node.js clients for the Rust Maps API.
All types and clients are automatically generated from Rust Maps' OpenAPI spec using Hey API.
This project relies on Rust Maps' OpenAPI spec to automatically generate clients. However, as of October 2025, the spec currently has a lot of issues, making the generated clients unreliable. Use at your own risk.
Examples of issues include the following. Note that these are just examples from my own usage in projects, and there may be many more.
MonumentTypesandBiomeTypesare typed asintegerinstead ofstring. A patch has been configured in this project to fix this.Search.searchRawrequest schema has a lot of incorrectly typed fields, making it practically unusable.largeMonumentsis typed asMonumentTypes, though not allMonumentTypesare valid values for this field. This was also (partly) patched by examining how requests are made on the Rust Maps website.
npm install @maxijonson/rust-maps-apiImport the client classes you need from the package. Currently, you can use one of the following clients:
SearchMiscMapsSubscriptionRequiredMapsUpload
// 1. Import the needed client classes
import { Search, Misc, Maps, SubscriptionRequired, MapsUpload } from "@maxijonson/rust-maps-api";
// 2. Use the clients
// Example: Search for maps with a size of exactly 4000
const { data, error } = await Search.searchRaw({
query: {
page: 0,
customMaps: false,
},
body: {
searchQuery: {
size: {
min: 4000,
max: 4000,
},
},
},
auth: process.env.RUST_MAPS_API_KEY,
});
console.log(data, error);See Rust Maps API documentation.
Clone the repository and install dependencies:
git clone https://github.com/maxijonson/rust-maps-api.git
cd rust-maps-api
npm installTo generate the clients, run:
npm run generate(Only for maintainers) Automatically update the clients and publish them to NPM with one command:
# This bumps the version, builds the project, pushes to git and publishes to NPM
npm version patch # or minor or majorApart from configuration, everything is automatically generated from the OpenAPI spec. No manual changes are made to the generated code. If you find the generated clients are outdated, you can let me know and I'll run the generation script again and publish them to NPM. This project doesn't do anything fancy that you wouldn't be able to do yourself with Hey API.
If you do contribute however, please don't waste your time updating the generated code, as it will be overwritten when I publish your changes to NPM. If something is wrong in the generated code, please try to fix it via the openapi-ts.config.ts configuration file, not in the generated code.
Though I prefer you not include changes to generated code in your pull requests, you may still do. However, just know that if your PR is merged, any changes to generated code will automatically be overwritten the next time I publish to NPM.