APILensDocs 1.0.0
dotnet add package APILensDocs --version 1.0.0
NuGet\Install-Package APILensDocs -Version 1.0.0
<PackageReference Include="APILensDocs" Version="1.0.0" />
<PackageVersion Include="APILensDocs" Version="1.0.0" />
<PackageReference Include="APILensDocs" />
paket add APILensDocs --version 1.0.0
#r "nuget: APILensDocs, 1.0.0"
#:package APILensDocs@1.0.0
#addin nuget:?package=APILensDocs&version=1.0.0
#tool nuget:?package=APILensDocs&version=1.0.0
APILens
Drop-in live traffic dashboard and a fully custom API documentation UI for ASP.NET Web API 2 (OWIN) applications. No external services, no Node/build tooling - the docs/dashboard UI is plain HTML/CSS/JS.
What you get
- Live traffic dashboard - total hits/success/fail, an hourly bar chart, and a per-endpoint breakdown, all computed in-memory from real requests.
- Per-endpoint drill-down - hourly chart and a log of the most recent individual requests for one endpoint.
- Request/response payload viewer - click a recent request to see its actual request and response body in a popup, with common sensitive field names (passwords, tokens, card numbers, etc.) automatically redacted before anything is stored.
- Custom documentation UI - reads your existing Swagger/OpenAPI 2.0 JSON (e.g. from Swashbuckle) and renders a fully brandable Overview / Endpoints / Schemas experience with a working "Try it out" (editable headers, live cURL preview, tabbed response viewer).
Everything is in-memory and resets when the app pool recycles - this is a live/rolling view, not a persisted audit log.
Install
Install this package into your ASP.NET Web API 2 project.
In your
WebApiConfig(or wherever you configureHttpConfiguration), add:config.EnableApiLens();Or override the defaults:
config.EnableApiLens(options => { options.RetainHours = 72; options.MaxRecentRequestsPerEndpoint = 100; options.SensitiveFieldNames.Add("accountNumber"); });Copy the
content/ApiLensDocsfolder (installed alongside this package) into your web project as static content, then browse to/ApiLensDocs/index.html.If your Swagger JSON isn't served at the default
/swagger/docs/v1, editapilens.config.js(in the copied folder) to point at the right URL.
Security note
This package does not add authentication to the dashboard or diagnostics
endpoints (/api/_apilens/stats, /api/_apilens/stats/endpoint) - it tracks
whatever your app already allows. If your API is not otherwise locked down,
anyone who can reach those routes can see captured traffic, including request
bodies (minus redacted fields). Restrict access to these routes the same way
you would any other sensitive endpoint in your app (e.g. an [Authorize]
filter, IP allowlist, or a reverse-proxy rule) if that matters for your
deployment.
Configuration reference (ApiLensOptions)
| Option | Default | Purpose |
|---|---|---|
TrackedPathPrefix |
/api/ |
Only paths starting with this are tracked |
ExcludedPathPrefixes |
["/api/_apilens"] |
Paths never tracked, checked after the prefix match |
RetainHours |
48 |
Hours of hourly buckets kept before pruning |
MaxRecentRequestsPerEndpoint |
50 |
Individual requests kept per endpoint for the payload drill-down |
MaxBodyLength |
8000 |
Captured request/response bodies longer than this are truncated |
SensitiveFieldNames |
password/token/card/etc. | JSON field names redacted before storage |
Powered by Irosh Fernando.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net481 is compatible. |
-
.NETFramework 4.8.1
- Microsoft.AspNet.WebApi.Core (>= 5.2.7)
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 |
|---|