Skip to content
ballmüllersolutions logo Send an email Call us
November 27, 2026

API (Application Programming Interface)

An API is an interface through which one program uses the functions of another. Web APIs offer them over HTTP; in ASP.NET Core you build them with minimal APIs or controllers and describe them with OpenAPI.

An API (application programming interface) is the interface through which one program uses the functions of another without knowing its inner workings. On the web, the term usually means a service that offers data over HTTP, often as JSON.

What belongs to it

Microsoft describes an API as a set of rules for how software components talk to each other. For a web API, three terms go together:

Web APIs in ASP.NET Core

ASP.NET Core knows two ways: minimal APIs and controllers. Microsoft recommends minimal APIs for new projects. The smallest example:

var app = WebApplication.Create(args);

app.MapGet("/hello/{name}", (string name) => $"Hello {name}!");

app.Run();

For the contract, ASP.NET Core uses the package Microsoft.AspNetCore.OpenApi to generate an OpenAPI document from the endpoints (AddOpenApi, MapOpenApi). A user interface such as Swagger UI is not part of it and is added when needed. Further building blocks around an API are database access, sign-in and permissions, and error responses.

An example from the Kladde

In K2, the Kladde gets a web API with endpoints for contacts and appointments. It returns JSON, validates input, reports errors as ProblemDetails, and describes itself with OpenAPI. The Blazor pages and the tests talk to this API; its business rules live in the core of the Kladde, not in the endpoints.

How it differs

In the course

In K2, module 2.3, you build the API step by step: The first web API, Errors as ProblemDetails, and OpenAPI and API design. If you want to design interfaces in more depth, K2, module 2.12, has the lesson REST done right.

Further reading on the blog

Sources