Scalar.AspNetCore 1.2.21
Scalar .NET API Reference Integration
This .NET package Scalar.AspNetCore provides an easy way to render beautiful API references based on OpenAPI/Swagger documents.
Made possible by the wonderful work of @captainsafia on building the integration and docs written for the Scalar & .NET integration. Thanks to @xC0dex for making it awesome.

Usage
- Install the package
dotnet add package Scalar.AspNetCore --version 1.2.*
Note
We release new versions frequently to bring you the latest features and bug fixes. To reduce the noise in your project file, we recommend using a wildcard for the patch version, e.g., 1.2.*.
- Add the using directive
using Scalar.AspNetCore;
- Configure your application
Add the following lines to your Program.cs for .NET 9:
builder.Services.AddOpenApi();
if (app.Environment.IsDevelopment())
{
app.MapOpenApi();
app.MapScalarApiReference();
}
or for .NET 8 with Swashbuckle:
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
if (app.Environment.IsDevelopment())
{
app.UseSwagger(options =>
{
options.RouteTemplate = "openapi/{documentName}.json";
});
app.MapScalarApiReference();
}
That's it! 🎉 Now you will see the Scalar UI when using the defaults by navigating to /scalar/v1 in your browser.
Configuration
The MapScalarApiReference method has an optional parameter that you can use to customize the behavior of the Scalar UI:
// Fluent API
app.MapScalarApiReference(options =>
{
options
.WithTitle("My custom API")
.WithTheme(ScalarTheme.Mars)
.WithSidebar(false)
.WithDefaultHttpClient(ScalarTarget.CSharp, ScalarClient.HttpClient)
.WithPreferredScheme("ApiKey")
.WithApiKeyAuthentication(x => x.Token = "my-api-key");
});
// Object initializer
app.MapScalarApiReference(options =>
{
options.Title = "My custom API";
options.Theme = ScalarTheme.Mars;
options.ShowSidebar = false;
options.DefaultHttpClient = new(ScalarTarget.CSharp, ScalarClient.HttpClient);
options.Authentication = new ScalarAuthenticationOptions
{
PreferredSecurityScheme = "ApiKey",
ApiKey = new ApiKeyOptions
{
Token = "my-api-key"
}
};
});
For more possible options and their default values, check out the ScalarOptions.cs class.
It is also possible to configure the options via dependency injection, using the options pattern:
builder.Services.Configure<ScalarOptions>(options => options.Title = "My custom API");
// or
builder.Services.AddOptions<ScalarOptions>().BindConfiguration("Scalar");
Note
Options which are set via the MapScalarApiReference method will take precedence over options set via dependency injection.
Development
- Download .NET 9.0
- Jump to the package folder:
cd packages/scalar.aspnetcore - Do a fresh build:
dotnet build - Run the tests:
dotnet test
And see it in action here:
- Switch to the playground:
cd playground/Scalar.AspNetCore.Playground - Start the playground:
dotnet run - Open this URL in the browser: http://localhost:5056/scalar/v1
Community
We are API nerds. You too? Let’s chat on Discord: https://discord.gg/scalar
License
The source code in this repository is licensed under MIT.
No packages depend on Scalar.AspNetCore.
.NET 8.0
- No dependencies.
.NET 9.0
- No dependencies.
| Version | Downloads | Last updated |
|---|---|---|
| 2.11.1 | 1 | 12/06/2025 |
| 2.11.0 | 2 | 12/03/2025 |
| 2.10.3 | 1 | 12/03/2025 |
| 2.10.1 | 1 | 11/07/2025 |
| 2.10.0 | 1 | 11/07/2025 |
| 2.9.0 | 1 | 11/07/2025 |
| 2.8.11 | 1 | 11/07/2025 |
| 2.8.10 | 1 | 11/07/2025 |
| 2.8.9 | 1 | 11/07/2025 |
| 2.8.8 | 1 | 11/07/2025 |
| 2.8.7 | 1 | 11/07/2025 |
| 2.8.6 | 1 | 11/07/2025 |
| 2.8.5 | 1 | 11/07/2025 |
| 2.8.4 | 1 | 11/07/2025 |
| 2.8.3 | 1 | 11/07/2025 |
| 2.8.2 | 1 | 11/07/2025 |
| 2.8.1 | 1 | 11/07/2025 |
| 2.8.0 | 1 | 11/07/2025 |
| 2.7.4 | 1 | 11/07/2025 |
| 2.7.3 | 1 | 11/07/2025 |
| 2.7.2 | 1 | 11/07/2025 |
| 2.7.1 | 1 | 11/07/2025 |
| 2.7.0 | 1 | 11/07/2025 |
| 2.6.9 | 1 | 11/07/2025 |
| 2.6.8 | 1 | 11/07/2025 |
| 2.6.7 | 1 | 11/07/2025 |
| 2.6.6 | 1 | 11/07/2025 |
| 2.6.5 | 1 | 11/07/2025 |
| 2.6.4 | 1 | 11/07/2025 |
| 2.6.3 | 1 | 11/07/2025 |
| 2.6.2 | 1 | 11/07/2025 |
| 2.6.1 | 1 | 11/07/2025 |
| 2.6.0 | 1 | 11/07/2025 |
| 2.5.6 | 8 | 10/29/2025 |
| 2.5.5 | 1 | 11/07/2025 |
| 2.5.3 | 1 | 11/07/2025 |
| 2.5.1 | 1 | 11/07/2025 |
| 2.5.0 | 1 | 11/07/2025 |
| 2.4.22 | 1 | 11/07/2025 |
| 2.4.21 | 1 | 11/07/2025 |
| 2.4.20 | 1 | 11/07/2025 |
| 2.4.19 | 1 | 11/07/2025 |
| 2.4.18 | 1 | 11/07/2025 |
| 2.4.17 | 1 | 11/07/2025 |
| 2.4.16 | 1 | 11/07/2025 |
| 2.4.15 | 1 | 11/07/2025 |
| 2.4.14 | 1 | 11/07/2025 |
| 2.4.13 | 1 | 11/07/2025 |
| 2.4.12 | 1 | 11/07/2025 |
| 2.4.11 | 1 | 11/07/2025 |
| 2.4.9 | 1 | 11/07/2025 |
| 2.4.8 | 1 | 11/07/2025 |
| 2.4.7 | 1 | 11/07/2025 |
| 2.4.6 | 1 | 11/07/2025 |
| 2.4.5 | 1 | 11/07/2025 |
| 2.4.4 | 1 | 11/07/2025 |
| 2.4.3 | 1 | 11/07/2025 |
| 2.4.2 | 1 | 11/07/2025 |
| 2.4.1 | 1 | 11/07/2025 |
| 2.3.1 | 1 | 11/07/2025 |
| 2.3.0 | 1 | 11/07/2025 |
| 2.2.7 | 1 | 11/07/2025 |
| 2.2.5 | 1 | 11/07/2025 |
| 2.2.4 | 1 | 11/07/2025 |
| 2.2.3 | 1 | 11/07/2025 |
| 2.2.2 | 1 | 11/07/2025 |
| 2.2.1 | 1 | 11/07/2025 |
| 2.2.0 | 1 | 11/07/2025 |
| 2.1.18 | 1 | 11/07/2025 |
| 2.1.17 | 1 | 11/07/2025 |
| 2.1.16 | 1 | 11/07/2025 |
| 2.1.15 | 1 | 11/07/2025 |
| 2.1.14 | 1 | 11/07/2025 |
| 2.1.13 | 1 | 12/03/2025 |
| 2.1.12 | 1 | 11/07/2025 |
| 2.1.11 | 1 | 11/07/2025 |
| 2.1.10 | 1 | 11/07/2025 |
| 2.1.9 | 1 | 11/07/2025 |
| 2.1.8 | 1 | 11/07/2025 |
| 2.1.7 | 1 | 11/07/2025 |
| 2.1.6 | 1 | 11/07/2025 |
| 2.1.5 | 1 | 11/07/2025 |
| 2.1.4 | 1 | 11/07/2025 |
| 2.1.3 | 1 | 11/07/2025 |
| 2.1.2 | 1 | 11/07/2025 |
| 2.1.1 | 1 | 11/07/2025 |
| 2.1.0 | 1 | 11/07/2025 |
| 2.0.36 | 1 | 11/07/2025 |
| 2.0.34 | 1 | 11/07/2025 |
| 2.0.33 | 1 | 11/07/2025 |
| 2.0.30 | 1 | 11/07/2025 |
| 2.0.29 | 1 | 11/07/2025 |
| 2.0.28 | 1 | 11/07/2025 |
| 2.0.27 | 1 | 11/07/2025 |
| 2.0.26 | 1 | 11/07/2025 |
| 2.0.25 | 1 | 11/07/2025 |
| 2.0.24 | 1 | 11/07/2025 |
| 2.0.23 | 1 | 11/07/2025 |
| 2.0.22 | 1 | 11/07/2025 |
| 2.0.21 | 1 | 11/07/2025 |
| 2.0.20 | 1 | 11/07/2025 |
| 2.0.19 | 1 | 11/07/2025 |
| 2.0.18 | 1 | 11/07/2025 |
| 2.0.17 | 1 | 11/07/2025 |
| 2.0.16 | 1 | 11/07/2025 |
| 2.0.15 | 1 | 11/07/2025 |
| 2.0.14 | 1 | 11/07/2025 |
| 2.0.12 | 1 | 11/07/2025 |
| 2.0.11 | 1 | 11/07/2025 |
| 2.0.10 | 1 | 11/07/2025 |
| 2.0.9 | 1 | 11/07/2025 |
| 2.0.8 | 1 | 11/07/2025 |
| 2.0.7 | 1 | 11/07/2025 |
| 2.0.6 | 1 | 11/07/2025 |
| 2.0.5 | 1 | 11/07/2025 |
| 2.0.4 | 1 | 11/07/2025 |
| 2.0.2 | 1 | 11/07/2025 |
| 2.0.1 | 1 | 11/07/2025 |
| 2.0.0 | 1 | 11/07/2025 |
| 1.2.76 | 1 | 11/07/2025 |
| 1.2.75 | 1 | 11/07/2025 |
| 1.2.74 | 1 | 11/07/2025 |
| 1.2.73 | 1 | 11/07/2025 |
| 1.2.72 | 1 | 11/07/2025 |
| 1.2.71 | 1 | 11/07/2025 |
| 1.2.70 | 1 | 11/07/2025 |
| 1.2.69 | 1 | 11/07/2025 |
| 1.2.68 | 1 | 11/07/2025 |
| 1.2.67 | 1 | 11/07/2025 |
| 1.2.66 | 1 | 11/07/2025 |
| 1.2.65 | 1 | 11/07/2025 |
| 1.2.64 | 1 | 11/07/2025 |
| 1.2.63 | 1 | 11/07/2025 |
| 1.2.61 | 1 | 11/07/2025 |
| 1.2.60 | 1 | 11/07/2025 |
| 1.2.59 | 1 | 11/07/2025 |
| 1.2.58 | 1 | 11/07/2025 |
| 1.2.57 | 1 | 11/07/2025 |
| 1.2.56 | 1 | 11/07/2025 |
| 1.2.55 | 1 | 11/07/2025 |
| 1.2.54 | 1 | 11/07/2025 |
| 1.2.53 | 1 | 11/07/2025 |
| 1.2.52 | 1 | 11/07/2025 |
| 1.2.51 | 1 | 11/07/2025 |
| 1.2.50 | 1 | 11/07/2025 |
| 1.2.49 | 1 | 11/07/2025 |
| 1.2.48 | 1 | 11/07/2025 |
| 1.2.47 | 1 | 11/07/2025 |
| 1.2.46 | 1 | 11/07/2025 |
| 1.2.45 | 1 | 11/07/2025 |
| 1.2.44 | 1 | 11/07/2025 |
| 1.2.43 | 1 | 11/07/2025 |
| 1.2.42 | 1 | 11/07/2025 |
| 1.2.41 | 1 | 12/03/2025 |
| 1.2.40 | 1 | 11/07/2025 |
| 1.2.39 | 1 | 11/07/2025 |
| 1.2.38 | 1 | 11/07/2025 |
| 1.2.37 | 1 | 11/07/2025 |
| 1.2.36 | 1 | 11/07/2025 |
| 1.2.35 | 1 | 11/07/2025 |
| 1.2.34 | 1 | 11/07/2025 |
| 1.2.33 | 1 | 11/07/2025 |
| 1.2.32 | 1 | 11/07/2025 |
| 1.2.31 | 1 | 11/07/2025 |
| 1.2.30 | 1 | 11/07/2025 |
| 1.2.29 | 1 | 11/07/2025 |
| 1.2.28 | 1 | 11/07/2025 |
| 1.2.27 | 1 | 11/07/2025 |
| 1.2.26 | 1 | 11/07/2025 |
| 1.2.25 | 1 | 11/07/2025 |
| 1.2.24 | 1 | 11/07/2025 |
| 1.2.23 | 1 | 11/07/2025 |
| 1.2.22 | 1 | 11/07/2025 |
| 1.2.21 | 1 | 11/07/2025 |
| 1.2.20 | 1 | 11/07/2025 |
| 1.2.19 | 1 | 11/07/2025 |
| 1.2.18 | 1 | 11/07/2025 |
| 1.2.17 | 1 | 11/07/2025 |
| 1.2.16 | 1 | 11/07/2025 |
| 1.2.15 | 1 | 11/07/2025 |
| 1.2.14 | 1 | 11/07/2025 |
| 1.2.13 | 1 | 11/07/2025 |
| 1.2.12 | 1 | 11/07/2025 |
| 1.2.11 | 1 | 11/07/2025 |
| 1.2.10 | 1 | 11/07/2025 |
| 1.2.9 | 1 | 11/07/2025 |
| 1.2.8 | 1 | 11/07/2025 |
| 1.2.7 | 1 | 11/07/2025 |
| 1.2.6 | 1 | 11/07/2025 |
| 1.2.5 | 1 | 11/07/2025 |
| 1.2.4 | 1 | 11/07/2025 |
| 1.2.3 | 1 | 11/07/2025 |
| 1.1.2 | 1 | 11/07/2025 |
| 1.1.1 | 1 | 11/07/2025 |
| 1.0.1 | 1 | 11/07/2025 |