---
name: unbrowser-api
description: "API-focused web browsing with automatic endpoint discovery, authentication, and learning analytics. Discover APIs from websites, manage authentication flows, and track pattern learning. Perfect for API testing and integration workflows."
---

# Unbrowser API Discovery

Advanced API discovery and integration capabilities with learning analytics.

## Tools Included (8)

### Core Browsing
- `smart_browse` - Intelligent browsing with API discovery
- `batch_browse` - Process multiple URLs efficiently

### Research Tools
- `research` - Search-first research with multi-source synthesis
- `quick_fetch` - Fast single-source content fetch

### API Management
- `execute_api_call` - Call discovered APIs directly
- `api_auth` - Manage API authentication flows
- `session_management` - Manage authenticated sessions

### Learning & Analytics
- `dynamic_handler_stats` - View learning patterns and success rates

**Token usage: ~4,000 tokens**

## When to Use This Profile

Choose API when you need:
- ✅ Automatic API endpoint discovery
- ✅ API authentication management (OAuth, API keys, etc.)
- ✅ Pattern learning and analytics
- ✅ API testing and validation
- ✅ Multi-tenant API integration
- ✅ Search-first research with multi-source synthesis
- ❌ Just basic scraping (use `core` profile)
- ❌ Webhooks and feedback loops (use `full` profile)

## Installation

```bash
npx unbrowser init --profile=api
```

Or configure manually:

```json
{
  "mcpServers": {
    "unbrowser-api": {
      "command": "npx",
      "args": ["unbrowser", "--profile=api"]
    }
  }
}
```

## Example Usage

### Discover APIs from a Website

```
Browse a page and discover APIs:
> smart_browse url="https://api-docs.example.com/products" includeNetwork=true

Returns:
- Content: Clean markdown
- APIs discovered: [{ url, method, pattern, confidence }]
- Learning: Pattern success rates
```

### Configure API Authentication

```
Set up OAuth for an API:
> api_auth action="configure" domain="api.example.com" auth_type="oauth2"
  credentials={ client_id, client_secret, token_url }

Browse authenticated endpoints:
> smart_browse url="https://api.example.com/v1/data" sessionProfile="api-session"
```

### View Learning Analytics

```
Check what patterns we've learned:
> dynamic_handler_stats action="list_handlers" domain="api.example.com"

Returns:
- Active patterns and their success rates
- Best performing extraction methods
- API endpoints discovered
- Recommended approaches
```

### Test Multiple API Endpoints

```
Test a list of API endpoints:
> batch_browse urls=["https://api.example.com/v1/users",
                     "https://api.example.com/v1/products",
                     "https://api.example.com/v1/orders"]

Returns: Structured comparison of all responses
```

### Research with Multi-Source Synthesis

```
Research a topic across multiple sources:
> research scope="Portugal D7 visa requirements 2024"
  outputSchema={ required_income: "number", documents: "string[]" }

Returns:
- Synthesized data matching your schema
- Source citations with confidence scores
- Contradiction detection if sources disagree
```

### Quick Single-Source Fetch

```
Quickly fetch content from a known source:
> quick_fetch url="https://example.gov/visa-requirements"

Returns: Clean markdown with metadata
```

## API Discovery Features

Unbrowser automatically discovers:
- **REST APIs** - Pattern matching from network requests
- **GraphQL** - Schema introspection via `__schema` queries
- **OpenAPI/Swagger** - Auto-detect and parse specifications
- **Framework APIs** - Next.js data, Nuxt, Gatsby, etc.
- **Hidden endpoints** - JavaScript bundle analysis

## Learning Analytics

Track pattern performance:
- Success rates by domain
- Fastest extraction methods
- Cross-domain pattern transfer
- API reliability scores

Use `dynamic_handler_stats` to view all learned patterns and optimize your workflows.
