Scalar.AspNetCore
2.2.1
Prefix Reserved
See the version list below for details.
dotnet add package Scalar.AspNetCore --version 2.2.1
NuGet\Install-Package Scalar.AspNetCore -Version 2.2.1
<PackageReference Include="Scalar.AspNetCore" Version="2.2.1" />
<PackageVersion Include="Scalar.AspNetCore" Version="2.2.1" />
<PackageReference Include="Scalar.AspNetCore" />
paket add Scalar.AspNetCore --version 2.2.1
#r "nuget: Scalar.AspNetCore, 2.2.1"
#:package Scalar.AspNetCore@2.2.1
#addin nuget:?package=Scalar.AspNetCore&version=2.2.1
#tool nuget:?package=Scalar.AspNetCore&version=2.2.1
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.
Features
- Stunning API Reference
- Compatible with .NET 8 and above
- Independent of OpenAPI document generators
- Fully AOT (Ahead-of-Time) compatible

Migration Guide
If you are upgrading from 2.1.x to 2.2.x, please refer to the migration guide.
If you are upgrading from 1.x.x to 2.x.x, please refer to the migration guide.
Usage
- Install the package
dotnet add package Scalar.AspNetCore --version 2.1.*
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., 2.1.*.
- Add the using directive
using Scalar.AspNetCore;
- Configure your application
Add the following to Program.cs based on your OpenAPI generator:
For Microsoft.AspNetCore.OpenApi:
builder.Services.AddOpenApi();
if (app.Environment.IsDevelopment())
{
app.MapOpenApi();
app.MapScalarApiReference();
}
For Swashbuckle:
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
if (app.Environment.IsDevelopment())
{
app.UseSwagger(options =>
{
options.RouteTemplate = "/openapi/{documentName}.json";
});
app.MapScalarApiReference();
}
For NSwag:
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddOpenApiDocument();
if (app.Environment.IsDevelopment())
{
app.UseOpenApi(options =>
{
options.Path = "/openapi/{documentName}.json";
});
app.MapScalarApiReference();
}
For FastEndpoints:
builder.Services.SwaggerDocument();
if (app.Environment.IsDevelopment())
{
app.UseSwaggerGen(options =>
{
options.Path = "/openapi/{documentName}.json";
});
app.MapScalarApiReference();
}
That's it! 🎉 You can now access the Scalar API Reference at /scalar. By default, the API Reference uses the v1 document. You can add documents by calling the AddDocument method. Alternatively, you can navigate to /scalar/{documentName} (e.g., /scalar/v1) to view the API Reference for a specific document. Please check out the dotnet integration documentation for more details.
Configuration
For detailed configuration options, refer to the integration documentation. This documentation focuses on the features provided by the package.
For more realistic examples and advanced usage scenarios, such as authentication, API versioning, and handling multiple documents, check out our extended examples documentation. This documentation is also useful if you need more context on what Scalar.AspNetCore is for.
Development
Local
- Download .NET 9.0
- Jump to the package folder:
cd integrations/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/
Docker
If you don't have the SDK installed or want to run the playground under a subpath, you can use Docker Compose:
- Run Docker Compose:
docker compose up --build - Open this URL in the browser: http://localhost:8080/api/scalar/
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.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (158)
Showing the top 5 NuGet packages that depend on Scalar.AspNetCore:
| Package | Downloads |
|---|---|
|
Rystem.Api.Server
Rystem.Api helps you to integrate Api Server and Automated Client for Aspect-Oriented programming. |
|
|
Scalar.AspNetCore.Microsoft
Provides OpenAPI transformers for Microsoft.AspNetCore.OpenApi that enable Scalar-specific extensions in your OpenAPI document. |
|
|
Scalar.AspNetCore.Swashbuckle
Provides OpenAPI filters for Swashbuckle.AspNetCore.SwaggerGen that enable Scalar-specific extensions in your OpenAPI document. |
|
|
devprime.stack.web
DevPrime Web |
|
|
Mii.Rinjani.Gateway.Commons
Package Description |
GitHub repositories (78)
Showing the top 20 popular GitHub repositories that depend on Scalar.AspNetCore:
| Repository | Stars |
|---|---|
|
jasontaylordev/CleanArchitecture
Clean Architecture Solution Template for ASP.NET Core
|
|
|
ardalis/CleanArchitecture
Clean Architecture Solution Template: A proven Clean Architecture Template for ASP.NET Core 10
|
|
|
JustArchiNET/ArchiSteamFarm
C# application with primary purpose of farming Steam cards from multiple accounts simultaneously.
|
|
|
dotnet/AspNetCore.Docs
Documentation for ASP.NET Core
|
|
|
dotnet/eShop
A reference .NET application implementing an eCommerce site
|
|
|
dodyg/practical-aspnetcore
Practical samples of ASP.NET Core 11, 10, 9, 8.0, 7.0, 6.0, 5.0, 3.1, 2.2, and 2.1,projects you can use. Readme contains explanations on all projects.
|
|
|
fullstackhero/dotnet-starter-kit
Production Grade Cloud-Ready .NET 10 Starter Kit (Web API + React Client) with Multitenancy Support, and Clean/Modular Architecture that saves roughly 200+ Development Hours! All Batteries Included.
|
|
|
FastEndpoints/FastEndpoints
A light-weight REST API development framework for ASP.NET 8 and newer.
|
|
|
ServiceStack/ServiceStack
Thoughtfully architected, obscenely fast, thoroughly enjoyable web services for all
|
|
|
evolutionary-architecture/evolutionary-architecture-by-example
Navigate the complex landscape of .NET software architecture with our step-by-step, story-like guide. Unpack the interplay between modular monoliths, microservices, domain-driven design, and various architectural patterns. Go beyond the one-size-fits-all solutions and understand how to blend these approaches based on your unique needs.
|
|
|
AIDotNet/OpenDeepWiki
OpenDeepWiki is the open-source version of the DeepWiki project, aiming to provide a powerful knowledge management and collaboration platform. The project is mainly developed using C# and TypeScript, supporting modular design, and is easy to expand and customize.
|
|
|
dotnet/aspnet-api-versioning
Provides a set of libraries which add service API versioning to ASP.NET Web API, OData with ASP.NET Web API, and ASP.NET Core.
|
|
|
davidfowl/TodoApp
Todo application with ASP.NET Core Blazor WASM, Minimal APIs and Authentication
|
|
|
ErsatzTV/legacy
Open-source platform that transforms your personal media library into live, custom TV channels.
|
|
|
exceptionless/Exceptionless
Exceptionless application
|
|
|
JasperFx/wolverine
Supercharged .NET server side development!
|
|
|
webprofusion/certify
Professional ACME Client for Windows (and now cross-platform via Certify Management Hub). Certificate Management UI, powered by Let's Encrypt and compatible with all ACME v2 CAs. Used by over 150,000 organisations. Download from certifytheweb.com
|
|
|
GZTimeWalker/GZCTF
The GZ::CTF project, an open source CTF platform.
|
|
|
SteveDunn/Vogen
A semi-opinionated library which is a source generator and a code analyser. It Source generates Value Objects
|
|
|
meysamhadeli/booking-microservices
A practical microservices with the latest technologies and architectures like Vertical Slice Architecture, Event Sourcing, CQRS, DDD, gRpc, MongoDB, RabbitMq, Masstransit, and Aspire in .Net 10.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 2.16.4 | 30,083 | 6/17/2026 |
| 2.16.3 | 148,483 | 6/11/2026 |
| 2.16.2 | 70,478 | 6/9/2026 |
| 2.16.1 | 17,233 | 6/9/2026 |
| 2.14.14 | 1,016,085 | 5/14/2026 |
| 2.14.13 | 14,684 | 5/14/2026 |
| 2.14.11 | 522,640 | 5/5/2026 |
| 2.14.10 | 74,631 | 5/5/2026 |
| 2.14.9 | 185,881 | 4/30/2026 |
| 2.14.8 | 88,982 | 4/29/2026 |
| 2.14.7 | 17,814 | 4/29/2026 |
| 2.14.6 | 148,687 | 4/27/2026 |
| 2.14.5 | 132,599 | 4/27/2026 |
| 2.14.4 | 203,018 | 4/23/2026 |
| 2.14.3 | 121,372 | 4/22/2026 |
| 2.14.2 | 15,496 | 4/21/2026 |
| 2.14.1 | 210,156 | 4/18/2026 |
| 2.14.0 | 137,555 | 4/16/2026 |
| 2.13.22 | 260,868 | 4/11/2026 |
| 2.2.1 | 206,370 | 4/24/2025 |