Contract
A contract is an agreed specification of the conditions, expectations, rights, or obligations that govern behavior or interactions between parties or software components.
Secure APIs
A defined software interface through which applications or services expose data and functionality to other software.
- How it is used
- Enables applications, services, devices, and users to access defined data and functionality while framing each interface as a security boundary.
- How deep it goes
- Defines APIs plainly, explains attack and business consequences, and extends into gateway-based network topology without detailing API implementation code.
- Examples
- Uses web, mobile, IoT, and service-to-service integrations plus public-versus-private endpoint topologies and a customer-data breach scenario.
- What you can do after
- Evaluate/understand API exposure, identify likely security and business consequences, and plan gateway, subnet, access-control, and monitoring protections.
Platform Engineering on Kubernetes
A platform API is an interface that exposes platform-provided capabilities and workflows to application services or their automation.
- How it is used
- Defines self-service requests and application capabilities while hiding the tools and workflows that fulfill them.
- How deep it goes
- Works through an Environment resource and its provisioning path, then identifies compatibility, local-development, latency, and security concerns.
- Examples
- Uses a Conference application development-environment request, an Environment resource definition, and an isolated vcluster provisioned with Crossplane.
- What you can do after
- Build it from scratch as an Environment-request workflow backed by Crossplane, or apply HTTP/gRPC capability APIs to decouple services from infrastructure.
Read how Platform Engineering on Kubernetes explains contract →
The Design of Web APIs, Second Edition
An application programming interface is a defined boundary through which software components communicate and access capabilities or data.
- How it is used
- Defines the consumer-facing boundary for remote capabilities while keeping provider implementation details out of client code.
- How deep it goes
- Works through HTTP exchanges, operations, data, and design decisions, but stops short of implementation code and architecture.
- Examples
- Uses message sharing, POST /statuses, inconsistent identifiers, vague errors, exposed direct messages, and a renamed response field.
- What you can do after
- Build it from scratch by identifying capabilities, designing HTTP operations and data, and describing the interface before implementation.
Read how The Design of Web APIs, Second Edition explains contract →
Grokking Software Architecture
An API contract specifies the operations, data, and behavioral expectations governing communication between an API and its clients.
- How it is used
- Frames the API as a public promise that lets clients and servers evolve independently across a network boundary.
- How deep it goes
- Defines exchange clauses and retry behavior, then examines breaking changes, implicit dependencies, and versioning.
- Examples
- Uses a restaurant menu, a user-profile redesign exercise, and an unexpectedly reordered user list.
- What you can do after
- Practice designing and reviewing a resource-based API contract for methods, extensible data, and compatibility.
Functional Design and Architecture: Examples in Haskell
An application programming interface is a defined contract through which software clients interact with a component or service.
- How it is used
- Uses API contracts to separate client logic from subsystem implementations and control coupling.
- How deep it goes
- Defines structural and behavioral contracts, then explains substitution, violations, and interface design through worked implementations.
- Examples
- Illustrates contracts with sensor and connection interfaces, a lamp that unexpectedly throws, and a shared HTTP schema.
- What you can do after
- Evaluate and design interfaces that hide implementation details, support substitution, and expose behavioral violations.
Read how Functional Design and Architecture: Examples in Haskell explains contract →
Crack Any Codebase with AI
An external API is an interface exposed by a separately operated system for client software to access its operations or data.
- How it is used
- Maps external service boundaries and makes their calls visible when reconstructing a multi-process system's architecture.
- How deep it goes
- Explains API discovery through environment files, SDK code, graph edges, authentication, and versioning, but stops short of protocol internals.
- Examples
- Uses LLM API calls, Cal.com's public REST API, and Stripe, SendGrid, Google Calendar, and Twilio integrations.
- What you can do after
- Diagnose/debug with it by inventorying API dependencies, locating their evidence, and tracing one request across each connected service.
Learn Go with Pocket-Sized Projects
An API is a defined interface through which software components or services communicate and request functionality or data.
- How it is used
- Defines boundaries for library callers, web clients, and replaceable dependencies.
- How deep it goes
- Develops contracts through exported library design, endpoint definitions, consumer interfaces, and API-to-domain error handling.
- Examples
- Uses a logger, exchange-rate converter, game endpoint, and habits service to illustrate different contracts.
- What you can do after
- Apply it in Go by defining minimal dependency interfaces and service request and response boundaries.
Read how Learn Go with Pocket-Sized Projects explains contract →
Simple Object-Oriented Design: Create clean, maintainable applications
An API is a defined interface through which software systems invoke functionality or access data from another system.
- How it is used
- Defines communication boundaries between modules, applications, and external systems while hiding implementation details.
- How deep it goes
- Explains API design through stability, simplicity, compatibility, extension points, infrastructure boundaries, and leakage tradeoffs rather than protocol internals.
- Examples
- Uses employee repositories, message delivery, caching, and a JSON notification service with create, add-participant, and remove-participant operations.
- What you can do after
- Apply it via module interfaces or web APIs that isolate clients from internal and infrastructure changes.
Read how Simple Object-Oriented Design: Create clean, maintainable applications explains contract →
Build and Orchestrator in Go (From Scratch)
An API is a defined interface through which software components request operations or exchange data.
- How it is used
- Exposes manager and worker operations so developers submit tasks and managers coordinate workers over HTTP.
- How deep it goes
- Builds HTTP APIs through routes, routers, handlers, JSON processing, status codes, and runnable manager-worker servers.
- Examples
- Demonstrates GET, POST, and DELETE task requests with curl, JSON task data, HTTP status codes, and a running Docker container.
- What you can do after
- Build it from scratch using Go handlers, chi routes, HTTP servers, JSON bodies, and manager-worker API boundaries.
Read how Build and Orchestrator in Go (From Scratch) explains contract →
Starting Data Analytics with Generative AI and Python
A defined software interface through which programs request data or operations from another system and receive responses.
- How it is used
- Integrates generative AI into custom analytics applications and repeatable review-analysis workflows.
- How deep it goes
- Demonstrates API setup, requests, response processing, and evaluation, without detailing interface internals.
- Examples
- Uses Portuguese review-keyword generation and sentiment classification of 500 customer reviews.
- What you can do after
- Apply it via the OpenAI Python library to request model responses and process them for analytics.
Read how Starting Data Analytics with Generative AI and Python explains contract →
Unit Testing Principles, Practices, and Patterns
The public API is the set of publicly accessible operations and contracts through which a software component can be used.
- How it is used
- Frames API design as aligning client-visible operations and state with observable behavior while hiding implementation details.
- How deep it goes
- Defines public and private APIs, explains leakage and encapsulation, and demonstrates refactoring without covering API versioning or protocols.
- Examples
- Uses User name normalization, Customer promotion discounts, and purchase operations to expose leaking state or multi-call APIs.
- What you can do after
- Evaluate/understand whether a public member represents client-observable behavior and refactor leaked implementation details behind private boundaries.
Read how Unit Testing Principles, Practices, and Patterns explains contract →
Effective Data Analysis
An API is a defined programmatic interface through which software requests data or operations from another software system or service.
- How it is used
- Uses APIs to bring external, current data into analytical workflows and stakeholder deliverables.
- How deep it goes
- Defines request–response interactions and works through retrieval and processing, while identifying authentication, pagination, and rate limits as constraints.
- Examples
- Uses a National Weather Service forecast and filtered NYC 311 rat sightings to illustrate data retrieval.
- What you can do after
- Apply it via Python’s requests library and pandas to retrieve and prepare API data for analysis.
Build Financial Software with Generative AI (From Scratch)
An application programming interface (API) is a defined interface through which software components communicate and request functionality or data.
- How it is used
- Uses API contracts to coordinate consumers and providers in a distributed ACH dashboard.
- How deep it goes
- Defines provider and consumer obligations, then discusses use cases, versioning, documentation, scaling, security, and validation.
- Examples
- Uses an ACH batch response and dashboard interfaces to illustrate a mismatch between mocked and actual data structures.
- What you can do after
- Apply it via FastAPI to build documented endpoints and adapt a dashboard to their responses.
Read how Build Financial Software with Generative AI (From Scratch) explains contract →
100 Go Mistakes and How to Avoid Them
An application programming interface is a defined set of operations and conventions through which software components interact.
- How it is used
- Guides Go API design toward convenient client interactions and appropriately scoped behavior.
- How deep it goes
- Explains interface placement, return types, and allocation consequences through contrasting signatures and implementations.
- Examples
- Uses a reader-to-writer copy function and a client-specific customer storage interface.
- What you can do after
- Evaluate Go API signatures and interface placement for usability, flexibility, and allocation implications.
Read how 100 Go Mistakes and How to Avoid Them explains contract →
Build Python Web Apps with Streamlit
An API is a defined interface through which software components programmatically exchange data or invoke functionality.
- How it is used
- Organizes frontend–backend interaction and connects apps to external services.
- How deep it goes
- Defines the contract through an analogy and backend functions, then introduces web request conventions and documentation.
- Examples
- Uses a restaurant menu, a unit converter, and a public joke service to illustrate contracts.
- What you can do after
- Evaluate and understand how an API defines interactions between app components or with an external service.
Read how Build Python Web Apps with Streamlit explains contract →
LLMs in Production
An API is a defined interface through which software applications request capabilities or data from another software system.
- How it is used
- Uses APIs both to prototype with purchased LLM access and to expose a deployed model as a service.
- How deep it goes
- Outlines service planning and operational features and gives a short client example, without a detailed interface specification.
- Examples
- Uses an OpenAI Python chat request and AI Dungeon’s experience with provider-imposed filtering.
- What you can do after
- Evaluate API access against self-deployment for prototyping, control, and service latency.
Grokking AI Applications
A defined interface through which software programs invoke operations or exchange data.
- How it is used
- Lets GenAI flows communicate with external applications or become callable services within larger applications.
- How deep it goes
- Defines the request–endpoint–response cycle, including parameters and authentication, then demonstrates a coded HTTP route returning JSON.
- Examples
- Uses a callable email-generation endpoint and describes API-driven email, CRM updates, and other actions.
- What you can do after
- Apply it via Langflow or FastAPI to let external applications call a GenAI flow and receive structured JSON.
API Design Patterns
An application programming interface is a defined interface through which software programs interact with a system's functionality or data.
- How it is used
- Defines computer-to-computer interaction and exposes reusable functionality through local interfaces or networked web APIs.
- How deep it goes
- Explains contracts, web API trade-offs, composition, expressiveness, and quality criteria, but defers detailed resource-oriented design.
- Examples
- Uses encryption services, translation operations, language detection workarounds, downloadable libraries, and web API changes.
- What you can do after
- Evaluate/understand API designs by checking programmatic usefulness, expressiveness, simplicity, predictability, and compatibility.
Effective Platform Engineering
An API is a defined software interface through which programs or users access capabilities or data provided by a system.
- How it is used
- Uses APIs as the first delivery boundary for self-service platform capabilities and cross-team collaboration.
- How deep it goes
- Explains API-first architecture, team boundaries, evolution, and consumer value without detailing protocols, schemas, or implementation mechanics.
- Examples
- Uses capabilities exposed before user interfaces, alpha-user experiments, developer portals, and platform integrations as concrete applications.
- What you can do after
- Apply API-first design to expose reusable platform capabilities, add interfaces incrementally, and assess consumer value through usage.
The Well-Grounded Python Developer: How the pros use Python and Flask
An application programming interface is a defined set of operations and rules through which software components communicate and access functionality.
- How it is used
- Connects application code to reusable functions, modules, operating-system services, and local or remote server functionality through predictable interfaces.
- How deep it goes
- Defines APIs as contracts, explains input and hidden implementation, and works through Python function signatures; defers detailed remote database access.
- Examples
- Uses `print("Hello World")`, the `print` signature, and evolving `full_name` parameters to make interface choices concrete.
- What you can do after
- Build it from scratch by defining clear Python function interfaces with suitable parameters, names, and documentation.
Read how The Well-Grounded Python Developer: How the pros use Python and Flask explains contract →
Machine Learning System Design
A defined interface through which software components request functionality or exchange data.
- How it is used
- Frames an API as a contract for integrating an ML system with users and other components.
- How deep it goes
- Provides design principles and integration practices while deferring general API design and REST-versus-RPC distinctions.
- Examples
- Uses predict functions with time and seed parameters and third-party AI services as concrete examples.
- What you can do after
- Evaluate API designs for simplicity and predictability, and apply integration practices that support compatibility and maintenance.
Build High Value Software Systems
An application programming interface is a defined set of operations and rules through which software components interact.
- How it is used
- Constrains implementation and review by making expected behavior, decisions, and cross-service agreements visible.
- How deep it goes
- Works through endpoint responses, temporary scaffolding, review questions, refined constraints, and cross-team consequences; does not specify a formal contract language.
- Examples
- Uses a 200/404 order endpoint with a temporary 501 stub, a constrained payment webhook, and incompatible inter-service event formats.
- What you can do after
- Practice/perform contract-guided scaffolding, testing, and review while questioning behavior that was not requested.
Read how Build High Value Software Systems explains contract →
Microservices Patterns, Second Edition
An interface that defines how software components interact and access one another's functionality.
- How it is used
- Uses contracts to establish collaboration boundaries between domain modules and independently deployed services.
- How deep it goes
- Explains contract forms, facade design, IDL purposes, and compatibility risks, with practical exceptions to API-only database access.
- Examples
- Illustrates a credit-reservation facade and an order query that retrieves information from multiple services.
- What you can do after
- Evaluate interface boundaries and compatibility risks when designing module or service collaboration.
Read how Microservices Patterns, Second Edition explains contract →
Web Components in Action
A defined programming interface through which a software component exposes operations or data to other components.
- How it is used
- Uses a component’s public interface to configure it and let it work with other components.
- How deep it goes
- Develops component APIs through properties, methods, attributes, callbacks, reflection, and access conventions.
- Examples
- Shows video controls through methods and properties, plus a search component configured with API-key and search-term setters.
- What you can do after
- Apply it by configuring a Web Component through JavaScript setters or HTML attributes.
Effective Conversational AI
An application programming interface (API) is a defined interface through which one software system or component requests capabilities, data, or operations from another.
- How it is used
- Connects conversational assistants to external services for task fulfillment, customer-data retrieval, or LLM text generation.
- How deep it goes
- Explains API inputs, responses, errors, and platform integration steps without descending into implementation code.
- Examples
- Illustrates password resets, an insurance member-ID voice flow, and an LLM-assisted bank-account balance request.
- What you can do after
- Apply it via an assistant platform to connect external services while planning for user effort and API failures.
Introduction to Generative AI, Second Edition
An application programming interface (API) is a defined programmatic interface through which software clients access a system's capabilities.
- How it is used
- Enables language-model agents to access external data and tools or potentially act through services.
- How deep it goes
- Explains tool inputs and outputs and the steps used to train Toolformer, without detailing API design.
- Examples
- Uses travel booking and payment, plus calculator, calendar, search, question-answering, and translation tools.
- What you can do after
- Evaluate how API access can extend an assistant while recognizing risks from incorrect recommendations or misunderstood preferences.
Read how Introduction to Generative AI, Second Edition explains contract →
Designing AI Systems
An API is a defined interface through which software components communicate and invoke capabilities, including interfaces exposed by external systems.
- How it is used
- Defines boundaries for SDK access, external workflow APIs, and internal platform services.
- How deep it goes
- Specifies service operations and request and response structures, including optional session identifiers and message retrieval fields.
- Examples
- Illustrates contracts with patient intake workflows and Model and Session Service interfaces.
- What you can do after
- Evaluate service interfaces against consumer needs, available operations, data requirements, and AI interaction timing.
Shipping Go: Develop, deliver, discuss, design, and go again
A defined interface through which software components or users interact with an application or service.
- How it is used
- Defines a stable boundary through which a handler calls a translation service while its implementation can change.
- How deep it goes
- Works through Go method definitions, interchangeable implementations, testing, and configured client selection; does not specify a formal API contract format.
- Examples
- Uses a Translator method, two greeting implementations, and a handler supplied with either a static or remote translation service.
- What you can do after
- Apply it via a Go interface to swap service implementations and test consumers without relying on an external service.
Read how Shipping Go: Develop, deliver, discuss, design, and go again explains contract →
ASP.NET Core in Action, 3e
A web API is an HTTP-accessible application interface that exposes operations or data to clients.
- How it is used
- Serves HTTP APIs to mobile apps, browser-based single-page applications, or other backend services.
- How deep it goes
- Distinguishes minimal APIs from more structured Web APIs and touches on HTTPS and authentication.
- Examples
- Uses mobile apps, browser-based single-page applications, and backend services as API clients.
- What you can do after
- Evaluate API fit against client types, existing systems, browser environments, scalability, and uptime requirements.
Automating API Delivery
An API is a defined set of functions and protocols forming a shared boundary through which software systems communicate and exchange information.
- How it is used
- Defines the shared software boundary for communication, while framing consumer-facing APIs as managed products.
- How deep it goes
- Defines API functions, protocols, forms, and product distinctions, but stops short of implementation internals.
- Examples
- Uses REST, SOAP, RPC, GraphQL, WebSocket, and internal Permissions APIs as concrete forms or applications.
- What you can do after
- Evaluate whether an interface is merely an integration boundary or a consumer-oriented API product requiring lifecycle investment.
The Art of Code
A public API is an externally accessible software interface whose operations and behavior are exposed for use by other systems or clients.
- How it is used
- Defines an externally dependable boundary that supports software durability and user trust.
- How deep it goes
- Explains contract contents, exposure risks, documentation maintenance, and compatibility practices without detailing a specific contract implementation.
- Examples
- Contrasts exposed database entities with clear REST response models to illustrate coupling and information-leak risks.
- What you can do after
- Evaluate public interfaces for unnecessary exposure and compatibility risks, and communicate unavoidable changes to users.
Google Anthos in Action
An API is a defined interface through which software components communicate and access capabilities or data.
- How it is used
- Uses standard service contracts to define boundaries while decomposing legacy applications into smaller services.
- How deep it goes
- Connects contracts to breaking-change detection and isolated domain testing without specifying contract formats.
- Examples
- Names authentication, authorization, and logging as capabilities teams may extract into separate services.
- What you can do after
- Apply standard contracts to identify potentially breaking service changes and test business-domain services independently.
Grokking Data Structures
An API is a defined set of programmatic operations and interaction rules exposed by a software component.
- How it is used
- Defines how clients interact with a data type without depending on its implementation.
- How deep it goes
- Specifies method signatures, behavior, and side effects, then illustrates how an implementation can restrict an underlying collection’s interface.
- Examples
- Uses a light switch, bag operations, linked-list search, a stack wrapper, and dictionary operations to make contracts concrete.
- What you can do after
- Build it from scratch by specifying permitted operations and their behavior while keeping internal nodes inaccessible to clients.
Amazon Web Services in Action, Third Edition: An in-depth guide to AWS
An application programming interface is a defined interface through which software can programmatically interact with a service or system.
- How it is used
- Provides the entry point for configuring AWS services and letting applications use them.
- How deep it goes
- Explains API access paths and an SDK call pattern, while leaving direct HTTP authentication and serialization to higher-level tools.
- Examples
- Shows a web application calling AWS services and a DynamoDB putItem call that adds a user.
- What you can do after
- Apply it via an AWS SDK by supplying parameters, invoking an operation, and checking for errors.
Read how Amazon Web Services in Action, Third Edition: An in-depth guide to AWS explains contract →
Learn Haskell by Example
An application programming interface is a defined set of operations and data representations through which software components interact.
- How it is used
- Defines HTTP and JSON operations for a todo-list server and its command-line client.
- How deep it goes
- Builds typed endpoint declarations and middleware decisions, while deferring explanations of DataKinds and TypeOperators.
- Examples
- Uses a todo-list service with entries, add, and toggle endpoints plus an HTML root page.
- What you can do after
- Build it from scratch as a typed Servant API with validated requests and derived client functions.
Advanced Algorithms and Data Structures
An API is a defined interface through which software requests operations or data from another software component or service.
- How it is used
- Defines the operations and guarantees that data structures expose to external clients.
- How deep it goes
- Distinguishes client-facing guarantees from internal invariants, data models, and algorithms.
- Examples
- Uses priority queue operations and a shared ordering interface for multiple retailers.
- What you can do after
- Build it from scratch by specifying operations, behavior, implementation details, and performance.
Read how Advanced Algorithms and Data Structures explains contract →
Microsoft Azure in Action
An API is a defined interface through which software components request functionality or data from other software.
- How it is used
- Connects applications to defined functionality or data, including partner access to a shop’s NFT images.
- How deep it goes
- Defines APIs and endpoints through inputs and HTTP URLs, then distinguishes Cosmos DB APIs by data model without specifying an interface schema.
- Examples
- Uses a power-calculation endpoint, partner access to NFT images, and Cosmos DB APIs for product, customer, and activity data.
- What you can do after
- Evaluate/understand an API as a software interface and distinguish an HTTP endpoint from a data-model-specific Cosmos DB API.
Django in Action
An API is a defined interface through which software components exchange requests, responses, or data.
- How it is used
- Connects external systems and alternate frontends to project data and application logic.
- How deep it goes
- Explains REST methods, payloads, versioning, Django views, Ninja routes, routers, and schemas.
- Examples
- Uses mobile apps, SPAs, JSON and XML payloads, HTTP CRUD methods, Django Ninja endpoints, and versioned URLs.
- What you can do after
- Build REST APIs in Django using views or Django Ninja, including routes, schemas, CRUD actions, and versions.
Rust Servers, Services, and Apps
An API is a defined interface through which software components communicate and request functionality or data.
- How it is used
- Connects application frontends with backend services and supporting distributed infrastructure.
- How deep it goes
- Develops APIs from architectural role through REST routes, handlers, data models, persistence, requests, and serialized responses.
- Examples
- Uses Actix REST services, tutor-management routes, command-line HTTP requests, authentication forms, and create-update-delete operations.
- What you can do after
- Build it from scratch with Actix, expose REST APIs, connect frontend requests, and interpret serialized backend responses.
Read how Rust Servers, Services, and Apps explains contract →
Applied Reinforcement Learning
A fixed, mutually agreed interface that connected software modules are not allowed to change silently.
- How it is used
- Connects a language model’s structured signals to the reinforcement-learning agent that consumes them.
- How deep it goes
- Defines thirteen named fields and bounded ranges, and calls for versioning and validation without detailing compatibility procedures.
- Examples
- Uses a MarketSignal schema with twelve directional or risk fields and a confidence field.
- What you can do after
- Build it from scratch by fixing field meanings and ranges, then validating and versioning the interface.
Terraform in Depth: Infrastructure as Code with Terraform and OpenTofu
A defined software interface through which one system invokes operations or accesses capabilities of another system.
- How it is used
- Frames the stable inputs and outputs that module users, command wrappers, and provider users rely on.
- How deep it goes
- Explains interface design through variable naming and provider planning, then distinguishes single-response JSON from streaming JSONL without specifying every output field.
- Examples
- Uses mismatched subnet variable names, `show` and `plan` output, and a provider configuration with an account lookup and post resource.
- What you can do after
- Build it from scratch by defining provider resources, data sources, and functions around intended user actions before implementation.
Read how Terraform in Depth: Infrastructure as Code with Terraform and OpenTofu explains contract →
Digital Twins in Action
An API is a defined interface through which software components access operations or data provided by another component.
- How it is used
- Connects digital twins to internal and external data through on-demand and event-driven integration.
- How deep it goes
- Compares integration patterns and identifies contract failure risks, but stops short of defining a complete API specification.
- Examples
- Uses a NASA GIBS image request and compares a paid LLM API with a rule engine for home energy decisions.
- What you can do after
- Evaluate API integration patterns, operating costs, and compatibility risks for a digital twin.
Data Pipelines with Apache Airflow, Second Edition
An API is a defined interface through which software applications programmatically access data or functionality.
- How it is used
- Uses APIs to retrieve workflow data or trigger Airflow DAGs from outside Airflow.
- How deep it goes
- Shows endpoints, authentication, request inputs, and responses, while leaving cloud request-and-response internals to clients and operators.
- Examples
- Demonstrates authenticated Citi Bike ride queries and POST requests that trigger Airflow DAG runs.
- What you can do after
- Apply it via curl and Airflow’s REST API to retrieve records or trigger DAG runs, while checking authentication and possible result limits.
Read how Data Pipelines with Apache Airflow, Second Edition explains contract →
Architecting for Autonomy
An API is a defined interface through which software components request operations or exchange data.
- How it is used
- Defines how an agent or software component invokes an operation and receives its response.
- How deep it goes
- Specifies invocation shape, schemas, status codes, and authentication, but not delegated authority or decision context.
- Examples
- Uses production-history retrieval and a core-ledger freeze-account API to illustrate consequential operations.
- What you can do after
- Evaluate whether a valid request and response also stay within the agent’s permitted authority.
gRPC Microservices in Go
An API is an interface that exposes an application's core functionality to other software modules or external consumers.
- How it is used
- Defines callable service operations and application-port actions so other services or components can use core functionality.
- How deep it goes
- Works through .proto messages, stub generation, and Go port signatures, but does not detail protocol internals.
- Examples
- Uses a Payment creation request and response, an Order API port, and mocked database and payment calls.
- What you can do after
- Build it from scratch with .proto definitions and generated stubs, or implement Go port interfaces for application boundaries.
The Art of Unit Testing 3e
An application programming interface is a defined set of operations and data contracts through which software components communicate.
- How it is used
- Uses contracts to focus tests on observable behavior and reduce maintenance when production APIs change.
- How deep it goes
- Explains observable behavior, API-change consequences, and factory-based mitigation through concrete testing examples.
- Examples
- Uses a PasswordVerifier constructor and logger change, plus private methods exercised through public use cases.
- What you can do after
- Evaluate whether tests check observable behavior and apply factory functions to limit edits after constructor changes.
Machines that Think
An application programming interface (API) is a defined interface through which software exposes functionality or data to other software.
- How it is used
- Positions APIs as interfaces for integrating externally developed language models into software.
- How deep it goes
- Explains infrastructure abstraction and provider dependency, without detailing API specifications or implementation.
- Examples
- Names OpenAI and Anthropic models accessed directly or through Microsoft Azure and Amazon Web Services.
- What you can do after
- Evaluate trade-offs between convenient managed access and dependence on externally governed model services.
Functional Programming in Scala, Second Edition
An application programming interface is a set of operations and abstractions through which software components are programmed or composed.
- How it is used
- Uses abstract operations and laws to design reusable functional libraries before committing to concrete implementations.
- How deep it goes
- Develops APIs through types, primitives, combinators, laws, interpreters, and iterative usability checks, rather than stopping at interface definition.
- Examples
- Uses Par operations, JSON parser construction, parser combinators, and automatically generated property-based tests as concrete API settings.
- What you can do after
- Build it from scratch by selecting primitives, deriving combinators, specifying laws, and refining the interface against implementations and usage.
Read how Functional Programming in Scala, Second Edition explains contract →
Acing the Frontend Interview
An API contract is a defined agreement describing the data shapes and interaction rules shared between software components or services.
- How it is used
- Uses versioned API/UI contracts to prevent tight coupling and breaking changes in domain-segmented applications.
- How deep it goes
- Raises versioning shared API responses and components as a design question but does not specify a strategy.
- Examples
- Names API responses and shared components as contracts to version.
- What you can do after
- Evaluate versioning choices for shared API responses and components against the risk of breaking changes.
AI Agents in Action, Second Edition
An API is a defined interface through which software applications communicate with services or other software components.
- How it is used
- Defines how clients, services, agents, and tools exchange requests and results across an interface.
- How deep it goes
- Works through a FastAPI endpoint, request model, response format, and missing-output error, alongside MCP tool schemas.
- Examples
- Uses an image-generation POST endpoint returning PNG bytes and MCP tools described by parameter schemas and return types.
- What you can do after
- Apply it via FastAPI to expose an agent through a POST endpoint with a defined request and response.
Read how AI Agents in Action, Second Edition explains contract →
React in Depth
An API is a defined interface through which software applications exchange requests and responses with another application or service.
- How it is used
- Routes goal-tracker reads and writes through a server and enables client-side geocoding in a weather app.
- How deep it goes
- Defines REST and CRUD, then implements geocoding routes; leaves broader API design beyond scope.
- Examples
- Uses goal-tracker session, user, and things endpoints plus coordinate-to-city geocoding in Next.js and Remix.
- What you can do after
- Build it from scratch by implementing geocoding routes that read coordinates, call a service, and return JSON or a 404.
Software Engineering for Data Scientists
An application programming interface is a defined interface through which software components request functionality or data from another software component.
- How it is used
- Deploys Python models and applications so other languages, servers, or web clients can request their functionality.
- How deep it goes
- Defines client-service communication and compares request types, architectures, and transports without detailing endpoint implementation.
- Examples
- Uses Google search, browser request types, customer churn predictions, database feature retrieval, and cross-language Python services.
- What you can do after
- Apply it via FastAPI to expose Python model predictions to other languages, systems, servers, or web applications.
Read how Software Engineering for Data Scientists explains contract →
Vibe Engineering
An API is a defined interface through which software systems communicate and invoke one another's capabilities.
- How it is used
- Uses API contracts to catch service incompatibilities, including changes introduced while modifying AI-generated code.
- How deep it goes
- Defines consumer-provider checks with a worked request-response example and distinguishes specified behavior from deeper correctness.
- Examples
- Uses a CMS sending markup to a rendering service and expecting HTML in return.
- What you can do after
- Diagnose service-breaking API changes by running tests against consumer expectations and provider responses.
Refactoring to Rust
An API is a defined interface through which software components expose operations and exchange data.
- How it is used
- Defines which Rust crate items users can call and what behavior refactoring should preserve.
- How deep it goes
- Explains public visibility, re-exports, and behavior compatibility with examples, but gives no formal contract schema.
- Examples
- Uses a forest crate to contrast deep function paths with a short re-exported entry point.
- What you can do after
- Apply it by exposing intended entry points and checking that refactored code preserves existing behavior.
Delivering Machine Learning Projects: From design to deployment
An API is a defined interface that enables software components to communicate and invoke available data or functionality.
- How it is used
- Decouples production data access from the implementation details of underlying sources.
- How deep it goes
- Explains the abstraction’s benefits and recommends controlled, documented interactions, but specifies no API protocol or schema.
- Examples
- Uses an API address to invoke a query and database upgrades to illustrate the abstraction’s value.
- What you can do after
- Operate data access through a documented API rather than coupling system interactions to database implementations.
Read how Delivering Machine Learning Projects: From design to deployment explains contract →
Modern C, Third Edition
A library interface is the specified set of declarations and calling conventions through which software accesses library functionality.
- How it is used
- Defines what a function does and supplies the clear semantics needed for portable use of C library functionality.
- How deep it goes
- Distinguishes interface specification and purpose from code organization and implementation details.
- Examples
- Illustrates library interfaces with printf, puts, and strtod, and contrasts interface comments with implementation comments.
- What you can do after
- Understand which details belong in an interface specification versus implementation code and comments.
Designing AI Agents
An agreement specifying conditions that a task, state, authority, or evidence must satisfy.
- How it is used
- Defines enforceable boundaries at consequential handoffs in agent workflows while preserving flexible exploration.
- How deep it goes
- Details conditions and optional fields for consequential interfaces, then uses contract violations to locate failures.
- Examples
- Illustrates runtime binding with a salary-template identifier and diagnosis with a reviewer that overlooks missing relationship endpoints.
- What you can do after
- Diagnose/debug a composed agent by tracing the first contract violation, and specify controls for consequential handoffs.
Vanilla Web
A specification of an API's operations, inputs, outputs, and behavioral requirements.
- How it is used
- Guides micro-library adoption and safe use through concrete API documentation.
- How deep it goes
- Specifies signatures, inputs, side effects, returns, and lifecycle rules without detailing implementation internals.
- Examples
- Recommends one or two complete usage examples alongside exact API details.
- What you can do after
- Evaluate a micro-library's fit and use it safely by checking signatures, inputs, side effects, returns, and lifecycle rules.
Also covered in
- Designing Deep Learning Systems: A guide for software engineers
- Investing for Programmers
- Acing the CCNA Exam: Volume 2 Advanced Networking and Security
- Healthcare ITIn early access (MEAP)
- Essential GraphRAG
- Type-Driven Development with Idris
- Robotics for ProgrammersIn early access (MEAP)
- Think Distributed Systems
- Data-Oriented Programming: Reduce software complexity
- Grokking Simplicity
- Software Architecture Decision-MakingIn early access (MEAP)
- Software Design for Python Programmers
What to know first
- JSONJSON is a language-independent text-based data-interchange format that represents structured values using objects, arrays, strings, numbers, booleans, and null.
- language modelA language model is a computational model that represents patterns in linguistic sequences to assign probabilities, predict, generate, or evaluate language.
- PythonPython is a high-level, general-purpose, dynamically typed programming language with readable syntax and support for multiple programming paradigms.
- RESTREST is an architectural style for distributed systems that organizes interactions around identifiable resources and their representations, using a uniform interface and constraints such as statelessness and cacheability.
Related concepts
- endpointhas part · An endpoint is an addressable interface of a service through which clients access a resource or invoke an operation, typically via a network request.
- HTTPuses · HTTP is an application-layer protocol that defines request-and-response communication for transferring resource representations and related metadata between networked systems.
- LangChainused by · LangChain is an open-source software framework for building applications that compose language models with prompts, data sources, tools, and other components.
- MCP serverused by · An MCP server is a software component that implements the Model Context Protocol to expose tools, data, or other capabilities to compatible clients.
- MCPcontrasts with · The Model Context Protocol is an open standard that defines how AI applications connect with external tools, data sources, and other contextual resources.
- empty interfaceincludes · any is a type or type constraint that permits values of arbitrary concrete types without requiring a more specific interface or representation.
Questions about contract
What is contract?
A contract is an agreed specification of the conditions, expectations, rights, or obligations that govern behavior or interactions between parties or software components.
Which Manning books explain contract?
Secure APIs, Platform Engineering on Kubernetes, The Design of Web APIs, Second Edition, Grokking Software Architecture, Functional Design and Architecture: Examples in Haskell, Crack Any Codebase with AI, Learn Go with Pocket-Sized Projects, Simple Object-Oriented Design: Create clean, maintainable applications and 50 more.
What should I know before learning contract?
Manning books that teach contract usually introduce JSON, language model, Python and REST first.
What is the difference between contract and MCP?
A contract is an agreed specification of the conditions, expectations, rights, or obligations that govern behavior or interactions between parties or software components. The Model Context Protocol is an open standard that defines how AI applications connect with external tools, data sources, and other contextual resources.
What kinds of contract are there?
Kinds of contract include empty interface.
What are the parts of contract?
Contract includes endpoint.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

























































