Skip to main content

Fastest and easiest way to access decentralized finance data

Project description

Blockchain APIs

Introduction

The fastest and easiest way to interact with DeFi.

With this SDK you can:

  • Get the price of any pair across all marketplaces in one API call
  • Get the current reserves of any pair
  • Use the same code to gather data from many blockchains and exchanges

Since DeFi is volatile and fast moving space, you need an SDK that is highly performant. Here are the capabilities of Blockchain APIs:

  • Make async API calls for more than 1000 requests per second
  • Processing time 20 times faster than the blockchain

Examples of project that you can make with Blockchain APIs:

  • Arbitrage trading bot
  • Aggregator
  • Application to track cryptocurrency prices

To get any help, feel free to join our discord Documentation link: https://api.blockchainapis.io/docs

Quickstart

Install the package

pip install blockchain-apis

Get the current price of ethereum accross all blockchains

import asyncio

from blockchainapis import BlockchainAPIs

async def print_eth_price():
    blockchain_apis = BlockchainAPIs()
    # Get the price of selling 1 ETH to USDT in Ethereum
    eth_price = await blockchain_apis.amount_out(
        blockchain="ethereum",
        amountIn=1000000000000000000,
        tokenIn="0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
        tokenOut="0xdAC17F958D2ee523a2206206994597C13D831ec7"
    )

    print(eth_price)
    await blockchain_apis.close()

asyncio.run(print_eth_price())

Example response:

[
  {
    "blockchain": "ethereum",
    "exchange": "elk_finance_ethereum",
    "tokenIn": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
    "tokenOut": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
    "amountIn": 1000000000000000000,
    "amountOut": 149342441
  },
  {
    "blockchain": "ethereum",
    "exchange": "pancakeswap_ethereum",
    "tokenIn": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
    "tokenOut": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
    "amountIn": 1000000000000000000,
    "amountOut": 1873655816
  },
  {
    "blockchain": "ethereum",
    "exchange": "plasmafinance_ethereum",
    "tokenIn": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
    "tokenOut": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
    "amountIn": 1000000000000000000,
    "amountOut": 8710340
  },
  {
    "blockchain": "ethereum",
    "exchange": "shibaswap_ethereum",
    "tokenIn": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
    "tokenOut": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
    "amountIn": 1000000000000000000,
    "amountOut": 1897543149
  },
  {
    "blockchain": "ethereum",
    "exchange": "sushiswap_ethereum",
    "tokenIn": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
    "tokenOut": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
    "amountIn": 1000000000000000000,
    "amountOut": 1905389353
  },
  {
    "blockchain": "ethereum",
    "exchange": "uniswapv2_ethereum",
    "tokenIn": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
    "tokenOut": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
    "amountIn": 1000000000000000000,
    "amountOut": 1904261651
  }
]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

blockchain-apis-0.2.1.tar.gz (18.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

blockchain_apis-0.2.1-py3-none-any.whl (27.9 kB view details)

Uploaded Python 3

File details

Details for the file blockchain-apis-0.2.1.tar.gz.

File metadata

  • Download URL: blockchain-apis-0.2.1.tar.gz
  • Upload date:
  • Size: 18.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for blockchain-apis-0.2.1.tar.gz
Algorithm Hash digest
SHA256 afe87ad7a030b9cadc79a0afaa0ec3e37d5aef5ecf07ca9da39071a028fc25d0
MD5 f3fc72272daab7ee118d79faaf31b478
BLAKE2b-256 da3da1e233b95618a27f98b653ca63798f69778f6015909658fafa235b349fe2

See more details on using hashes here.

File details

Details for the file blockchain_apis-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for blockchain_apis-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d5f7e8ae63bd706e8d9edd5e1b2022e338dd823a6a7edc8bfc3ebb5e257f2742
MD5 730965620101ee271fbd506b787e5cf6
BLAKE2b-256 4d151607696525ccca058cec50b3c099c21a1e360b9490317c8fe6cc3170f0a0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page