Kaya.ApiExplorer 1.1.0

dotnet add package Kaya.ApiExplorer --version 1.1.0
                    
NuGet\Install-Package Kaya.ApiExplorer -Version 1.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Kaya.ApiExplorer" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Kaya.ApiExplorer" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Kaya.ApiExplorer" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Kaya.ApiExplorer --version 1.1.0
                    
#r "nuget: Kaya.ApiExplorer, 1.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Kaya.ApiExplorer@1.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Kaya.ApiExplorer&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Kaya.ApiExplorer&version=1.1.0
                    
Install as a Cake Tool

Kaya API Explorer

A lightweight, Swagger-like API documentation tool for .NET applications that automatically scans your HTTP endpoints and displays them in a beautiful, interactive UI.

Features

  • 🚀 Automatic Endpoint Discovery: Scans your controllers and actions automatically
  • 🎨 Beautiful UI: Clean, modern interface with embedded HTML/CSS/JS
  • 📊 Detailed Information: Shows parameters, response types, HTTP methods, and more
  • Performance Monitoring: Real-time request duration and data size tracking with color-coded indicators
  • 🔧 Easy Integration: Just add a few lines to your startup
  • 📦 NuGet Package: Simple installation via NuGet
  • 🎨 Clean Middleware: Integrates seamlessly into your ASP.NET Core pipeline

Quick Start

1. Install the Package

dotnet add package Kaya.ApiExplorer

2. Configure Your Application

Add Kaya API Explorer to your Program.cs:

using Kaya.ApiExplorer.Extensions;

var builder = WebApplication.CreateBuilder(args);

// Add services
builder.Services.AddControllers();
builder.Services.AddKayaApiExplorer(); 

var app = builder.Build();

if (app.Environment.IsDevelopment())
{
    app.UseKayaApiExplorer("/api-explorer");
}

app.UseHttpsRedirection();
app.UseAuthorization();
app.MapControllers();

app.Run();

3. Access the UI

Navigate to http://localhost:5000/api-explorer (or your app's URL) to view your API documentation.

Demo Project

This repository includes a demo project (Demo.WebApi) that showcases the API Explorer with sample endpoints for users and products.

To run the demo:

cd src/Demo.WebApi
dotnet run

Then navigate to https://localhost:7000/api-explorer (or your app's HTTPS URL) to see the API Explorer in action.

How It Works

Kaya API Explorer uses .NET reflection to scan your application's controllers and actions at runtime. It:

  1. Discovers Controllers: Finds all classes inheriting from ControllerBase
  2. Analyzes Actions: Examines public methods and their HTTP attributes
  3. Extracts Metadata: Gathers information about parameters, return types, and routing
  4. Generates Documentation: Creates a JSON representation of your API
  5. Serves UI: Provides a beautiful web interface to explore the documentation and interact with the endpoints

API Information Captured

For each endpoint, Kaya captures:

  • HTTP Method (GET, POST, PUT, DELETE, etc.)
  • Route Path with parameters
  • Controller and Action Names
  • Parameters with types, sources (query, body, route, header), and requirements
  • Response Types and descriptions
  • Status Codes and their meanings

Configuration

You can customize Kaya API Explorer in several ways:

Basic Configuration

// Use default settings (route: "/api-explorer", theme: "light")
builder.Services.AddKayaApiExplorer();

// Customize route prefix and theme
builder.Services.AddKayaApiExplorer(routePrefix: "/api-docs", defaultTheme: "dark");

Configuration via appsettings.json

You can also configure Kaya API Explorer through your appsettings.json file:

{
  "KayaApiExplorer": {
    "RoutePrefix": "/api-docs",
    "DefaultTheme": "dark"
  }
}

Then bind the configuration in your Program.cs:

builder.Services.Configure<KayaApiExplorerOptions>(
    builder.Configuration.GetSection("KayaApiExplorer"));

Custom Route Prefix

You can customize the route where the API Explorer is served:

app.UseKayaApiExplorer("/my-custom-docs");

UI Customization

The UI is built with embedded HTML, CSS, and JavaScript files that are compiled into the assembly. This ensures:

  • Reliable deployment: No external file dependencies
  • Fast loading: Resources are served from memory
  • Consistent experience: UI works the same across all environments

The middleware integrates seamlessly into your ASP.NET Core pipeline, serving the API Explorer at your specified route without any external dependencies or separate processes.

Project Structure

src/
├── Kaya.ApiExplorer/          # Main NuGet package
│   ├── Extensions/            # Service registration extensions
│   ├── Middleware/            # HTTP middleware
│   ├── Models/               # Data models
│   ├── Services/             # Core scanning logic and UI service
│   └── UI/                   # Embedded HTML, CSS, JavaScript and logo files
├── Demo.WebApi/              # Demo application
│   ├── Controllers/          # Sample controllers
│   └── Models/              # Sample models
└── tests/
    └── Kaya.ApiExplorer.Tests/  # Unit tests

License

This project is licensed under the MIT License - see the LICENSE file for details.

Roadmap

Current TODOs

  • Execution Option: Add "Try It Out" functionality for every endpoint
  • Multiple Authentication Options: Support various authentication schemes (Bearer, API Key, OAuth, etc.)
  • Request/Response Improvements: Better handling of complex types, classes, and object models
  • Search Functionality: Add search by endpoint name functionality in the UI
  • Controller Documentation: Read and display controller XML documentation if available

Future Features

  • Support for XML documentation comments
  • Export to OpenAPI/Swagger format
  • Request/response examples
  • Model schema visualization
  • Dark mode support
  • Performance monitoring integration
  • Code generation to easily call the endpoint in many programming languages (JavaScript, cURL, Python, Ruby)
  • Debuggings SignalR
  • Add GraphQL support
Product Compatible and additional computed target framework versions.
.NET 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.0 170 8/30/2025
1.0.0 161 8/24/2025

Version 1.1.0: Added performance monitoring with real-time request duration and data size tracking. Includes bug fixes for complex object handling in Key-Value editor, improved JSON parsing, and enhanced error handling.