Skip to main content

Python


koios-api-python

Overview

A python package for the Cardano Blockchain Koios API

Install

To install the module, type the following command:

pip3 install koios_api

Examples

Below there are few examples to study, while to see the full koios-python documentation you can go here

# Cardano preview network
export CARDANO_NET=preview

# To work with a custom Api URL, set the environment variable:
export API_BASE_URL=https://preview.koios.rest/api/v0

# Importing the complete module:
import koios_api
koios_api.get_totals()


# Or you can import only specific functions:
from koios_api.network import get_totals
get_totals()

--- 

Example response:
[
  {
    "epoch_no": 380,
    "circulation": "33505907705011256",
    "treasury": "1085266054287657",
    "reward": "635180192555825",
    "supply": "35230640457275590",
    "reserves": "9769359542724410"
  }
]