Skip to content
Last updated

Redoc quickstart guide

To render your OpenAPI definition using Redoc, use the following HTML code sample and replace the spec-url attribute with the URL or local file address to your description file.

<!DOCTYPE html>
<html>
  <head>
    <title>Redoc</title>
    <!-- needed for adaptive design -->
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />

    <!--
    Redoc doesn't change outer page styles
    -->
    <style>
      body {
        margin: 0;
        padding: 0;
      }
    </style>
  </head>
  <body>
    <!--
    Redoc element with link to your OpenAPI definition
    -->
    <redoc spec-url="https://redocly.github.io/redoc/museum.yaml"></redoc>
    <!--
    Link to Redoc JavaScript on CDN for rendering standalone element
    -->
    <script type="module" src="https://cdn.redoc.ly/redoc/v3.0.0-rc.0/redoc.standalone.js"></script>
  </body>
</html>
Redoc requires an HTTP server to run locally

Loading local OpenAPI definitions is impossible without running a web server because of issues with same-origin policy and other security reasons. Refer to Running Redoc locally for more information.

For detailed explanation with step-by-step instructions and additional options for using Redoc, refer to the Redoc deployment guide.