The short answer
An API, or application programming interface, is a set of rules that lets one piece of software ask another for information or an action. When a website shows a payment form, a map or live delivery options, it usually asks another service through that service's API. You rarely use an API yourself, but your developer connects your site to them.
What is an API, in plain terms?
The question what is an API has a short answer: it is an agreed way for two programs to talk. One side sends a request in a set format, the other side checks it, does the job and sends back a reply in a set format. Neither side needs to know how the other works inside.
A parcel hatch at a post office is a fair picture. You hand over a filled-in form at the hatch. You do not walk into the sorting room. The clerk follows the office's rules, and what comes back is a receipt or your parcel. The form, the hatch and the rules together are the API. If the office rearranges the sorting room, your form still works, as long as the form itself has not changed.
How an API request works
A typical exchange has five parts. The table uses a delivery-options feature as the example.
| Part | What it means | Example |
|---|---|---|
| Request | A message from your site to another service | List the delivery options for this parcel |
| Endpoint | The web address the request is sent to | An address published by the delivery service |
| Details | What you are asking about | Parcel weight, size and destination |
| Key | A secret code that shows who you are | Your account's key, issued by the service |
| Response | The reply, usually structured data | A list of options, each with a name and a cost in the data |
The reply usually arrives as structured text, most often in a format called JSON, which a program can read directly. Your website then turns that data into something a visitor can use: a list of choices, a map pin, a confirmation message. The reply also carries a status that says whether the request worked. When it did not, the status and message are what your developer reads to find out why.
Where websites use APIs
| Feature on your site | What your site asks | What comes back |
|---|---|---|
| Taking card payments | Passes the payment to the payment provider, often through a form the provider hosts | Whether the payment succeeded |
| Showing delivery options | Asks a carrier or shipping service about a parcel | The services available and their costs |
| Address lookup | Sends the first part of an address the visitor typed | Matching addresses to choose from |
| Embedded maps | Asks for a map of a place | Map data to display |
| Booking calendar | Checks availability and sends a booking | Open slots and a confirmation |
| Newsletter sign-up | Sends the visitor's email address to the mailing service | Confirmation that they were added |
| Enquiries into a CRM | Passes a form entry to the customer database | A new record |
Many of these arrive packaged as plugins or ready-made connectors, so you may never see the API. A plugin is a packaged piece of software. The API is the channel it uses to talk to the other service.
Analytics and heatmap tools are usually added by a small script on the page, though many also offer an API for pulling data out. The guide to heatmaps and session recordings explains what those tools record.
When would my website need an API?
Your site needs one when it must exchange information with a system you do not run. If the site only shows pages and has a contact form that emails you, no API work may be visible. As soon as you want live delivery options, payments, a booking calendar that checks availability, or customer data passed into a CRM, an API is involved.
That is website API integration in practice, and there are two routes. You can use a ready-made plugin or connector that already handles the exchange, or you can have a developer write a custom connection. The first is quicker when a connector exists and fits. The second is for needs that no connector meets, such as passing data in your own format to an internal system. Which is right depends on your platform, the provider and your budget.
The type of site matters too. A dynamic site can make the request on its server. A static site can still use APIs, either from the visitor's browser or when the site is built. The comparison of static vs dynamic websites explains the difference.
Public APIs, private APIs and webhooks
A public API is offered by a company for others to build on, with documentation and usually an account. A private API is used inside one company or between its own products, for example between a store's website and its mobile app. A website and an app can share one API. That is why the choice described in native vs Flutter vs React Native shapes the app's code but does not decide whether the app can reach your systems.
A webhook reverses the direction. Instead of your site asking again and again whether anything has happened, the other service sends your site a message when an event occurs, such as a completed payment or a new order. Webhooks suit cases where speed matters, and they need a safe address on your side to receive them.
API keys, security and privacy
An API key works like a password for a connection, so treat it like one.
- Secret keys belong on the server, never in code that a visitor's browser can read. Ask your developer where each key is kept.
- Give each key only the permissions it needs, and use separate test and live keys where the provider offers them.
- The business, not an individual freelancer, should own the account that issues each key, so access survives a change of developer.
- Keep a record of every integration, the account it uses and who can reset it. Store it securely, not in an email thread.
- If a key may have leaked, replace it through the provider straight away.
Privacy deserves a thought too. Every call that carries customer details sends personal data to another company, and your privacy information should reflect that. Rules differ by country, so ask a lawyer about yours. Integration settings and keys, stored securely, also belong in what you back up. The guide to what to back up on a website covers the rest.
What can go wrong with integrations
- The provider changes or retires a version of its API. Providers normally publish notices, so someone needs to be reading them.
- The provider has an outage, and the feature that depends on it fails. A good integration shows a clear message instead of a blank space.
- Limits apply. Providers often cap how many requests you can make in a period, and some charge according to use. Check the provider's current terms against your expected volume.
- A slow API slows your page, if the site waits for the answer before it shows anything.
- Data does not match. Names, formats or codes differ between systems, and orders or contacts arrive incomplete.
- Hosting restrictions get in the way. Some plans limit scheduled tasks or outgoing connections, so check the plan's current documentation. The guide to types of web hosting explains the options.
What to ask a developer about integrations
- Which services will the site connect to, and what exactly passes between them?
- Is there an official API or connector, or is the integration built on unofficial methods?
- Who owns the accounts and keys, and where are they stored?
- What does a visitor see if the other service is down?
- How are errors logged, and who is alerted?
- Is there a test mode, and was it used before going live?
- Who watches for provider changes, and how are updates made?
- What are the provider's limits and charges at our expected volume?
- What personal data leaves the site, and is it described in the privacy information?
- Will documentation be handed over at the end?
Put the answers in writing in the project scope. A team that builds websites should be able to answer them plainly, and the website development page from Liftup Technologies describes the work it covers.
