blockchain-apis


Nameblockchain-apis JSON
Version 0.2.1 PyPI version JSON
download
home_pagehttps://www.blockchainapis.io
SummaryFastest and easiest way to access decentralized finance data
upload_time2023-07-01 10:06:30
maintainer
docs_urlNone
authorClarensia
requires_python>=3.10
licenseMIT
keywords blockchain crypto cryptocurrency api arbitrage trading ethereum financial-data financial-analysis sdk python defi dex
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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](https://discord.gg/GphRMJXmS5)
Documentation link: [https://api.blockchainapis.io/docs](https://api.blockchainapis.io/docs)

## Quickstart

### Install the package

`pip install blockchain-apis`

### Get the current price of ethereum accross all blockchains

```python
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:

```json
[
  {
    "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
  }
]
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://www.blockchainapis.io",
    "name": "blockchain-apis",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "blockchain crypto cryptocurrency api arbitrage trading ethereum financial-data financial-analysis sdk python defi dex",
    "author": "Clarensia",
    "author_email": "contact@blockchainapis.io",
    "download_url": "https://files.pythonhosted.org/packages/da/3d/a1e233b95618a27f98b653ca63798f69778f6015909658fafa235b349fe2/blockchain-apis-0.2.1.tar.gz",
    "platform": null,
    "description": "# Blockchain APIs\n\n## Introduction\n\nThe fastest and easiest way to interact with DeFi.\n\nWith this SDK you can:\n- Get the price of any pair across all marketplaces in one API call\n- Get the current reserves of any pair\n- Use the same code to gather data from many blockchains and exchanges\n\nSince DeFi is volatile and fast moving space, you need an SDK that is highly performant. Here are the capabilities of **Blockchain APIs**:\n- Make async API calls for more than 1000 requests per second\n- Processing time 20 times faster than the blockchain\n\nExamples of project that you can make with **Blockchain APIs**:\n- Arbitrage trading bot\n- Aggregator\n- Application to track cryptocurrency prices\n\nTo get any help, feel free to join [our discord](https://discord.gg/GphRMJXmS5)\nDocumentation link: [https://api.blockchainapis.io/docs](https://api.blockchainapis.io/docs)\n\n## Quickstart\n\n### Install the package\n\n`pip install blockchain-apis`\n\n### Get the current price of ethereum accross all blockchains\n\n```python\nimport asyncio\n\nfrom blockchainapis import BlockchainAPIs\n\nasync def print_eth_price():\n    blockchain_apis = BlockchainAPIs()\n    # Get the price of selling 1 ETH to USDT in Ethereum\n    eth_price = await blockchain_apis.amount_out(\n        blockchain=\"ethereum\",\n        amountIn=1000000000000000000,\n        tokenIn=\"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2\",\n        tokenOut=\"0xdAC17F958D2ee523a2206206994597C13D831ec7\"\n    )\n\n    print(eth_price)\n    await blockchain_apis.close()\n\nasyncio.run(print_eth_price())\n```\n\n#### Example response:\n\n```json\n[\n  {\n    \"blockchain\": \"ethereum\",\n    \"exchange\": \"elk_finance_ethereum\",\n    \"tokenIn\": \"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2\",\n    \"tokenOut\": \"0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n    \"amountIn\": 1000000000000000000,\n    \"amountOut\": 149342441\n  },\n  {\n    \"blockchain\": \"ethereum\",\n    \"exchange\": \"pancakeswap_ethereum\",\n    \"tokenIn\": \"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2\",\n    \"tokenOut\": \"0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n    \"amountIn\": 1000000000000000000,\n    \"amountOut\": 1873655816\n  },\n  {\n    \"blockchain\": \"ethereum\",\n    \"exchange\": \"plasmafinance_ethereum\",\n    \"tokenIn\": \"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2\",\n    \"tokenOut\": \"0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n    \"amountIn\": 1000000000000000000,\n    \"amountOut\": 8710340\n  },\n  {\n    \"blockchain\": \"ethereum\",\n    \"exchange\": \"shibaswap_ethereum\",\n    \"tokenIn\": \"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2\",\n    \"tokenOut\": \"0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n    \"amountIn\": 1000000000000000000,\n    \"amountOut\": 1897543149\n  },\n  {\n    \"blockchain\": \"ethereum\",\n    \"exchange\": \"sushiswap_ethereum\",\n    \"tokenIn\": \"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2\",\n    \"tokenOut\": \"0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n    \"amountIn\": 1000000000000000000,\n    \"amountOut\": 1905389353\n  },\n  {\n    \"blockchain\": \"ethereum\",\n    \"exchange\": \"uniswapv2_ethereum\",\n    \"tokenIn\": \"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2\",\n    \"tokenOut\": \"0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n    \"amountIn\": 1000000000000000000,\n    \"amountOut\": 1904261651\n  }\n]\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Fastest and easiest way to access decentralized finance data",
    "version": "0.2.1",
    "project_urls": {
        "Discord": "https://discord.gg/GphRMJXmS5",
        "Documentation": "https://api.blockchainapis.io/docs",
        "Homepage": "https://www.blockchainapis.io",
        "Source": "https://github.com/blockchainapis/blockchain-apis-python-client",
        "Tracker": "https://github.com/blockchainapis/blockchain-apis-python-client/issues"
    },
    "split_keywords": [
        "blockchain",
        "crypto",
        "cryptocurrency",
        "api",
        "arbitrage",
        "trading",
        "ethereum",
        "financial-data",
        "financial-analysis",
        "sdk",
        "python",
        "defi",
        "dex"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4d151607696525ccca058cec50b3c099c21a1e360b9490317c8fe6cc3170f0a0",
                "md5": "730965620101ee271fbd506b787e5cf6",
                "sha256": "d5f7e8ae63bd706e8d9edd5e1b2022e338dd823a6a7edc8bfc3ebb5e257f2742"
            },
            "downloads": -1,
            "filename": "blockchain_apis-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "730965620101ee271fbd506b787e5cf6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 27877,
            "upload_time": "2023-07-01T10:06:28",
            "upload_time_iso_8601": "2023-07-01T10:06:28.760036Z",
            "url": "https://files.pythonhosted.org/packages/4d/15/1607696525ccca058cec50b3c099c21a1e360b9490317c8fe6cc3170f0a0/blockchain_apis-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "da3da1e233b95618a27f98b653ca63798f69778f6015909658fafa235b349fe2",
                "md5": "f3fc72272daab7ee118d79faaf31b478",
                "sha256": "afe87ad7a030b9cadc79a0afaa0ec3e37d5aef5ecf07ca9da39071a028fc25d0"
            },
            "downloads": -1,
            "filename": "blockchain-apis-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "f3fc72272daab7ee118d79faaf31b478",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 18206,
            "upload_time": "2023-07-01T10:06:30",
            "upload_time_iso_8601": "2023-07-01T10:06:30.465012Z",
            "url": "https://files.pythonhosted.org/packages/da/3d/a1e233b95618a27f98b653ca63798f69778f6015909658fafa235b349fe2/blockchain-apis-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-01 10:06:30",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "blockchainapis",
    "github_project": "blockchain-apis-python-client",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "blockchain-apis"
}
        
Elapsed time: 0.09244s