A simple request wrapper for the Pancake-Swap API
![](https://www.deeplearningdaily.com/wp-content/uploads/2021/07/a-simple-request-wrapper-for-the-pancake-swap-api_610478a6b11c1-375x210.png)
Python Pancakes
A simple request wrapper for the Pancake-Swap API.
Installation
Install package
# Using pip
$ pip install pythonpancakes
# Or from source
$ git clone https://github.com/scottburlovich/pythonpancakes.git pythonpancakes
$ cd pythonpancakes
$ python3 setup.py install
Import module into your project and initialize API class
from pythonpancakes import PancakeSwapAPI
ps = PancakeSwapAPI()
Usage
Please note, the API functionality currently exposed by PancakeSwap is quite basic. This package will be updated as they add new functionality.
summary()
Returns a dictionary containing data for the top ~1000 PancakeSwap pairs, sorted by reserves.
Example invocation:
summary = ps.summary()
Example output:
# output:
{
"updated_at": 1234567, // UNIX timestamp
"data": {
"0x..._0x...": { // BEP20 token addresses, joined by an underscore
"price": "...", // price denominated in