### Installing koios_api Python Package Source: https://github.com/cardano-apexpool/koios-api-python/blob/main/README.md This command installs the `koios_api` Python package using pip3, making it available for use in Python projects. It is the standard way to add the library to your environment. ```bash pip3 install koios_api ``` -------------------------------- ### Importing Full Koios API Module and Getting Blockchain Tip Source: https://github.com/cardano-apexpool/koios-api-python/blob/main/README.md This Python snippet demonstrates importing the entire `koios_api` module and then calling the `get_tip()` function to retrieve the current blockchain tip information, including hash, epoch, and block details. ```python import koios_api koios_api.get_tip() ``` -------------------------------- ### Example Response for Policy Asset Info (JSON) Source: https://github.com/cardano-apexpool/koios-api-python/blob/main/README.md This JSON snippet illustrates the structure of the data returned by the `get_policy_asset_info` function. Each object in the array represents an asset, providing details such as `asset_name`, `fingerprint`, `minting_tx_metadata`, `token_registry_metadata`, `total_supply`, and `creation_time`. ```JSON [ { "asset_name": "", "asset_name_ascii": "", "fingerprint": "asset1pht97cylpt7azuu9mwhmd9c9zdgmumwrrm5yrc", "minting_tx_metadata": { "key": "777", "json": { "addr": [ "addr1qy36jns6h4w4f80u6xed49k6qn9c7tk4x4us5kaxztjq8x3un2me8nvc5ke", "gvll0gnwlj2ypzfhhqpns47u76gafttmq208x4d" ], "rate": "0.05" } }, "token_registry_metadata": null, "total_supply": "0", "creation_time": 1665161713 }, { "asset_name": "4379626572696130353930", "asset_name_ascii": "Cyberia0590", "fingerprint": "asset1dzurenp8f6n8zu3lwglrs0g54xnmd5xwqe9yqp", "minting_tx_metadata": { "key": "721", "json": { "nonce": "ac2834e7b5707c30", "07697e6ca1e21777ac76f26d0779c53f7d08e47b9e32d23bd8fed9cd": { "Cyberia0590": { "Pose": "Warrior II Pose - Virabhadrasana II", "Skin": "Red", "name": "Cyberia Chakra Planet #0590", "files": [ { "src": "ipfs://QmZR6VJJ1hWx2bqKo1o8AUzoMxwrUiqGZMzZv8uHXt7MJX", "name": "Please wait while your experience below loads.", "mediaType": "image/jpg" }, { "src": "ipfs://QmXQSmnRVL4TH4h5YYxZr2m6rfDe65hyv1J4An9znKJr9d", "mediaType": "text/html" } ], "image": "ipfs://QmZR6VJJ1hWx2bqKo1o8AUzoMxwrUiqGZMzZv8uHXt7MJX", "Artist": "Shrink", "Avatar": "Male", "Chakra": "Root - Muladhara", "Mantra": "LAM", "Discord": "https://dsc.gg/cyberiacnft", "Twitter": "https://twitter.com/cyberiaCNFT", "Website": "https://cyberia.gg/", "Function": "Grounding", "Location": "Base of Spine", "Collection": "Chakra Planets", "Planet colour": "Red" } } } }, "token_registry_metadata": null, "total_supply": "1", "creation_time": 1665180305 }, { "asset_name": "4379626572696131313535", "asset_name_ascii": "Cyberia1155", "fingerprint": "asset1c7ymj2plmz9dddyx80axrpwy8uhm8q4hzdg3g7", "minting_tx_metadata": { "key": "721", "json": { "nonce": "18501ab3c76e955b", "07697e6ca1e21777ac76f26d0779c53f7d08e47b9e32d23bd8fed9cd": { "Cyberia0921": { "Pose": "Headstand - Sirsasana", "Skin": "Gold", "name": "Cyberia Chakra Planet #0921", "files": [ { "src": "ipfs://QmaNEfYXpqFM3vRdvhUkccFpSHUc6MpA6D1Jriefz5oaZr", "name": "Please wait while your experience below loads.", "mediaType": "image/jpg" }, { "src": "ipfs://QmT22qfNW8Ts3FcfbLTe1jx2L7XfJaxzuqKLZ9Qiw45srk", "mediaType": "text/html" } ], "image": "ipfs://QmaNEfYXpqFM3vRdvhUkccFpSHUc6MpA6D1Jriefz5oaZr", "Artist": "Shrink", "Avatar": "Male", "Chakra": "Crown - Sahasrara", "Mantra": "OM", "Discord": "https://dsc.gg/cyberiacnft", "Twitter": "https://twitter.com/cyberiaCNFT", "Website": "https://cyberia.gg/", "Function": "Spiritual Connection", "Location": "Top of the Head", "Collection": "Chakra Planets", "Planet colour": "Purple" }, "Cyberia1155": { "Pose": "Headstand - Sirsasana", "Skin": "Purple", "name": "Cyberia Chakra Planet #1155", "files": [ { "src": "ipfs://QmdRbAZpWvrXQ1wDqWL7fhifJfd6dowx4oZpufdWFiG5Qo", "name": "Please wait while your experience below loads.", "mediaType": "image/jpg" }, { "src": "ipfs://QmfC6r68AzrQyN17Yns4fhtVY4HE9FCPdtv5bsBgfac1qD", "mediaType": "text/html" } ], "image": "ipfs://QmdRbAZpWvrXQ1wDqWL7fhifJfd6dowx4oZpufdWFiG5Qo", "Artist": "Shrink", "Avatar": "Female", "Chakra": "Crown - Sahasrara", "Mantra": "OM", "Discord": "https://dsc.gg/cyberiacnft", "Twitter": "https://twitter.com/cyberiaCNFT", "Website": "https://cyberia.gg/", "Function": "Spiritual Connection", "Location": "Top of the Head", "Collection": "Chakra Planets", "Planet colour": "Purple" } } } } } ] ``` -------------------------------- ### Example Response for Get Address UTxOs Koios API Source: https://github.com/cardano-apexpool/koios-api-python/blob/main/README.md This JSON snippet illustrates the expected structure and content of the response returned by the `get_address_utxos` function. It is a list of dictionaries, where each dictionary represents a UTxO, providing details such as transaction hash, index, address, value, stake address, block height, and whether it's spent, along with other relevant blockchain data. ```JSON [ { "tx_hash": "eb9fc5848297ac94903164519dc9955acc5645b831ed48ad03c67edefec9b50d", "tx_index": 1, "address": "addr1q8wv876ptu0qhujmh2awdcnpcc0ctgdz8e8qvv29k8hucwft99azzjfn9l2658p483uljfdd00ef5rzg58y5km6gj9jqcp0ws7", "value": "5459647", "stake_address": "stake1uy4jj73pfyejl4d2rs6nc70eykkhhu56p3y2rj2tdayfzeqnjyh0j", "payment_cred": "dcc3fb415f1e0bf25bbabae6e261c61f85a1a23e4e063145b1efcc39", "epoch_no": 439, "block_height": 9356379, "block_time": 1696084155, "datum_hash": null, "inline_datum": null, "reference_script": null, "asset_list": null, "is_spent": false }, { "tx_hash": "67f7b1240deff9bafd7d5f9da199d40f1072519edfc21592485a583f31a8a966", "tx_index": 1, "address": "addr1q8wv876ptu0qhujmh2awdcnpcc0ctgdz8e8qvv29k8hucwft99azzjfn9l2658p483uljfdd00ef5rzg58y5km6gj9jqcp0ws7", "value": "12740897", "stake_address": "stake1uy4jj73pfyejl4d2rs6nc70eykkhhu56p3y2rj2tdayfzeqnjyh0j", "payment_cred": "dcc3fb415f1e0bf25bbabae6e261c61f85a1a23e4e063145b1efcc39", "epoch_no": 447, "block_height": 9532358, "block_time": 1699686385, "datum_hash": null, "inline_datum": null, "reference_script": null, "asset_list": null, "is_spent": false }, { "tx_hash": "cb3646d0739dd1884b2cf16fbc8fc768763103ddcdd3a3f9fc7fd6a0ea75fa63", "tx_index": 1, "address": "addr1q8wv876ptu0qhujmh2awdcnpcc0ctgdz8e8qvv29k8hucwft99azzjfn9l2658p483uljfdd00ef5rzg58y5km6gj9jqcp0ws7", "value": "19778509", "stake_address": "stake1uy4jj73pfyejl4d2rs6nc70eykkhhu56p3y2rj2tdayfzeqnjyh0j", "payment_cred": "dcc3fb415f1e0bf25bbabae6e261c61f85a1a23e4e063145b1efcc39", "epoch_no": 448, "block_height": 9537064, "block_time": 1699782852, "datum_hash": null, "inline_datum": null, "reference_script": null, "asset_list": null, "is_spent": false }, { "tx_hash": "1fc61d4f02f170554e06b2608fc021a5c6910faa125c8baebbaa66d16dadec44", "tx_index": 1, "address": "addr1q8wv876ptu0qhujmh2awdcnpcc0ctgdz8e8qvv29k8hucwft99azzjfn9l2658p483uljfdd00ef5rzg58y5km6gj9jqcp0ws7", "value": "25618819", "stake_address": "stake1uy4jj73pfyejl4d2rs6nc70eykkhhu56p3y2rj2tdayfzeqnjyh0j", "payment_cred": "dcc3fb415f1e0bf25bbabae6e261c61f85a1a23e4e063145b1efcc39", "epoch_no": 448, "block_height": 9538689, "block_time": 1699816992, "datum_hash": null, "inline_datum": null, "reference_script": null, "asset_list": null, "is_spent": false }, { "tx_hash": "f38eb43c9c5d899ad9d5a727a6cd64fce34e5ddb0b3cc29a3241931ba323f2d9", "tx_index": 1, "address": "addr1q8wv876ptu0qhujmh2awdcnpcc0ctgdz8e8qvv29k8hucwft99azzjfn9l2658p483uljfdd00ef5rzg58y5km6gj9jqcp0ws7", "value": "16173935", "stake_address": "stake1uy4jj73pfyejl4d2rs6nc70eykkhhu56p3y2rj2tdayfzeqnjyh0j", "payment_cred": "dcc3fb415f1e0bf25bbabae6e261c61f85a1a23e4e063145b1efcc39", "epoch_no": 449, "block_height": 9564511, "block_time": 1700343086, "datum_hash": null, "inline_datum": null, "reference_script": null, "asset_list": null, "is_spent": false }, { "tx_hash": "1c00a4087c594c4453c8c3a8f51663d0a9ba59f3e3e02cf961c01d8cc80edd44", "tx_index": 1, "address": "addr1q8wv876ptu0qhujmh2awdcnpcc0ctgdz8e8qvv29k8hucwft99azzjfn9l2658p483uljfdd00ef5rzg58y5km6gj9jqcp0ws7", "value": "15633446", "stake_address": "stake1uy4jj73pfyejl4d2rs6nc70eykkhhu56p3y2rj2tdayfzeqnjyh0j", "payment_cred": "dcc3fb415f1e0bf25bbabae6e261c61f85a1a23e4e063145b1efcc39", "epoch_no": 450, "block_height": 9587376, "block_time": 1700814155, "datum_hash": null, "inline_datum": null, "reference_script": null, "asset_list": null, "is_spent": false }, { "tx_hash": "40e3609e2d1c3ea38601d119dbf6711a448defaadc4fa1d1590c0d48f29c240e", "tx_index": 1, "address": "addr1q8wv876ptu0qhujmh2awdcnpcc0ctgdz8e8qvv29k8hucwft99azzjfn9l2658p483uljfdd00ef5rzg58y5km6gj9jqcp0ws7", "value": "12308427", "stake_address": "stake1uy4jj73pfyejl4d2rs6nc70eykkhhu56p3y2rj2tdayfzeqnjyh0j", "payment_cred": "dcc3fb415f1e0bf25bbabae6e261c61f85a1a23e4e063145f1efcc39", "epoch_no": 450, "block_height": 9592563, "block_time": 1700923481, "datum_hash": null, "inline_datum": null, "reference_script": null, "asset_list": null, "is_spent": false } ] ``` -------------------------------- ### Example Koios API Response: Genesis Parameters (JSON) Source: https://github.com/cardano-apexpool/koios-api-python/blob/main/README.md This JSON snippet illustrates the structure and typical values of the response returned by the `get_genesis` function. It provides detailed blockchain configuration parameters, including network magic, epoch length, and Alonzo genesis details. ```JSON [ { "networkmagic": "764824073", "networkid": "Mainnet", "activeslotcoeff": "0.05", "updatequorum": "5", "maxlovelacesupply": "45000000000000000", "epochlength": "432000", "systemstart": 1506203091, "slotsperkesperiod": "129600", "slotlength": "1", "maxkesrevolutions": "62", "securityparam": "2160", "alonzogenesis": "{\"lovelacePerUTxOWord\":34482,\"executionPrices\":{\"prSteps\":{\"numerator\":721,\"denominator\":10000000},\"prMem\":{\"numerator\":577,\"denominator\":10000}},\"maxTxExUnits\":{\"exUnitsMem\":10000000,\"exUnitsSteps\":10000000000},\"maxBlockExUnits\":{\"exUnitsMem\":50000000,\"exUnitsSteps\":40000000000},\"maxValueSize\":5000,\"collateralPercentage\":150,\"maxCollateralInputs\":3,\"costModels\":{\"PlutusV1\":{\"sha2_256-memory-arguments\":4,\"equalsString-cpu-arguments-constant\":1000,\"cekDelayCost-exBudgetMemory\":100,\"lessThanEqualsByteString-cpu-arguments-intercept\":103599,\"divideInteger-memory-arguments-minimum\":1,\"appendByteString-cpu-arguments-slope\":621,\"blake2b-cpu-arguments-slope\":29175,\"iData-cpu-arguments\":150000,\"encodeUtf8-cpu-arguments-slope\":1000,\"unBData-cpu-arguments\":150000,\"multiplyInteger-cpu-arguments-intercept\":61516,\"cekConstCost-exBudgetMemory\":100,\"nullList-cpu-arguments\":150000,\"equalsString-cpu-arguments-intercept\":150000,\"trace-cpu-arguments\":150000,\"mkNilData-memory-arguments\":32,\"lengthOfByteString-cpu-arguments\":150000,\"cekBuiltinCost-exBudgetCPU\":29773,\"bData-cpu-arguments\":150000,\"subtractInteger-cpu-arguments-slope\":0,\"unIData-cpu-arguments\":150000,\"consByteString-memory-arguments-intercept\":0,\"divideInteger-memory-arguments-slope\":1,\"divideInteger-cpu-arguments-model-arguments-slope\":118,\"listData-cpu-arguments\":150000,\"headList-cpu-arguments\":150000,\"chooseData-memory-arguments\":32,\"equalsInteger-cpu-arguments-intercept\":136542,\"sha3_256-cpu-arguments-slope\":82363,\"sliceByteString-cpu-arguments-slope\":5000,\"unMapData-cpu-arguments\":150000,\"lessThanInteger-cpu-arguments-intercept\":179690,\"mkCons-cpu-arguments\":150000,\"appendString-memory-arguments-intercept\":0,\"modInteger-cpu-arguments-model-arguments-slope\":118,\"ifThenElse-cpu-arguments\":1,\"mkNilPairData-cpu-arguments\":150000,\"lessThanEqualsInteger-cpu-arguments-intercept\":145276,\"addInteger-memory-arguments-slope\":1,\"chooseList-memory-arguments\":32,\"constrData-memory-arguments\":32,\"decodeUtf8-cpu-arguments-intercept\":150000,\"equalsData-memory-arguments\":1,\"subtractInteger-memory-arguments-slope\":1,\"appendByteString-memory-arguments-intercept\":0,\"lengthOfByteString-memory-arguments\":4,\"headList-memory-arguments\":32,\"listData-memory-arguments\":32,\"consByteString-cpu-arguments-intercept\":150000,\"unIData-memory-arguments\":32,\"remainderInteger-memory-arguments-minimum\":1,\"bData-memory-arguments\":32,\"lessThanByteString-cpu-arguments-slope\":248,\"encodeUtf8-memory-arguments-intercept\":0,\"cekStartupCost-exBudgetCPU\":100,\"multiplyInteger-memory-arguments-intercept\":0,\"unListData-memory-arguments\":32,\"remainderInteger-cpu-arguments-model-arguments-slope\":118,\"cekVarCost-exBudgetCPU\":29773,\"remainderInteger-memory-arguments-slope\":1,\"cekForceCost-exBudgetCPU\":29773,\"sha2_256-cpu-arguments-slope\":29175,\"equalsInteger-memory-arguments\":1,\"indexByteString-memory-arguments\":1,\"addInteger-memory-arguments-intercept\":1,\"chooseUnit-cpu-arguments\":150000,\"sndPair-cpu-arguments\":150000,\"cekLamCost-exBudgetCPU\":29773,\"fstPair-cpu-arguments\":150000,\"quotientInteger-memory-arguments-minimum\":1,\"decodeUtf8-cpu-arguments-slope\":1000,\"lessThanInteger-memory-arguments\":1,\"lessThanEqualsInteger-cpu-arguments-slope\":1366,\"fstPair-memory-arguments\":32,\"modInteger-memory-arguments-intercept\":0,\"unConstrData-cpu-arguments\":150000,\"lessThanEqualsInteger-memory-arguments\":1,\"chooseUnit-memory-arguments\":32,\"sndPair-memory-arguments\":32,\"addInteger-cpu-arguments-intercept\":197209,\"decodeUtf8-memory-arguments-slope\":8,\"equalsData-cpu-arguments-intercept\":150000,\"mapData-cpu-arguments\":150000,\"mkPairData-cpu-arguments\":150000,\"quotientInteger-cpu-arguments-constant\":148000,\"consByteString-memory-arguments-slope\":1,\"cekVarCost-exBudgetMemory\":100,\"indexByteString-cpu-arguments\":150000,\"unListData-cpu-arguments\":150000,\"equalsInteger-cpu-arguments-slope\":1326,\"cekStartupCost-exBudgetMemory\":100,\"subtractInteger-cpu-arguments-intercept\":197209,\"divideInteger-cpu-arguments-model-arguments-intercept\":425507,\"divideInteger-memory-arguments-intercept\":0,\"cekForceCost-exBudgetMemory\":100,\"blake2b-cpu-arguments-intercept\":2477736,\"remainderInteger-cpu-arguments-constant\":148000,\"remainderInteger-cpu-arguments-intercept\":425507,\"quotientInteger-memory-arguments-slope\":1,\"mkPairData-memory-arguments\":32,\"unMapData-memory-arguments\":32,\"appendString-cpu-arguments-slope\":1000,\"sha3_256-memory-arguments\":4,\"decodeUtf8-memory-arguments-intercept\":0,\"equalsByteString-cpu-arguments-slope\":248,\"equalsByteString-cpu-arguments-intercept\":103599,\"cekApplyCost-exBudgetCPU\":29773,\"mkCons-memory-arguments\":32,\"cekApplyCost-exBudgetMemory\":100,\"lessThanByteString-memory-arguments\":1,\"chooseList-cpu-arguments\":150000,\"mkNilPairData-memory-arguments\":32,\"constrData-cpu-arguments\":150000,\"unConstrData-memory-arguments\":32,\"quotientInteger-cpu-arguments-model-arguments-slope\":118,\"mapData-memory-arguments\":32,\"cekBuiltinCost-exBudgetMemory\":100,\"lessThanByteString-cpu-arguments-intercept\":103599,\"iData-memory-arguments\":32,\"addInteger-cpu-arguments-slope\":0,\"trace-memory-arguments\":32,\"equalsString-memory-arguments\":1,\"cekLamCost-exBudgetMemory\":100,\"indexByteString-cpu-arguments-intercept\":150000,\"sha3_256-cpu-arguments-intercept\":2477736,\"cekDelayCost-exBudgetCPU\":29773,\"mkNilData-cpu-arguments\":150000,\"lessThanInteger-cpu-arguments-slope\":1366,\"nullList-memory-arguments\":32,\"encodeUtf8-cpu-arguments-intercept\":150000,\"unBData-memory-arguments\":32,\"appendString-cpu-arguments-intercept\":150000,\"sliceByteString-memory-arguments-intercept\":0,\"sliceByteString-cpu-arguments-intercept\":150000,\"modInteger-cpu-arguments-constant\":148000,\"modInteger-cpu-arguments-intercept\":425507,\"quotientInteger-cpu-arguments-model-arguments-intercept\":425507,\"multiplyInteger-cpu-arguments-slope\":0,\"equalsByteString-memory-arguments\":1,\"remainderInteger-cpu-arguments-model-arguments-intercept\":425507,\"quotientInteger-memory-arguments-intercept\":0,\"cekConstCost-exBudgetCPU\":29773,\"subtractInteger-memory-arguments-intercept\":1,\"blake2b-memory-arguments\":4,\"appendString-memory-arguments-slope\":1\}"}} ``` -------------------------------- ### Example JSON Response for Pool Registrations Source: https://github.com/cardano-apexpool/koios-api-python/blob/main/README.md This JSON snippet provides an example of the data structure returned by the `get_pool_registrations` function. Each object within the array represents a single pool registration, containing fields such as `pool_id_bech32`, `tx_hash`, `block_hash`, `epoch_no`, and `active_epoch_no`. ```JSON [ { "pool_id_bech32": "pool1newmccddazerzanrdeeelvzk6vzh9stxn5n8ravshqa05n0t83u", "tx_hash": "02e3644f9bc23e7f0d04addfee80b4f36ba1da774da3c26ec76a7c8ea43a44ac", "block_hash": "8aaec0f14cf462e4fa6e7a3340c85f94c746f4397b027d55202f667bf36843fc", "block_height": 9577227, "epoch_no": 450, "epoch_slot": 2118, "active_epoch_no": 453 }, { "pool_id_bech32": "pool1q9kwa675j2z53jecrs6pn3fqsc9ypxrsypu5dgu6hammqkagy22", "tx_hash": "56a2a1d4cbb28b09f075a8c1db67f7ad721f003703a1d33aa1b9d9784f1fbccf", "block_hash": "2b3f126ce6381437e9968a6a928a49cd4d1fe09c1cf63648c0fae2bcb4038805", "block_height": 9578008, "epoch_no": 450, "epoch_slot": 17681, "active_epoch_no": 453 }, { "pool_id_bech32": "pool1yc6f3cqsc7jfh07hcns64v5cp8720mve870pgxf2wkr3u8l7tse", "tx_hash": "5b99ddca8dda03fe9f21be8f36ece2fa22ec97df84d5257f322b948b73e92adb", "block_hash": "2c15575b2ad41a337e375fed103b11eb8f42c086b7cbba23a126c84f24721554", "block_height": 9578511, "epoch_no": 450, "epoch_slot": 28254, "active_epoch_no": 453 }, { "pool_id_bech32": "pool1m83drqwlugdt9jn7jkz8hx3pne53acfkd539d9cj8yr92dr4k9y", "tx_hash": "42e10b531d571b9a750425c722e8093e6c447e5c5ba5d1ac9357aea179e597c0", "block_hash": "272e94bab3c3a15c440e1e1bf9e430ad3d52d6c536bf60f5ba7ac56a16183d89", "block_height": 9578947, "epoch_no": 450, "epoch_slot": 36901, "active_epoch_no": 453 }, { "pool_id_bech32": "pool1cuhcw4dhj577rzz847q5swfvrnthj2vn62hry6ljzp6g6v3ag77", "tx_hash": "7c49f3d0360a10526c709b4bcddb33f31e1f74b005b5238eaddde2e4021f9630", "block_hash": "3419666414394246cc24469409acd82f28995fcf3c58f860f7195dbcc1fe266a", "block_height": 9580008, "epoch_no": 450, "epoch_slot": 58006, "active_epoch_no": 452 }, { "pool_id_bech32": "pool1l6aeyn35nkqkn9lqqlwqnpraakdzuukjrqprcrj3sctk6hhe32k", "tx_hash": "d2a105e8c0822cbd22748c4aa18c28dfd0418709a98c316c32eb44c0d9c7e6d4", "block_hash": "608fb2ebef32d8b10858c726c0a277b627423357eb2f79d739750af80b181131", "block_height": 9580897, "epoch_no": 450, "epoch_slot": 76704, "active_epoch_no": 453 }, { "pool_id_bech32": "pool1uct8k7ruvu3dgl9hws4pj3tk9stzpls4evnys4r8q5vj2p9w92w", "tx_hash": "27b530a2a786a127277786acf831096b0f1b1f5ae83ce91dfabdb0f7c65b1aa7", "block_hash": "9552a30577df9acad319e2684b850f74f3f559df137b70efe670822bb1834607", "block_height": 9581443, "epoch_no": 450, "epoch_slot": 88553, "active_epoch_no": 452 }, { "pool_id_bech32": "pool1n940lfxkd7z73qzj5y554yrletrmgg5x2eya9tpglh3uwcqfnud", "tx_hash": "4d389be4801cc2b434913eaec34f21aa1cf531db390c63efa57fe3989cefa70b", "block_hash": "f1867fe6bcd19fd6b01f25c9b1c976c16d4b5be7ba8b195c8ccb2e80f959c1e7", "block_height": 9583181, "epoch_no": 450, "epoch_slot": 125441, "active_epoch_no": 453 }, { "pool_id_bech32": "pool13hxlxd6qa68fmfhrvvmasa0mjg30tj9p5v2lmgmgsmrp2rgzkfp", "tx_hash": "cdf6afa4b2937f3cd66cceedbeb21fddccea4d05502e5081009d5aba3503002b", "block_hash": "bd4b98742aba98ff82271b3652609ecb85a3ded9320f0f64a66aed436f58ebd9", "block_height": 9587487, "epoch_no": 450, "epoch_slot": 213334, "active_epoch_no": 453 }, { "pool_id_bech32": "pool1nrmlaqy77txzd4lrayx92x76hmv97sldqgntqc49a820sf4ment", "tx_hash": "44994b6b060e4e80e16bc698de63379d0097db856184d989cc0795d87ad9b7fe", "block_hash": "e05cd9b36fb762a58d72d18618b491586afe29360f76740d55ea757a09411795", "block_height": 9588831, "epoch_no": 450, "epoch_slot": 242054, "active_epoch_no": 453 }, { "pool_id_bech32": "pool1nrmlaqy77txzd4lrayx92x76hmv97sldqgntqc49a820sf4ment", "tx_hash": "09cb3e784b8ee4173645b1e11fc8bd2d713d7fc1b364c9611eef673be4eae582", "block_hash": "7aeec2cdc64e5cd1c61c173a84986e50f511637d3fe22822c34212e26f8c6210", "block_height": 9588884, "epoch_no": 450, "epoch_slot": 243186, "active_epoch_no": 453 }, { "pool_id_bech32": "pool1nrmlaqy77txzd4lrayx92x76hmv97sldqgntqc49a820sf4ment", "tx_hash": "7aa6b0d94d87783d73176a39238a3cabc62a27df43cd2762c229c51fa602660d", "block_hash": "42a01085d4f264829f11019bfe3fb670e7e61935dd30b63a5c4ebb7093ee4fd1", "block_height": 9589567, "epoch_no": 450, "epoch_slot": 256996, "active_epoch_no": 453 }, { "pool_id_bech32": "pool18qahj5ggudguk69g9aaztf5dvapmazql4hdvd7v0947j7gy4wqf", "tx_hash": "1179715221bc784df721c194602029a6a62085766bbc16db622cbd2d0d974faf", "block_hash": "eb9cd7d9566d497f6376971ba7c4d95fa428b1be586b66c89c694a0775d7de4c", "block_height": 9591466, "epoch_no": 450, "epoch_slot": 297514, "active_epoch_no": 453 } ``` -------------------------------- ### Importing Specific Koios API Function and Getting Blockchain Tip Source: https://github.com/cardano-apexpool/koios-api-python/blob/main/README.md This Python snippet shows how to import only the `get_tip` function from the `koios_api.network` submodule, allowing for more selective imports and direct function calls to retrieve the current blockchain tip. ```python from koios_api.network import get_tip get_tip() ``` -------------------------------- ### Example Response for Epoch Protocol Parameters (JSON) Source: https://github.com/cardano-apexpool/koios-api-python/blob/main/README.md This JSON object illustrates the structure and content of the response returned by the `get_epoch_params` function. It includes detailed protocol parameters such as epoch number, transaction fees, block sizes, deposit amounts, and cost models for Plutus versions. ```JSON [ { "epoch_no": 448, "min_fee_a": 44, "min_fee_b": 155381, "max_block_size": 90112, "max_tx_size": 16384, "max_bh_size": 1100, "key_deposit": "2000000", "pool_deposit": "500000000", "max_epoch": 18, "optimal_pool_count": 500, "influence": 0.3, "monetary_expand_rate": 0.003, "treasury_growth_rate": 0.2, "decentralisation": 0, "extra_entropy": null, "protocol_major": 8, "protocol_minor": 0, "min_utxo_value": "0", "min_pool_cost": "170000000", "nonce": "d58c8fdf57a9d20b4e72fce94056ad2ed2b62e40a7b0b35e1f37f267f9546c07", "block_hash": "a74c031d215542d19fdafee6a28fde865c5961d296759e0ae9d19d50aa6f8a12", "cost_models": { "PlutusV1": [ 205665, 812, 1, 1, 1000, 571, 0, 1, 1000, 24177, 4, 1, 1000, 32, 117366, 10475, 4, 23000, 100, 23000, 100, 23000, 100, 23000, 100, 23000, 100, 23000, 100, 100, 100, 23000, 100, 19537, 32, 175354, 32, 46417, 4, 221973, 511, 0, 1, 89141, 32, 497525, 14068, 4, 2, 196500, 453240, 220, 0, 1, 1, 1000, 28662, 4, 2, 245000, 216773, 62, 1, 1060367, 12586, 1, 208512, 421, 1, 187000, 1000, 52998, 1, 80436, 32, 43249, 32, 1000, 32, 80556, 1, 57667, 4, 1000, 10, 197145, 156, 1, 197145, 156, 1, 204924, 473, 1, 208896, 511, 1, 52467, 32, 64832, 32, 65493, 32, 22558, 32, 16563, 32, 76511, 32, 196500, 453240, 220, 0, 1, 1, 69522, 11687, 0, 1, 60091, 32, 196500, 453240, 220, 0, 1, 1, 196500, 453240, 220, 0, 1, 1, 806990, 30482, 4, 1927926, 82523, 4, 265318, 0, 4, 0, 85931, 32, 205665, 812, 1, 1, 41182, 32, 212342, 32, 31220, 32, 32696, 32, 43357, 32, 32247, 32, 38314, 32, 57996947, 18975, 10 ], "PlutusV2": [ 205665, 812, 1, 1, 1000, 571, 0, 1, 1000, 24177, 4, 1, 1000, 32, 117366, 10475, 4, 23000, 100, 23000, 100, 23000, 100, 23000, 100, 23000, 100, 23000, 100, 100, 100, 23000, 100, 19537, 32, 175354, 32, 46417, 4, 221973, 511, 0, 1, 89141, 32, 497525, 14068, 4, 2, 196500, 453240, 220, 0, 1, 1, 1000, 28662, 4, 2, 245000, 216773, 62, 1, 1060367, 12586, 1, 208512, 421, 1, 187000, 1000, 52998, 1, 80436, 32, 43249, 32, 1000, 32, 80556, 1, 57667, 4, 1000, 10, 197145, 156, 1, 197145, 156, 1, 204924, 473, 1, 208896, 511, 1, 52467, 32, 64832, 32, 65493, 32, 22558, 32, 16563, 32, 76511, 32, 196500, 453240 ] } } ] ``` -------------------------------- ### Calling Koios API: Get Genesis Parameters (Python) Source: https://github.com/cardano-apexpool/koios-api-python/blob/main/README.md This snippet demonstrates how to call the `get_genesis` function from the Koios API Python client to retrieve the blockchain's genesis parameters. It requires the Koios API Python library to be installed and imported. ```Python genesis = get_genesis() ``` -------------------------------- ### Querying Network Tip via Ogmios (Python) Source: https://github.com/cardano-apexpool/koios-api-python/blob/main/README.md This example demonstrates how to use the `get_ogmios` function to query the current tip of the Cardano network. It requires the Ogmios API version (e.g., '2.0') and the specific query method ('queryNetwork/tip'). The function returns a dictionary containing the current `slot` and `id` of the network tip. ```Python tip = get_ogmios("2.0", "queryNetwork/tip") ``` -------------------------------- ### Getting Network Tip Information with Koios API Python Source: https://github.com/cardano-apexpool/koios-api-python/blob/main/README.md This snippet demonstrates the `get_tip` function, which retrieves the latest block information seen by the Cardano chain. This function requires no parameters and returns a list containing a single dictionary with details about the current network tip. ```Python tip = get_tip() ``` ```JSON [ { "hash": "442765ab5660346a6af3ba7667bbd35934e6219a52f0f53a80f28d27a70309c1", "epoch_no": 381, "abs_slot": 79265882, "epoch_slot": 37082, "block_no": 8129347, "block_time": 1670832173 } ] ```