A JavaScript/TypeScript SDK for interacting with the API

Downloads in past


2.0.45 months ago6 months agoMinified + gzip package size for blockfrost-js-ratelimited in KB


@blockfrost/blockfrost-js fork
This is a fork of blockfrost-js 2.0.2, adding support for rate limiting. It seems to be working, but to consider it done:
  • Rebase on latest blockfrost-js
  • Add options for rate limit (currently hardcoded 10/s and 500 burst with 10/s cooldown)
  • Add some test coverage


A JavaScript/Typescript SDK for API.

Getting startedInstallationUsage

Getting started

To use this SDK, you first need to log in to, create your project and retrieve the API token.


The SDK is hosted on, so you can directly import it using your favorite package manager.
$ npm i @blockfrost/blockfrost-js


Using the SDK is pretty straight-forward as you can see from the following examples.


import { BlockFrostAPI } from '@blockfrost/blockfrost-js';

const API = new BlockFrostAPI({
  projectId: 'YOUR API KEY HERE', // see:
try {
  const latestBlock = await API.blocksLatest();
  const networkInfo = await;
  const latestEpoch = await API.epochsLatest();
  const health = await;
  const address = await API.addresses(
  const pools = await API.pools({ page: 1, count: 10, order: 'asc' });

  console.log('pools', pools);
  console.log('address', address);
  console.log('networkInfo', networkInfo);
  console.log('latestEpoch', latestEpoch);
  console.log('latestBlock', latestBlock);
  console.log('health', health);
} catch (err) {
  console.log('error', err);


import { BlockFrostIPFS } from '@blockfrost/blockfrost-js';

const IPFS = new BlockFrostIPFS({
  projectId: 'YOUR IPFS KEY HERE', // see:

try {
  const added = await IPFS.add(`${__dirname}/img.svg`);
  console.log('added', added);

  const pinned = await;
  console.log('pinned', pinned);
} catch (err) {
  console.log('error', err);

For a more detailed list of possibilities, check out the wiki.