BYTETOOLS

Swagger Validator API

Free Swagger/OpenAPI validator API with no key: check any OpenAPI or Swagger specification for schema errors by URL. Returns structured messages. Tested.

No API key requiredCORS enabledHTTPSFree tier

Endpoint tested and returned HTTP 200 on 20 Aug 2026

What is the Swagger Validator API?

The Swagger Validator API is a free, key-free service that validates an OpenAPI or Swagger specification against the official schema, returning structured error messages for any problems found.

An invalid OpenAPI specification breaks code generation, documentation rendering and client SDKs, often with confusing downstream errors. Validating the spec directly gives you a clear answer about where the problem actually is.

The success case is quietly counterintuitive: a valid specification returns `{"schemaValidationMessages": []}` — an empty array rather than any explicit confirmation. Code that checks for a success flag will find nothing; check the array length instead.

Quick facts

Base URL
https://validator.swagger.io/validator
Authentication
No API key required.
Rate limit
No published limit; intended for interactive and CI use.
Pricing
Free, provided by SmartBear.
CORS
Enabled — callable directly from browser JavaScript
Official docs
Read the docs

How to use the Swagger Validator API

Every request below was executed against the live API on 20 Aug 2026, and the response shown is the real body it returned — not an illustration.

1. Validate an OpenAPI specification

GET https://validator.swagger.io/validator/debug?url=https%3A%2F%2Fpetstore.swagger.io%2Fv2%2Fswagger.json

curl
curl 'https://validator.swagger.io/validator/debug?url=https%3A%2F%2Fpetstore.swagger.io%2Fv2%2Fswagger.json'
JavaScript (fetch)
const res = await fetch("https://validator.swagger.io/validator/debug?url=https%3A%2F%2Fpetstore.swagger.io%2Fv2%2Fswagger.json");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);
Python (requests)
import requests

res = requests.get("https://validator.swagger.io/validator/debug?url=https%3A%2F%2Fpetstore.swagger.io%2Fv2%2Fswagger.json", timeout=20)
res.raise_for_status()
print(res.json())
Response — HTTP 200
{
  "schemaValidationMessages": []
}

Parameters

ParameterTypeRequiredDescription
debug?url=stringOptionalValidate a spec at a public URL, returning JSON messages. url=https%3A%2F%2Fpetstore.swagger.io%2Fv2%2Fswagger.json
?url=stringOptionalReturns a validity badge image instead of JSON. url=...
(POST body)bodyOptionalPOST the spec directly when it is not publicly hosted. {...}

Response fields

schemaValidationMessagesarray
Validation problems. An EMPTY array means the spec is valid.
...levelstring
error or warning.
...messagestring
What is wrong.
...schemaPath / instancePathstring
Where in the specification the problem occurs.

What you can build with the Swagger Validator API

  • Gate CI on OpenAPI specification validity
  • Debug why code generation from a spec is failing
  • Add a validity badge to API documentation
  • Check a third-party spec before building a client against it

Common errors and how to fix them

Empty response means success

A valid spec returns an empty messages array.

Fix: Check schemaValidationMessages.length === 0 rather than looking for a success flag.

Cannot validate a private spec by URL

The validator must be able to fetch it.

Fix: POST the specification body directly instead of passing a URL.

Warnings treated as failures

Some messages are level: warning.

Fix: Filter on level === 'error' if warnings should not fail your build.

Swagger Validator API — frequently asked questions

Is the Swagger validator API free?

Yes, free with no API key, provided by SmartBear.

How do I know if my spec is valid?

A valid specification returns an empty schemaValidationMessages array. There is no explicit success flag, so check the array length.

Can I validate a spec that isn't publicly accessible?

Yes, POST the specification body directly rather than passing a URL — the validator cannot fetch private endpoints.

Does it validate both Swagger 2.0 and OpenAPI 3?

Yes, it detects the version from the specification and validates against the appropriate schema.

Tools that pair with this API

Alternatives to Swagger Validator API

If Swagger Validator does not fit, these developer & testing apis cover similar ground. Every one was called before publishing, and each links to its own reference page with a working curl command and the response it returned.

APIWhat it doesAuthCORSLast verified
GitHub REST APIGitHub REST API with no key for public data: repository details, users, issues, releases and commits. 60 req/hour unauthenticated, 5,000 with a token.No keyYes19 Aug 2026
JSONPlaceholderFree fake REST API for testing and prototyping. Posts, comments, users and todos with full GET, POST, PUT and DELETE support. No key. Real curl examples.No keyYes19 Aug 2026
Postman EchoPostman Echo reflects your HTTP request back as JSON: headers, body, query params and auth. Free, no key, ideal for debugging clients. Real POST example.No keyNo19 Aug 2026
DummyJSONFree fake REST API with realistic products, users, carts, recipes and auth. Supports search, pagination, sorting and POST. No key. Tested GET and POST examples.No keyYes19 Aug 2026
Terraform RegistryQuery the public Terraform Registry for modules and providers, with versions, download counts and source repositories. No API key. Verified example included.No keyNo21 Aug 2026
unpkgFree unpkg CDN with no key: fetch any file from any npm package by URL, including package.json, with version ranges and directory listings. Tested example.No keyYes20 Aug 2026
All Developer & Testing APIs

Swagger Validator is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 20 Aug 2026; always check the official documentation before relying on this API in production, as terms and limits can change.