Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A web API is an interface that lets software use capabilities or data provided by a browser or an online service. It defines how one program can interact with another; it is not a screen designed for people. The phrase commonly means either browser-provided features, such as the DOM, or an interface offered by an external service, such as a maps or weather service.

What is a web API?

API stands for Application Programming Interface. An API is a set of features and rules through which one piece of software can interact with another. MDN Web Docs describes an API as enabling interaction with software “as opposed to a human user interface.” In practical terms, it is a contract: the provider makes certain operations or data available, and the program using the API follows the defined rules.

“Web API” has two common meanings. It can mean functionality supplied by a web browser for code running in a page, or an interface provided by an online service that a program reaches over the network. Both help software do something, but they are not interchangeable: a browser API is available through the browser, while a service API is supplied by the service provider.

The two common kinds of web API

Browser APIs

A browser API exposes capabilities of the browser or the environment in which a web page runs. The Document Object Model (DOM), for example, lets JavaScript inspect and update page content. Web Audio exposes audio-processing capabilities, and browser storage APIs let websites retain data. MDN’s introduction to web APIs discusses these browser features alongside APIs provided by third parties.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

JavaScript is often used to call browser APIs, but those APIs are not the JavaScript language itself. JavaScript is the programming language; the browser exposes additional objects, methods, events, and other interfaces that JavaScript code can use. This distinction matters when a feature works in one environment but not another: language support and browser API support are separate questions.

Third-party or service APIs

A service API makes a platform’s data, functionality, or operations available to other software. For example, a website could request forecast information from a weather service and use the response to update its page. A maps service could provide map-related functionality to an application. The service’s own documentation defines what it offers and the rules for using it.

A service API may be accessed through HTTP, but “API” does not mean “URL.” A URL can be part of an HTTP-based service interface; the API is the larger contract that explains which operations are available and how software should request and interpret them.

How an HTTP-backed API call works

For an HTTP-backed service API, a client sends a request to a server. The request identifies an operation and may include a resource path, headers, and a body. The server sends back a response containing a status code and headers, and it may also include a body. HTTP is fundamentally a client-server, stateless protocol; cookies can be used to support stateful sessions. MDN’s overview of HTTP explains the request-and-response model.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. The client prepares a request. The client might be a browser script, a server-side program, or another application. It chooses the service endpoint and an HTTP method such as GET or POST, then supplies any required headers, parameters, or body.
  2. The server processes it. The service applies its own rules to the request. Authentication, permitted operations, and input requirements depend on that service; there is no single set of rules shared by all APIs.
  3. The server returns a response. The response includes a status code and headers, and may contain data or another result in its body. Client code needs to interpret the response rather than assume that every request succeeded.
  4. The client uses the result. A webpage could, for instance, use forecast data from a response to update what it displays. In this example, the weather service provides the service API; the browser’s Fetch API is one way the page can make the network request.

This distinction between the service interface and the browser tool used to call it is useful: a service’s API defines what the service accepts and returns, while Fetch is a browser API for making network requests. MDN’s Fetch API documentation covers the browser-side interface.

Using Fetch and checking the response

In browser JavaScript, fetch() returns a Promise that resolves to a Response when response headers arrive. A resolved Promise does not necessarily mean the HTTP request succeeded: an HTTP error status can still produce a response. Code should inspect the response status before treating the result as successful.

The pattern below shows the status check without assuming a particular service, endpoint, authentication scheme, or response format:

async function requestData(url) {
  const response = await fetch(url);

  if (!response.ok) {
    throw new Error(`HTTP error: ${response.status}`);
  }

  return response.json();
}

This example assumes a successful response contains JSON. A real API might return a different format, require headers or a request body, or define other success conditions. Follow that provider’s documentation rather than treating the example as a universal API recipe.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

ScreenshotNeo is one concrete service-API example: a developer can make a GET request to its endpoint with a URL and receive a screenshot or PDF. The service’s API documentation describes its interface. For example, this cURL request asks for a screenshot of Stripe’s website:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

That is an external service API call, not a browser API. The request goes to the service endpoint, and the returned file is saved by cURL. The API key shown as YOUR_API_KEY is a value the user must replace with their own key.

Web APIs are not all REST APIs

It is inaccurate to define every web API as a URL or to assume every API is REST. Browser APIs may consist of objects, methods, events, and permission rules rather than network URLs. External service APIs often use HTTP requests and responses, but API describes the software interface and its contract—not one mandatory transport or architecture.

HTTP methods such as GET and POST are parts of many web-service interactions. Their presence alone does not establish that a service follows a particular architectural style. To know how a service works, consult the provider’s documentation for its actual request format, operations, and response behavior.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
API Design Patterns
  • API Design Patterns
  • ABIS BOOK
  • Manning Publications

Security, permissions, and browser compatibility

Browser APIs are governed by web security rules. Some features require an HTTPS secure context or ask the user for permission, and support can vary by API and browser. A feature that exists in one browser should not be assumed to work in every browser.

The Network Information API illustrates the compatibility issue: MDN labels it “Limited availability” and notes that it does not work in some widely used browsers. Check the Network Information API documentation for its current support information before depending on it.

External service APIs have their own authentication requirements, usage rules, and availability. Those details cannot be inferred from the phrase “web API.” For a specific service, use its current official documentation to establish what credentials it requires, which requests it accepts, and what restrictions apply.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How to choose an API for a task

There is no universal “best web API”: a browser feature and an external service solve different problems. Start by identifying what the application needs to do, then check the relevant criteria for the kind of API under consideration.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a browser API

  • Capability: Does the API provide the browser feature the application needs?
  • Compatibility: Does it work in the browsers and environments the application must support? Check current compatibility information for the particular API.
  • Security and permissions: Does it require HTTPS, user permission, or other conditions?
  • Data exposure: What information can the API access or make available to the page?

For an external service API

  • Operation or data: Does the service offer the operation or information the application needs?
  • Authentication and format: What credentials, request formats, and response formats does its documentation specify?
  • Usage rules: What limits and terms apply to the service?
  • Reliability and fallback: What availability does the provider document, and what should the application do if a request fails?

These are evaluation questions, not universal values: exact authentication methods, limits, terms, support, and availability come from the individual API provider or browser documentation.

Frequently confused terms

Is JavaScript an API?

JavaScript is a programming language, not a browser API. JavaScript code commonly uses browser APIs such as the DOM or Fetch, but the language and those browser-provided interfaces are distinct.

Is an API the same as an endpoint?

No. An endpoint can be one address used to access an HTTP-backed service API. The API includes the documented rules and operations for interacting with the service, not just that address.

Does every web API need an internet connection?

No. Browser APIs expose features within the browser and are not necessarily calls to an external online service. An API provided by an external service commonly involves network communication, but the phrase “web API” also includes browser-side interfaces.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Quick Recap

SaleBestseller No. 1
Bestseller No. 3
Bestseller No. 4
API Design Patterns
API Design Patterns
API Design Patterns; ABIS BOOK; Manning Publications
$59.99

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.