API
114 bites tagged API — interview questions with model answers, and 60-second explainers.
gRPC: High-Performance RPC with Contracts
gRPC is a typed, high-performance function call between services. Instead of crafting JSON, you define a contract and gRPC handles the efficient binary transport. It's for low-latency microservice communication.
Webhooks: Don't Call Us, We'll Call You
A webhook is an automated HTTP callback from a service to your app when an event happens. Instead of polling for updates, the service calls you. This is how Stripe signals a payment or GitHub a commit.
GraphQL Queries: Ask for Exactly What You Need
GraphQL lets clients ask for exactly the data they need in a single call, like a flexible SQL query for your API. It avoids the over-fetching of fixed REST endpoints, making apps faster. The footgun: complex client queries can overload your server.
API Authentication: Who Goes There?
API authentication is the bouncer at your application's door, checking IDs to prove who is making a request. It's used to protect any networked service, from weather data to banking.
JSON: The Lingua Franca of Web APIs
JSON is a universal translator for data, using human-readable text to describe objects and lists. It's the default for web APIs sending data to browsers. The footgun is treating it as a JavaScript object; JSON is a stricter string format.
Consuming REST APIs: Speaking to Web Services
Think of consuming a REST API like ordering from a menu. You use standard actions (GET, POST) on specific URLs to request or change data. This is how apps fetch user profiles, get weather data, or submit forms. The footgun: Don't ignore HTTP status codes.
ML Inference Endpoint: The API for Your Model
An ML inference endpoint is the stable API URL your application calls to get predictions. It separates the public URL from the underlying model, letting you swap models without changing client code.
Cloud Computer Vision: Renting an AI's Eyes via API
Think of it as an API that lets your app 'see.' You send an image and get back structured data like object labels or text. It's used for content moderation, digitizing documents, or making photo libraries searchable.
Cloud NLP Services: Pre-trained Language Models as an API
Cloud NLP services are like having a team of linguists on-demand via an API. Use them to instantly analyze text for sentiment, entities (people, places), or topics without building your own models.
Pre-trained AI Services: Renting Expertise, Not Building It
Pre-trained AI services are like renting an expert's brain via an API. Instead of training your own model, you call a service for tasks like speech-to-text or image analysis. The footgun is assuming a general model will master your specific industry jargon.
API Gateway: The Front Door for Your Microservices
An API Gateway is the single front door for all your backend services. It handles tasks like authentication and rate limiting before routing requests to the correct microservice. The footgun is treating it as a simple proxy; it can become a bottleneck.
Developer Portals: A Self-Service Hub for APIs
A developer portal is a self-service hub for APIs, bundling docs and access controls so developers can discover and use APIs without platform team help. They're used externally for third-party developers or internally for infrastructure automation.
Platform API: The Contract for Your Developer Platform
The Platform API is the central contract for your internal developer platform, abstracting complex tooling into simple, self-service actions. It's what a developer portal or CLI calls to provision a database or scaffold a new service without knowing the…
Handling API State with a Sealed Class Wrapper
Treat API calls as states, not just data. A sealed class wrapper (`Success`, `Error`, `Loading`) models these states for your UI. Use this with Retrofit to show spinners or errors without crashing. The footgun: don't scatter try-catch blocks; centralize them.
Retrofit: Turn Your HTTP API into an Interface
Retrofit turns your HTTP API into a simple interface, letting you define network calls as annotated methods. It's the standard for most Android network tasks. Footgun: forgetting to run calls off the main thread will crash your app.
REST: The Architectural Style for Web APIs
REST is the architectural style for web APIs, using standard HTTP methods like GET and POST to manage data. Your Android app uses it to fetch user profiles from a server. The footgun is treating REST as a strict protocol; it's a set of guidelines.
Contract Testing: Test Interfaces, Not Integrations
Contract testing ensures services work together without slow integration tests. It's a formal agreement where a 'consumer' defines its needs, and a 'provider' proves it can meet them.
Tool Use: Giving LLMs Access to External Systems
Tool use lets an LLM call external functions, like a brain accessing a calculator or the internet. This is the core mechanism behind AI agents that can search the web, run code, or query a database to answer questions. The biggest footgun is assuming the model will always generate a valid function call; without enforcing a strict schema to match your function's expected input, your agent can fail unpredictably.
Get API bites daily.
Five a day, five minutes, offline. With quizzes so it sticks.
Open testing — you’ll join as an early tester.