An API (application programming interface) is a set of rules that lets one program ask another program for data or actions. MDN describes it as a contract between the application that offers the API and the software that uses it. Instead of a person clicking through a screen, software sends a request and gets a structured answer back.
How does an API work?
Most APIs that marketers deal with are web APIs. They work over HTTP, the same protocol browsers use.
- A request. One system sends a request to an address (an endpoint), for example "create a new contact" with the contact's details.
- Authentication. The request includes a key or token that proves it is allowed. See authentication.
- Processing. The receiving system checks the request and does the work.
- A response. It sends back a result, usually in JSON or sometimes XML, such as the new contact's ID or an error message.
Many web APIs follow the REST style, outlined by Roy Fielding in his 2000 doctoral dissertation. See REST API.
What are the types of API?
By who can use them:
- Private APIs are used only inside one organisation.
- Partner APIs are shared with approved business partners.
- Public APIs are open to outside developers. Some are free, some are paid, and many still require you to register for access.
By what they connect:
- Web APIs connect applications over the internet.
- Database APIs let an application read and write data in a database.
- Operating system APIs let applications use the services of an operating system.
- Browser APIs let a web page use browser features, such as location or the camera, with the user's permission.
How do sales and marketing teams use APIs?
Most "integrations" between marketing tools are APIs at work. Common patterns:
- Lead capture. A website form sends each new lead straight into the CRM.
- Enrichment. The CRM sends a company domain to a data provider and gets back industry and company size.
- Email sync. The email platform pulls segments from the CRM and writes opens, clicks and unsubscribes back.
- Reporting. A dashboard tool pulls numbers from ads, analytics and CRM accounts into one report.
- Product signals. A SaaS app sends usage events to the CRM so sales can see which trial accounts are active.
What should you check before relying on a tool's API?
- Which data it exposes. An integration is only as useful as the fields the API can read and write.
- Access and cost. Check whether API access is included in the plan you are buying.
- Documentation. Clear documentation, with examples and stated limits, makes integration work much faster.
- Security. Store API keys like passwords, give each integration only the permissions it needs, and remove keys you no longer use.
Frequently asked questions
What is an API in simple terms?
An API is a fixed way for two programs to talk. One program sends a request in an agreed format, and the other sends back data or confirms that it did something. MDN describes it as a contract between the application offering it and the software using it.
What are the three types of API by access?
Private APIs are used only inside a company. Partner APIs are opened to approved business partners. Public APIs are available to outside developers, though many still require registration or an access token.
Why do marketers need to know about APIs?
Most marketing tools connect through APIs. When you check whether a new tool "integrates" with your CRM, you are really asking whether one tool can use the other's API, and which data the API exposes.