```yaml
product: AlterLab
title: "API Discovery — Web Scraping Glossary | AlterLab"
comparison_context: "AlterLab is an alternative to Firecrawl, ScrapingBee, and Bright Data."
source_url: https://alterlab.io/glossary/api-discovery
```

extraction

# API Discovery

API discovery is the process of identifying undocumented JSON or GraphQL endpoints used by a website's frontend that can be called directly for cleaner data than HTML scraping.

Modern websites are often SPAs that load data from backend APIs rather than serving it in the initial HTML. These APIs — while not documented publicly — can be discovered by intercepting the browser's network traffic using browser DevTools or a proxy. Once discovered, these endpoints can be called directly with the appropriate headers and authentication tokens, bypassing HTML parsing entirely and returning clean, structured JSON.

API discovery is one of the most high-value techniques in scraping because API responses are inherently structured, versioned, and stable compared to HTML which changes with every design update. An API endpoint that powers a product listing page returns JSON that maps directly to data fields; the equivalent HTML scraping requires fragile CSS selectors that break with any redesign.

Network interception tools (Playwright's `page.on('response')`, mitmproxy, Charles Proxy, browser DevTools Network tab) make API discovery accessible. Look for requests to `/api/`, `/graphql`, `/v1/`, or JSON responses (`Content-Type: application/json`) triggered by page interactions.

### What is API Discovery?

API discovery is the process of identifying undocumented JSON or GraphQL endpoints used by a website's frontend that can be called directly for cleaner data than HTML scraping.

### How does AlterLab handle API Discovery?

Network interception tools (Playwright's `page.on('response')`, mitmproxy, Charles Proxy, browser DevTools Network tab) make API discovery accessible. Look for requests to `/api/`, `/graphql`, `/v1/`, or JSON responses (`Content-Type: application/json`) triggered by page interactions.

## Examples

```
// Browser DevTools: capture API calls during page interaction
// Open DevTools → Network → filter by "Fetch/XHR" → interact with page
// Look for JSON responses — those are your API endpoints

// Playwright: auto-discover APIs
page.on("response", async response => {
  if (response.headers()["content-type"]?.includes("application/json")) {
    const url = response.url();
    const body = await response.json();
    console.log("API endpoint found:", url, body);
  }
});
```

## Related Terms

[Network InterceptionCapturing XHR/fetch API responses made by a page's JavaScript during browser rendering to extract structured data directly from network calls.](https://alterlab.io/glossary/network-interception)[REST APIA web service that exposes data and actions through standard HTTP methods and resource-oriented URLs, returning structured JSON responses.](https://alterlab.io/glossary/rest-api)[GraphQLA query language for APIs that allows clients to request exactly the fields they need, commonly used by modern SPAs and a more efficient scraping target than REST.](https://alterlab.io/glossary/graphql)[SPA ScrapingSPA scraping targets Single-Page Applications, where the HTML shell is static but all content is rendered by JavaScript after the initial page load.](https://alterlab.io/glossary/spa-scraping)[Content NegotiationContent negotiation is an HTTP mechanism where the client specifies preferred response formats (JSON, HTML, XML) via Accept headers and the server responds in the best matching format.](https://alterlab.io/glossary/content-negotiation)

## Extract API Discovery data from any website

AlterLab returns clean, structured data from any public URL — no scraper infrastructure needed. Start free, no credit card required.

[View API docs](https://alterlab.io/docs/api/rest)

[Back to Glossary](https://alterlab.io/glossary)