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

# OpenAPI Specification

> Access the complete OpenAPI specification for the DNSRadar API

## Overview

The DNSRadar API is fully documented using the OpenAPI 3.0 specification (formerly known as Swagger). This machine-readable format allows you to automatically generate client libraries, test your API integration, and import the API into various development tools.

## Download the Specification

You can access our complete OpenAPI specification file here:

<Card title="OpenAPI Specification" icon="file-code" href="https://api.dnsradar.dev/openapi.json">
  Download the latest OpenAPI 3.0 JSON specification
</Card>

<Info>
  Our OpenAPI specification is automatically updated whenever we release new API features or changes. You can always access the latest version at the URL above.
</Info>

## What's Included

The OpenAPI specification contains complete details about:

<AccordionGroup>
  <Accordion title="Endpoints" icon="route">
    All available API endpoints with their paths, HTTP methods, and descriptions
  </Accordion>

  <Accordion title="Request Parameters" icon="sliders">
    Query parameters, path parameters, headers, and request body schemas
  </Accordion>

  <Accordion title="Response Schemas" icon="brackets-curly">
    Detailed response structures for success and error cases
  </Accordion>

  <Accordion title="Authentication" icon="key">
    Security schemes and authentication requirements
  </Accordion>

  <Accordion title="Data Models" icon="shapes">
    Complete schema definitions for all data types (Monitors, Events, Webhooks, etc.)
  </Accordion>

  <Accordion title="Examples" icon="code">
    Request and response examples for each endpoint
  </Accordion>
</AccordionGroup>

## Using the Specification

### Generate Client Libraries

Use the OpenAPI specification to automatically generate client libraries in your preferred programming language:

<CodeGroup>
  ```bash OpenAPI Generator theme={null}
  # Install OpenAPI Generator
  npm install @openapitools/openapi-generator-cli -g

  # Generate a Python client
  openapi-generator-cli generate \
    -i https://api.dnsradar.dev/openapi.json \
    -g python \
    -o ./dnsradar-python-client

  # Generate a JavaScript/TypeScript client
  openapi-generator-cli generate \
    -i https://api.dnsradar.dev/openapi.json \
    -g typescript-fetch \
    -o ./dnsradar-ts-client
  ```

  ```bash Swagger Codegen theme={null}
  # Using Swagger Codegen
  swagger-codegen generate \
    -i https://api.dnsradar.dev/openapi.json \
    -l ruby \
    -o ./dnsradar-ruby-client
  ```
</CodeGroup>

### Import into Development Tools

The OpenAPI specification can be imported into popular API development tools:

<CardGroup cols={2}>
  <Card title="Postman" icon="square-p">
    Import the spec into Postman to get a complete collection of all API endpoints
  </Card>

  <Card title="Insomnia" icon="moon">
    Load the OpenAPI file directly into Insomnia for API testing
  </Card>

  <Card title="Swagger UI" icon="eye">
    Use Swagger UI to create an interactive API documentation interface
  </Card>

  <Card title="VS Code" icon="code">
    Use OpenAPI extensions in VS Code for autocomplete and validation
  </Card>
</CardGroup>

### Example: Using with Postman

1. Open Postman and click **Import**
2. Select **Link** and paste: `https://api.dnsradar.dev/openapi.json`
3. Click **Import** to create a complete collection
4. Add your API key to the collection variables
5. Start making requests

### Example: Self-Hosting API Documentation

You can host your own version of the API documentation using the OpenAPI specification:

```html theme={null}
<!DOCTYPE html>
<html>
<head>
  <title>DNSRadar API Documentation</title>
  <link rel="stylesheet" type="text/css" href="https://unpkg.com/swagger-ui-dist/swagger-ui.css">
</head>
<body>
  <div id="swagger-ui"></div>
  <script src="https://unpkg.com/swagger-ui-dist/swagger-ui-bundle.js"></script>
  <script>
    SwaggerUIBundle({
      url: "https://api.dnsradar.dev/openapi.json",
      dom_id: '#swagger-ui',
    });
  </script>
</body>
</html>
```

## Validation and Testing

Use the OpenAPI specification to validate your API requests and responses:

```javascript theme={null}
import { OpenAPIValidator } from 'express-openapi-validator';

// Validate requests against the OpenAPI spec
app.use(
  OpenAPIValidator.middleware({
    apiSpec: 'https://api.dnsradar.dev/openapi.json',
    validateRequests: true,
    validateResponses: true,
  })
);
```

## Version History

Our API follows semantic versioning. The current version is documented in the OpenAPI specification's `info.version` field:

```json theme={null}
{
  "openapi": "3.0.3",
  "info": {
    "title": "DNSRadar API",
    "version": "1.0.0",
    "description": "Monitor your DNS records and get notified when they change"
  }
}
```

<Tip>
  Subscribe to our changelog or follow us on [X (Twitter)](https://x.com/dnsradardev) and [Bluesky](https://bsky.app/@dnsradar.dev) to get notified about API updates and new features.
</Tip>

## Support

If you find any issues with the OpenAPI specification or have suggestions for improvement, please contact us at [support@dnsradar.dev](mailto:support@dnsradar.dev).
