> ## Documentation Index
> Fetch the complete documentation index at: https://docs.searchable.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Advanced API Usage (Beta)

> Build custom integrations and automate workflows with the Searchable API

## Overview

The Searchable API provides programmatic access to all platform features, enabling custom integrations and automated workflows.

<Info>
  API access is included with **Custom** contracts. Starter, Professional, and Agency plans rely on in-product workflows. See the [API Reference](/api-reference/introduction) once your API workspace is provisioned.
</Info>

## API Capabilities

<CardGroup cols={2}>
  <Card title="Trigger Audits" icon="play">
    Run audits programmatically
  </Card>

  <Card title="Fetch Data" icon="database">
    Retrieve scores, issues, and metrics
  </Card>

  <Card title="Manage Prompts" icon="messages-question">
    Create and update prompts via API
  </Card>
</CardGroup>

## Rate Limits

Custom plans start with generous baseline limits and can be tuned as needed:

* **Default allocation:** 10,000 requests/hour, 100,000 requests/day, bursts up to 100 rps
* **Scaling:** Work with your success manager to expand quotas for heavy automation
* **Monitoring:** Usage dashboards in **Settings → API** show current consumption and throttling events

## Common Use Cases

### Automated Audits

Trigger audits on deployment:

```javascript theme={null}
// After deploying changes
await fetch('https://api.searchable.com/v1/audits', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    projectId: 'your-project-id',
    type: 'comprehensive'
  })
});
```

### Custom Dashboards

Build internal dashboards:

* Fetch latest scores
* Display trends
* Show priority issues
* Track team progress

### Integration with CI/CD

* Run audits in GitHub Actions
* Block deploys if scores drop
* Automated PR comments with scores
* Slack notifications

### Data Export

* Scheduled data exports
* Custom report generation
* Data warehouse integration
* Business intelligence tools

## API Keys

### Managing Keys

* Create multiple API keys
* Set expiration dates
* Scope permissions per key
* Rotate keys regularly
* Revoke compromised keys

### Best Practices

<Check>Never commit API keys to version control</Check>
<Check>Use environment variables</Check>
<Check>Rotate keys quarterly</Check>
<Check>Use separate keys for dev/prod</Check>
<Check>Monitor API usage</Check>

## Error Handling

Common error codes:

* `400` - Bad request (check parameters)
* `401` - Invalid API key
* `403` - Insufficient permissions
* `429` - Rate limit exceeded
* `500` - Server error (retry)

## SDK & Libraries

Official SDKs:

* JavaScript/TypeScript
* Python
* Ruby
* PHP

Community libraries:

* Go
* Java
* .NET

## Examples

### Monitoring Dashboard

```javascript theme={null}
// Fetch daily scores
const scores = await searchable.getScores({
  projectId: 'your-project',
  dateRange: 'last30days'
});

// Display trend
const trend = calculateTrend(scores);
console.log(`Score trend: ${trend > 0 ? '↑' : '↓'} ${Math.abs(trend)}%`);
```

### Automated Alerts

```javascript theme={null}
// Check for critical issues
const issues = await searchable.getIssues({
  projectId: 'your-project',
  severity: 'critical',
  status: 'open'
});

if (issues.length > 0) {
  await sendSlackAlert(`🚨 ${issues.length} critical issues detected!`);
}
```

## Rate Limit Optimization

* Cache responses where appropriate
* Batch requests when possible
* Implement exponential backoff and retry logic
* Monitor usage in dashboard
* Use efficient query patterns

## Custom API Features

* Dedicated API infrastructure
* Custom rate limits
* Priority support
* SLA guarantees
* Custom endpoints

Contact [support@searchable.com](mailto:support@searchable.com) for Custom API access.

## Next Steps

<CardGroup cols={2}>
  <Card title="API Reference" icon="book" href="/api-reference/introduction">
    Full API documentation
  </Card>

  <Card title="Authentication Guide" icon="key" href="/api-reference/authentication">
    API authentication and setup
  </Card>

  <Card title="API Endpoints" icon="code" href="/api-reference/endpoints">
    Available API endpoints
  </Card>
</CardGroup>
