web dev//API
An API (Application Programming Interface) is a contract between two pieces of software: a given request receives a given response. In web development it almost always means HTTP endpoints that return JSON.
An API (Application Programming Interface) is a contract between two pieces of software: a given request receives a given response. In web development it almost always means HTTP endpoints that return JSON.
Most web APIs are stateless: each request carries everything the server needs, and the client keeps the state.
External APIs are third-party services an app calls over HTTP (Google, Stripe, Sentry and so on).
With event-driven APIs, the app fires an event and the processing happens asynchronously in a job queue.
Internal APIs are an app's own backend endpoints, called by its frontend. In Next.js, API Routes define the internal API, deployed as Vercel Functions.
Instead of looking at the shop and reading the labels, you ask the warehouse directly for product 123 in JSON.
That is why an API beats scraping whenever one exists, and why a hybrid agent reaches for it first.