Moralis Python SDK
A library that gives you access to the powerful Moralis Server backend from your Python app.
Features:
- Web3 authentication
- Make Evm api and Solana api calls
- Stream realtime blockchain data
... and much more. Check the official Moralis docs for more details.
🚀 Quick start
If you're new to Moralis, check the quickstart guide in the official docs on how to get started.
If you're already familiar with Moralis and have your account registered. Then follow along to connect your SDK:
1. Install Moralis
pip install moralis
2. Call your methods
Import the correct module from the SDK and call the method you need. For a full reference of all the methods available, check the references section.
from moralis import evm_api
api_key = "YOUR_API_KEY"
params = {
"address": "0x057Ec652A4F150f7FF94f089A38008f49a0DF88e",
"chain": "eth",
"to_block": 1.2,
}
result = evm_api.balance.get_native_balance(
api_key=api_key,
params=params,
)
print(result)
🧭 Table of Contents
⭐️ Star us
If this JS SDK helps you build your dapps faster - please star this project, every star makes us very happy!
🤝 Need help
If you need help with setting up the boilerplate or have other questions - don't hesitate to write in our community forum and we will check asap. Forum link. The best thing about this SDK is the super active community ready to help at any time! We help each other.
👀 Examples
Example getting native balance of an address via the EVM balance API
from moralis import evm_api
api_key = "YOUR_API_KEY"
params = {
"address": "0x057Ec652A4F150f7FF94f089A38008f49a0DF88e",
"chain": "eth",
"to_block": 1.2,
}
result = evm_api.balance.get_native_balance(
api_key=api_key,
params=params,
)
print(result)
Example getting native balance of an address via the SOL account API
from moralis import sol_api
api_key = "YOUR_API_KEY"
params = {
"network": "",
"address": "",
}
result = sol_api.account.balance(
api_key=api_key,
params=params,
)
print(result)
Example getting authentication message via the Auth API
from moralis import auth
api_key = "YOUR_API_KEY"
body = {
"domain": "defi.finance",
"chainId": "1",
"address": "0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B",
"statement": "Please confirm",
"uri": "https://defi.finance/",
"expirationTime": "2020-01-01T00:00:00.000Z",
"notBefore": "2020-01-01T00:00:00.000Z",
"resources": ['https://docs.moralis.io/'],
"timeout": 15,
}
result = auth.challenge.request_challenge_evm(
api_key=api_key,
body=body,
)
print(result)
Example getting stream via the Streams API
from moralis import streams
api_key = "YOUR_API_KEY"
params = {
"limit": 1.2,
"cursor": "",
}
result = streams.evm_streams.get_streams(
api_key=api_key,
params=params,
)
print(result)
📚 References
For more info see the live docs, or the docs pages
evm_api
sol_api
auth
streams
🧙♂️ Community
Metadata
Release files for moralis 0.1.49
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| moralis-0.1.49.tar.gz | 579.2 kB | Without provenance | Details for moralis-0.1.49.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| moralis-0.1.49-py3-none-any.whl | Python 3 | none | any | Details for moralis-0.1.49-py3-none-any.whl |
Total release size: 2.8 MB
Release files / moralis-0.1.49.tar.gz
| Download URL | moralis-0.1.49.tar.gz |
|---|---|
| Size | 579.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ea73e08344e75be980a8ee61f0c16c6d5262e9c34934520cb7b3725dfd838040
|
|
BLAKE2b-256 checksum How to use checksums |
d9cfe122fb3a39755a7640b10cdfe3e4205c05f1ec2a71a9c101535db38ddd44
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.12.5
|
Release files / moralis-0.1.49-py3-none-any.whl
| Download URL | moralis-0.1.49-py3-none-any.whl |
|---|---|
| Size | 2.3 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2a92e26f61d57e726f947541fa30950a48ba45bc0e3fb8e489ff5d7adbc64a7c
|
|
BLAKE2b-256 checksum How to use checksums |
e0650e4df06f0840a00af5661fa09e3438eeaaeba3027ce9381528fe77560613
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.12.5
|
Security for moralis 0.1.49
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.