Spoold Logo
Home

OpenAPI viewer & curl

Paste OpenAPI 3 or Swagger 2 as JSON or YAML. Filter to narrow operations — matching text is highlighted. Click a row for sample request/response, parameters, and curl. Parsed in your browser only.

Specificationopenapi.json, swagger.yaml, or exported spec from your API repo

Guide: OpenAPI viewer & curl

↑ Back to tool

What is this tool?

This page is a free OpenAPI viewer and Swagger viewer for API developers: paste or upload your OpenAPI 3 (OAS 3) or Swagger 2 specification as JSON or YAML, then browse every HTTP operation under paths. Operations group by OpenAPI tags (first tag wins for grouping). For each endpoint you can copy a curl command that reflects the spec’s servers / host, path parameters, query examples, JSON request body examples, and basic security placeholders (API keys, Bearer tokens). Parsing runs entirely in your browser—your spec is not uploaded to Spoold servers.

Quick tip

Use the search box to filter by path, HTTP method, tag, operationId, or summary—handy for large specs with dozens of routes.

Why use an online OpenAPI viewer?

Teams ship REST API specs as openapi.yaml, CI artifacts, or exports from gateways. A lightweight browser-based viewer lets you inspect operations without installing Swagger UI, Redoc, or IDE plugins—useful on locked-down machines, during support chats, or when you only need a copy-paste curl for a single path. This tool focuses on read/browse + curl generation, not on sending live HTTP requests.

How to use

  1. Load your spec — Paste JSON or YAML into the editor, or use Upload for openapi.json, swagger.yaml, and similar. Try Sample for a demo spec.
  2. Pick a server — If the document lists multiple servers (OpenAPI 3) or you need a specific base URL, choose it from the server dropdown so generated curl uses the right host.
  3. Find an operation — Scroll tag sections or type in the filter to match path, method, tag, operationId, or summary text.
  4. Expand and copy — Open a row to see parameters, generated curl, and example request or response snippets when present. Use Copy curl to grab the command.
  5. Replace placeholders — Swap auth tokens, IDs, and secrets before running curl against production APIs.

Features

  • OpenAPI 3.x and Swagger 2.0 — Detects root openapi or swagger: "2.0".
  • Tag grouping and search — Operations grouped by first tag; filter narrows the list and highlights matches.
  • Multi-server base URL — Select which servers[] entry (or Swagger host/schemes) drives curl URLs.
  • curl per operation — Built from method, URL, parameters, example bodies, and security schemes where supported.
  • Local draft — Your last pasted spec is remembered in browser storage so you can return without re-pasting (same device and browser).

Input formats

  • YAML (.yaml, .yml) or JSON (.json)
  • Root openapi: 3.x or swagger: "2.0"
  • Typical sources: Postman, Stoplight, FastAPI, Springdoc, API gateways, or your repo’s openapi.yaml / swagger.json

curl creator from OpenAPI (how it works)

Spoold turns each path + HTTP method into a single copy-paste curl command derived from your spec: merged parameters (path-item + operation), requestBody or Swagger body, and security. It is a read-only curl generator—nothing is sent from this page; you run the command in your own terminal.

Command shape

Every line starts with curl -sS (-sS hides progress but still surfaces errors), then -X METHOD in uppercase, then the URL as one single-quoted argument. Header and body strings are also single-quoted; any ' inside a value is emitted using the usual POSIX pattern (end the quoted span, add \', resume quoting) so the line stays safe to paste into bash or zsh.

URL, path, and query

  • Base URL comes from the server you select in the UI: OpenAPI servers[] (including simple substitution of server.variables defaults) or Swagger schemes + host + basePath.
  • Path parameters — Each {name} segment is replaced using the parameter’s example, or nested schema.example, or a small synthetic value from JSON Schema. If the spec gives no example, the placeholder value example is substituted so the URL is still syntactically valid (URL-encoded).
  • Query parameters — A query entry is added when the parameter is required: true or has an example value. Optional query params with no example are omitted so the curl stays minimal.
  • Header parameters — Parameters with in: header appear as -H only when an example value exists; header params without an example are skipped.

Request body (JSON)

