Host API Docs on GitHub Pages, Free
If your OpenAPI spec already lives in a GitHub repo, you don’t need separate hosting for the docs page —
GitHub Pages will serve a static index.html straight from the repo, and GetMan’s CDN script means that
index.html doesn’t need a build step of its own.
1. Add the docs page
Create a docs/index.html file (GitHub Pages can serve directly from a /docs folder on your default
branch, which keeps it separate from the rest of the repo):
<!DOCTYPE html>
<html>
<head>
<title>API Docs</title>
</head>
<body>
<div id="api-docs" style="height: 100vh"></div>
<script src="https://cdn.getman.dev/latest/getman-ui.js"></script>
<script>
GetMan.launch(
document.getElementById('api-docs'),
{ url: './openapi.json' }
);
</script>
</body>
</html>
2. Commit the spec alongside it
Put your spec file next to it — docs/openapi.json — and reference it with a relative path as shown
above, rather than an absolute URL. That way the page keeps working if the repo is renamed or forked.
git add docs/index.html docs/openapi.json
git commit -m "Add API docs"
git push
3. Enable Pages
In the repo’s Settings → Pages, set the source to your default branch and the /docs folder. GitHub
builds and serves the page within a minute or two, at https://<your-username>.github.io/<repo>/.
Keeping the spec in sync
If openapi.json is generated by your build (from FastAPI, NestJS, etc.), add a step to your CI workflow
that copies the freshly generated file into docs/openapi.json and commits it — otherwise the hosted docs
will silently drift from your actual API.
GitHub Pages is one of a few free hosting options — see how to host an OpenAPI spec for free for alternatives like raw GitHub content or a Gist if Pages doesn’t fit your setup, or self-hosted API documentation if the spec needs to stay off the public internet entirely.
Try it with your own spec
Paste any OpenAPI or Swagger URL and see it rendered live — no signup, no install.
Open the explorer