Import any file, URL or content to get an OpenAPI document
npm install @scalar/import



Pass an URL to an OpenAPI document, a Swagger document, a Postman collection, a Scalar API reference, a Scalar Sandbox link … basically anything, and retrieve an OpenAPI document.
``bash`
npm install @scalar/import
Find any OpenAPI/Swagger document URL in any content:
`ts
import { resolve } from '@scalar/import'
// Get the raw file URL from a GitHub link
const result = await resolve(
'https://github.com/outline/openapi/blob/main/spec3.yml',
)
// https://raw.githubusercontent.com/outline/openapi/refs/heads/main/spec3.yml
`
- Resolves URLs to OpenAPI specifications from various sources
- Supports JSON and YAML formats (.json, .yaml, .yml)
- Extracts OpenAPI specification URLs from HTML content, including:
- Scalar API Reference