For OpenAPI 3, the generator reads requestBody (including $ref to components/requestBodies when resolvable). It picks a media type in priority order—preferring application/json, then application/*+json, text/json, application/vnd.api+json, application/hal+json, then other keys—and uses that entry’s example if present. Otherwise it builds a compact JSON object from schema (with limited $ref / allOf / oneOf / anyOf handling). The body is passed as -d '…'. A Content-Type header is added from the chosen media type unless you already supplied one via a header parameter.

For Swagger 2, a body parameter with a JSON schema is serialized the same way (example on the schema or a synthesized object).

Security placeholders

Auth is inferred from operation.security or the document-level security default. Only the first entry in the OpenAPI security array is used (the first “OR” alternative). Within that object, each scheme name is resolved against components.securitySchemes (OpenAPI 3) or securityDefinitions (Swagger 2) and mapped to headers as follows:

  • type: http, scheme: bearer Authorization: Bearer YOUR_TOKEN
  • type: http, scheme: basic Authorization: Basic BASE64_USER_COLON_PASS
  • type: apiKey, in: header -H 'Name: YOUR_API_KEY' using the scheme’s header name
  • type: oauth2Authorization: Bearer YOUR_ACCESS_TOKEN (OpenAPI 3) or Bearer YOUR_TOKEN (Swagger 2)

Not supported for auto-headers: apiKey in query or cookie, mutual TLS, or OpenAPI 3.1’s separate mutualTLS scheme. For those, extend the generated curl manually.

What you should edit before running

Replace every placeholder (YOUR_TOKEN, YOUR_API_KEY, synthetic path values, etc.) with real values. Re-check optional query and header fields your API actually needs—the generator only includes what the spec marks required or documents with examples.

Use cases

ScenarioHow this tool helps
On-call debuggingPaste the spec from a ticket and jump to one path with filter + curl.
Docs reviewScan tags and responses without running a local docs server.
Compare with real callsGenerate curl from the spec, then diff or compare with captured traffic using other Spoold tools.
Vendor / partner APIsInspect exported OpenAPI files when you cannot install their SDK.

Limits

Very large specs may be slow in the browser. Complex $ref graphs are only partially resolved (parameters and request bodies referenced from components are supported for common cases). This tool does not validate the spec against the full OpenAPI JSON Schema, and it does not execute requests—only generates curl text.

Privacy

Spec parsing and curl generation run in your browser. Spoold does not receive your OpenAPI document when you use this page. Draft text may be stored locally in your browser so you can continue editing—avoid pasting secrets into specs if others use the same profile.

FAQ

Is this the same as Swagger UI?
No. Swagger UI renders interactive “Try it out” requests. This viewer is read-only: it lists operations and builds curl strings for you to run locally.
OpenAPI vs Swagger—which do I have?
Swagger 2.0 uses swagger: "2.0". OpenAPI 3.x uses openapi: "3.0.x" or 3.1.x. Both work here.
Can I try the API from the browser?
Not from this page. Copy the curl command and run it in your terminal, or use your own client. CORS and auth are between you and the API.
Why is my curl missing a body or header?
Generation depends on what the spec declares—examples, required fields, and resolvable schemas. Undocumented or deeply nested refs may produce minimal or placeholder output.
Does it support AsyncAPI or GraphQL?
This tool targets OpenAPI/Swagger REST specs. For GraphQL formatting, use the GraphQL formatter.

The same workflow—load an API description, scan operations, copy a shell command—shows up under many names. Common searches include OAS viewer, OpenAPI Specification viewer, Swagger JSON viewer, Swagger YAML viewer, OpenAPI YAML viewer, OpenAPI JSON viewer, view openapi.yaml online, view swagger.json online, REST API spec viewer, API contract viewer, machine-readable API documentation, and browse OpenAPI paths.

Curl and HTTP adjacent phrases: openapi to curl, swagger to curl, generate curl from OpenAPI, generate curl from Swagger, copy curl from OpenAPI, curl command from API spec, REST client from spec, openapi curl generator, swagger curl generator, openapi request example, and try API with curl (this page outputs curl only—you run it locally).

Docs and tooling people compare with: Swagger UI alternative, Redoc alternative, try-it consoles and mock servers (this page does not proxy HTTP—it only prints curl), Postman import OpenAPI (paste the same YAML/JSON here for a quick look), Insomnia OpenAPI, FastAPI openapi.json viewer, Springdoc OpenAPI viewer, Kong OpenAPI spec, AWS API Gateway export OpenAPI, OpenAPI 3.0 vs 3.1, Swagger 2.0 to OpenAPI, openapi components schemas, operationId list, tags paths operations, and servers array base URL.

  • Also phrased as: online OpenAPI parser, browser OpenAPI inspector, YAML API definition viewer, JSON API definition viewer.
  • Security-related searches: Bearer token curl example from OpenAPI, API key header curl, OAuth2 curl placeholder.
  • Format keywords: OpenAPI 3.0 viewer, OpenAPI 3.1 document, Swagger 2 spec, OAS3.
  • Workflow keywords: inspect openapi structure (not a full schema validator), share openapi with teammate, print operations list.

If your query sounds like any of the above, this tool is built for quick inspection and curl text from the same openapi.yaml / swagger.json files your CI or gateway already publishes.

Similar tools

Convert documented curl to code: curl → code.

Conclusion

Use this page when you need a fast OpenAPI 3 / Swagger 2 viewer in the browser with per-route curl and no install. For JSON cleanup before pasting specs, try the JSON formatter; for HTTP troubleshooting, see HTTP status codes.