Carbon Aware API Libraries

The API can be queried for lots of use cases

Browser / NodeJS

npm i --save @fikastudio/carbonaware
import { CarbonAwareAPI } from "@fikastudio/carbonaware";

const client = new CarbonAwareAPI(
  process.env.CARBONAWARE_ACCESS_TOKEN,
  process.env.CARBONAWARE_SECRET_TOKEN
);

// All regions ranked
const { regions } = await apiclient.byRank({ limit: 3 });

// All providers
const { providers } = await apiclient.providers();

// One cloud provider, e.g. vultr
const { provider } = await apiclient.provider('vultr');

// Cloud provider regions
const { provider } = await apiclient.byProvider('vultr');