# @blockfrost/openapi

> OpenAPI specifications for blockfrost.io

Latest version **0.1.93** (published 2026-09-02) · 0 weekly downloads

## Install

```sh
npm install @blockfrost/openapi
pnpm add @blockfrost/openapi
yarn add @blockfrost/openapi
bun add @blockfrost/openapi
```

## Health

**Score 60/100 (C)** — status: active.

Positive: has types; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.1.93 |
| Published | 2026-09-02 |
| First published | 2021-02-17 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=20 |
| Dependencies | 4 |
| Unpacked size | 1.4 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 26 |
| Author | admin@blockfrost.io |
| Maintainers | blockfrost.io, vladimirvolek, slowbackspace |

## Links

- npm: https://www.npmjs.com/package/@blockfrost/openapi
- Repository: https://github.com/blockfrost/openapi
- Homepage: https://github.com/blockfrost/openapi#readme
- Issues: https://github.com/blockfrost/openapi/issues
- npm.io page: https://npm.io/package/@blockfrost/openapi

## Dependencies (4)

- [ajv](https://npm.io/package/ajv.md) ^8.17.1
- [cbor](https://npm.io/package/cbor.md) ^9.0.2
- [yaml](https://npm.io/package/yaml.md) ^2.6.1
- [rimraf](https://npm.io/package/rimraf.md) 6.0.1

## Recent versions

- 0.1.93 (latest) — 2026-09-02
- 0.1.90-beta.0 (beta) — 2026-06-19
- 0.1.92 — 2026-08-20
- 0.1.91 — 2026-07-29
- 0.1.90 — 2026-06-23
- 0.1.89 — 2026-06-08
- 0.1.89-beta.1 — 2026-06-04
- 0.1.89-beta.0 — 2026-06-04
- 0.1.88 — 2026-05-14
- 0.1.88-beta.6 — 2026-05-12
- 0.1.88-beta.5 — 2026-05-12
- 0.1.88-beta.4 — 2026-05-12
- 0.1.88-beta.3 — 2026-05-12
- 0.1.88-beta.2 — 2026-05-11
- 0.1.88-beta.1 — 2026-05-11
- … 259 more at https://npm.io/package/@blockfrost/openapi/versions

## README

<img src="https://blockfrost.io/images/logo.svg" width="250" align="right" height="90" style="margin-bottom: -50px">

# Blockfrost.io OpenAPI

<br>
<p align="center">Open Source OpenAPI specification for <a href="https://blockfrost.io">Blockfrost.io</a> backend API.</p>

<div align="center">

![GitHub](https://img.shields.io/github/license/blockfrost/openapi)
![master build ci](https://github.com/blockfrost/openapi/actions/workflows/CI.yaml/badge.svg?branch=master)
[![npm version](https://badge.fury.io/js/%40blockfrost%2Fopenapi.svg)](https://badge.fury.io/js/%40blockfrost%2Fopenapi)
![downloads](https://img.shields.io/npm/dy/@blockfrost/openapi)
<a href="https://fivebinaries.com/"><img src="https://img.shields.io/badge/made%20by-Five%20Binaries-darkviolet.svg?style=flat-square" /></a>

</div>
<p align="center">
  <a href="#getting-started">Getting started</a> •
  <a href="#development">Development</a>
</p>

## Getting started

The **development version** is available in the `master` branch.  
The **latest active release** can be found under [GitHub Releases](https://github.com/blockfrost/openapi/releases).  
For the **published documentation**, visit [docs.blockfrost.io](https://docs.blockfrost.io/).

## Development

Blockfrost OpenAPI [`blockfrost-openapi.yaml`](blockfrost-openapi.yaml) specification is generated from all yaml files in `src` directory.
Then there is Mithril Aggregator API spec [`mithril.yaml`](mithril.yaml) which can be downloaded from [Mithril Github](https://github.com/input-output-hk/mithril).
These two specs are then merged together via `openapi-merge-cli` (configuration is inside [`openapi-merge.json`](openapi-merge.json)).
Only the Mithril endpoints with a tag `Cardano » Mithril` are included into the final spec.

> Tag `Cardano » Mithril` needs to be added manually to each relevant endpoint in Mithril OpenAPI spec.

If you add a new file then don't forget to add it to `paths` in [`src/definitions.yaml`](src/definitions.yaml).

Edit the source yaml files and build the package:

```typescript
yarn build
```

### Regenerating types

TypeScript types ([`src/generated-types.ts`](src/generated-types.ts)) are regenerated as part of `yarn build`, or standalone with:

```console
yarn generate-types
```

Rust types (the [`rust/`](rust/) crate) are generated from the bundled [`openapi.yaml`](openapi.yaml), so run `yarn build` (or at least `yarn bundle`) first if you have changed the source yaml files. The generation uses [openapi-generator](https://github.com/OpenAPITools/openapi-generator), which requires a Java runtime:

```console
yarn generate-types:rust
```

If you don't have Java installed, use the Docker variant, which runs the same generator version inside a container:

```console
yarn generate-types:rust:docker
```

The generator version is pinned in [`openapitools.json`](openapitools.json) — when bumping it, update the image tag in the `generate-types:rust:docker` script to match.

> Note that the Rust generation emits models only (`apis=false`), so spec changes that only touch endpoints or query parameters produce no changes in the crate.

### Midnight GraphQL docs

The Midnight Indexer GraphQL API documentation is generated using [SpectaQL](https://github.com/anvilco/spectaql) from the schema file [`midnight-indexer-api.graphql`](midnight-indexer-api.graphql). The SpectaQL configuration is in [`spectaql.yaml`](spectaql.yaml) and the custom theme is in [`spectaql-theme/`](spectaql-theme/).

To update the GraphQL schema, download the version matching the deployed Midnight Indexer from the [Midnight Indexer repository](https://github.com/midnightntwrk/midnight-indexer/blob/main/indexer-api/graphql/) and replace the local file:

Then rebuild with `yarn bundle` (SpectaQL runs as part of the bundle step) to regenerate the docs in `docs/midnight/`.

Feel free to open PR against the `master` branch. It is a great place to start any discussion for new features and changes to the Blockfrost API.

### UI

When you push a new commit, the documentation for your branch is automatically generated on Vercel and added to your PR as a deployment.

### Dashboard API docs

The Blockfrost **Dashboard API** documentation at
[`docs.blockfrost.io/dashboard-api/`](https://docs.blockfrost.io/dashboard-api/)
is **not** built from this repo. Its OpenAPI spec and Scalar build live
separately and deploy as their own Vercel project. This repo only owns the
`docs.blockfrost.io` host and reverse-proxies `/dashboard-api/*` to that
project via a `rewrites` rule in [`vercel.json`](vercel.json) — each service's
spec and build pipeline stays in its own repo.

## Usage

You can download [`openapi.yaml`](openapi.yaml) directly from the repository or use this project as a dependency in your JavaScript/TypeScript project.

### Typescript example

Install `@blockfrost/openapi`:

```console
yarn add @blockfrost/openapi
```

or

```console
npm install @blockfrost/openapi
```

Now you can use TypeScript types generated from the OpenAPI specification:

```typescript
import { components } from '@blockfrost/openapi';

type Block = components['schemas']['block_content'];
type Address = components['schemas']['address_content'];
type UtxoAsset = components['schemas']['address_utxo_content'];
```

### Rust crate

Add `blockfrost-openapi` to your `Cargo.toml`:

```toml
[dependencies]
blockfrost-openapi = "0.1.87"
```

Now you can use the generated Rust types:

```rust
use blockfrost_openapi::models::{BlockContent, AddressContent, AddressUtxoContentInner};
```

---
_Source: https://npm.io/package/@blockfrost/openapi · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
