A strongly-typed .NET client for the public RustMaps API (v4).
Look up procedural and custom maps, request map generation, upload saves, and read your
generation limits — with Result<T> everywhere and first-class dependency injection.
dotnet add package RustMapsApi # the API client
dotnet add package RustMapsApi.Assets # optional monument icons1. Register the client (dependency injection). Provide your RustMaps API key:
using Microsoft.Extensions.DependencyInjection;
using RustMapsApi.V4;
services.AddRustMapsClientV4(options => options.ApiKey = "YOUR_API_KEY");2. Look up a map. Inject IRustMapsClient and check IsSuccess before reading Data:
public sealed class MapService(IRustMapsClient client)
{
public async Task<string?> GetUrlAsync(string mapId)
{
var result = await client.GetMapByIdAsync(mapId);
return result.IsSuccess ? result.Data!.Url : null;
}
}3. Search, generate, or upload:
// Structured search (zero-based page index)
var page = await client.SearchAsync(query, page: 0);
// Request generation of a procedural map
var status = await client.CreateMapAsync(request);
// Read your current generation limits
var limits = await client.GetLimitsAsync();You can also new up the client directly with your own HttpClient — see the
package README for the standalone usage and the full API surface.
RustMapsApi.Assets bundles RustMaps' monument icon artwork
(SVG) and maps each MonumentType to its icon — resolve a monument's icon straight from an API
response with no network call:
using RustMapsApi.V4.Assets;
foreach (var monument in map.Monuments ?? [])
{
if (MonumentAssets.TryGetAsset(monument.Type, out var asset))
File.WriteAllText(asset.FileName, asset.GetSvg());
}See the runnable Avalonia icon gallery that renders every bundled icon.
dotnet build RustMapsApi.slnx -c Release
dotnet testLive integration tests run only when RUSTMAPS_API_KEY is set; otherwise they are skipped.
Full guides and the API reference live on the
documentation site (built with DocFX). Start with
Getting Started, then see
the Client guide for the full API
surface. Runnable examples are in samples/.
- Author: HandyS11