Any developer can get started with Solana blockchain app development with the right tools. When opting for one of the leading Solana development tools, the Solana API, short code snippets do all the blockchain-related backend work. Hereโs an example of the API in action fetching balances of a wallet:
@app.post("/getWalletbalance") def getWalletbalance(): body = request.json params = { "address": body["address"], "network": body["network"] } result = sol_api.account.balance( api_key= moralis_api_key, params = params ) return result
The โsol_api.account.balanceโ method is just one of the powerful methods in the Moralis Solana API set. In this article, weโll show you how to easily implement all of them, which is the key to effortless Solana blockchain app development. If that interests you, make sure to create your free Moralis account and follow along!

Overview
In todayโs article, weโll first focus on a beginner-friendly Solana blockchain app development tutorial. The latter will teach you how to easily work with the Solana API. By using our existing Solana dapp, we will demonstrate how to transition from NodeJS to Python backend without affecting the JavaScript frontend. Aside from the endpoint used above, this tutorial will implement the entire Solana API fleet.
The second half of this guide will help you better understand Solana and Solana blockchain development. This is also where we will take a closer look at the Solana blockchain development services and resources. As such, youโll have a chance to learn more about the Solana API. As a result, youโll be able to determine which endpoints you should focus on for your Solana blockchain app development feats.

Solana Blockchain App Development with the Solana API
As mentioned above and as the above image illustrates, this Solana blockchain app development tutorial focuses on shifting the backend from NodeJS to Python without affecting the frontend. The latter is a simple JavaScript app that allows users to utilize the power of the Solana API endpoints:

Note: You can clone the complete frontend script โ โindex.htmlโ โ on GitHub. In case you want a quick code walkthrough of our example frontend dapp, check out the video at the top of this article, starting at 1:05.
In order to use Python to implement the Solana API, you need to complete some initial setups, which is exactly what the upcoming section will help you with.
Setting Up Python and Solana Blockchain Development Services
Before moving on, make sure to have your โSolana API demoโ project ready. The latter should contain a โfrontendโ folder, which includes the above-mentioned โindex.htmlโ script, presuming you cloned our code. In case you did clone our NodeJS backend as well, you should also have a โbackendโ folder in your project:
Moving on, start by creating a โpython-backendโ folder. You can do this manually or via the following command:
mkdir python-backend
Next, โcdโ into this new folder by running the command below:
cd python-backend
Then, you need to create a new virtual environment that will support the installation and use of Python modules. As such, enter this into your terminal:
python3 -m venv venv
You also need to activate your virtual environment:
Run the following โactivateโ command:
source venv/bin/activate
Next, you need to install the necessary modules. The command below will install Flask, Flask CORS, Moralis, and Python โdotenvโ:
pip install flask flask_cors moralis python-dotenv
With your virtual environment activated and modules installed, you may proceed with setting up the environment variables. Hence, make sure to obtain your Moralis Web3 API key. The latter is the gateway to Solana blockchain app development with the Solana API from Moralis. So, if you havenโt created your Moralis account yet, do that now. With your account, you get to access your admin area. There, you can obtain your Web3 API key in the following two steps:
Create a new โ.envโ file or copy it from the NodeJS backend folder and populate the โMORALIS_API_KEYโ variable with the above-obtained API key.
How to Use Solana Blockchain Development Services with Python
To implement the Moralis Solana API endpoints with Python, create a new โindex.pyโ file inside your โpython-backendโ folder. Then, import the above-installed packages and the top of that script:
from flask import Flask, request from flask_cors import CORS from moralis import sol_api from dotenv import dotenv_values
You also want this script to fetch your Web3 API key, which you store in the โ.envโ file:
config = dotenv_values(".env") moralis_api_key = config.get("MORALIS_API_KEY")
On the next line, use Flask to define a variable โappโ and include โCORSโ:
app = Flask(__name__) CORS(app)
Since you are replacing our NodeJS backend that runs on port โ9000โ, make sure your Python backend focus on the same port. Otherwise, youโd need to modify the URL in your frontend. These are the lines of code that will take care of that:
if __name__ == "__main__": app.run(debug=True, host="0.0.0.0", port=9000)
Moving further down your โindex.pyโ script, itโs time you start implementing the Moralis Solana API endpoints: โGet native balance by walletโ, โGet token balance by walletโ, โGet portfolio by walletโ, โGet token priceโ, โGet NFTs by walletโ, and โGet NFT metadataโ.
The simplest way to use these Solana blockchain development services is to copy the appropriate lines of code from the Solana API reference pages. When working with Python, you need to select that programming language. Hereโs the โGet native balance by walletโ endpoint reference page:

Implementing Solana API Endpoints
Return to your โindex.pyโ script to define routes and functions for each endpoint below the โCORS(app)โ line. As far as the โget native balance by walletโ endpoint goes, the lines of code from the introduction gets the job done:
@app.post("/getWalletbalance") def getWalletbalance(): body = request.json params = { "address": body["address"], "network": body["network"] } result = sol_api.account.balance( api_key= moralis_api_key, params = params ) return result
The top line โ โ@app.post(โ/getWalletbalanceโ) โ creates a new route in Python. With โdef getWalletbalance():โ, you define the function for the endpoint at hand. Using โbody = request.jsonโ, you read the JSON data that Moralis fetches and parses for you. Then, you define the endpointโs parameters (โaddressโ and โnetworkโ). Using the โsol_api.account.balanceโ method with the parameters and your Web3 API key, you store the data under the โresultโ variable. Finally, you use โreturn resultโ to return results.
Python Snippets of Code for All Solana API Endpoints
When it comes to other Solana API endpoints, the exact same principles are at play. Essentially, you can use the same lines of code as presented above. However, you do need to change the routes, function names, and methods to match the endpoint. To save you some time, you can find the snippets of code for the remaining five Solana API endpoints below:
- Implementing the โgetTokenbalanceโ endpoint:
@app.post("/getTokenbalance") def getTokenbalance(): body = request.json params = { "address": body["address"], "network": body["network"] } result = sol_api.account.get_spl( api_key= moralis_api_key, params = params ) return result
- Implementing the โgetNftsโ endpoint:
@app.post("/getNfts") def getNfts(): body = request.json params = { "address": body["address"], "network": body["network"] } result = sol_api.account.get_nfts( api_key= moralis_api_key, params = params ) return result
- Implementing the โgetPortfolioโ endpoint:
@app.post("/getPortfolio") def getPortfolio(): body = request.json params = { "address": body["address"], "network": body["network"] } result = sol_api.account.get_portfolio( api_key= moralis_api_key, params = params ) return result
- Implementing the โgetNFTMetadataโ endpoint:
@app.post("/getNFTMetadata") def getNFTMetadata(): body = request.json params = { "address": body["address"], "network": body["network"] } result = sol_api.nft.get_nft_metadata( api_key= moralis_api_key, params = params ) return result
- Implementing the โgetTokenPriceโ endpoint:
@app.post("/getTokenPrice") def getTokenPrice(): body = request.json params = { "address": body["address"], "network": body["network"] } result = sol_api.token.get_token_price( api_key= moralis_api_key, params = params ) return result
Note: The complete โindex.pyโ script is waiting for you on our GitHub repo page.
Exploring the Results of Your Solana Blockchain App Development
Make sure you are inside your โpython-backendโ folder. Then use the following command to run โindex.pyโ:
python3 index.py
The above command starts your backend on port โ9000โ. To access the power of your backend, you also need to start your frontend. You can do this with the โLive Serverโ extension in Visual Studio Code (VSC). Just right-click on โindex.htmlโ and select the โOpen with Live serverโ option:
Finally, you get to play around with your frontend dapp and test all Solana API endpoints. The following are our examples for the โGet Native Balance by Walletโ and โGet Token Balance by Walletโ options:
- The โGet Native Balance by Walletโ demo:
- The โGet Token Balance by Walletโ demo:
Exploring Solana Blockchain App Development
If you like getting your hands dirty, you enjoyed the above tutorial and most likely created your own instance of our example Solana blockchain app. However, it is important that you understand the theoretical basics behind Solana blockchain app development. So, letโs first answer the โwhat is Solana?โ question.

What is Solana?
Solana is a non-EVM-compatible programmable blockchain. It is public and open-source. Solana supports smart contract development (on-chain programs), token creation, and all sorts of dapps (decentralized applications). Like all leading programmable chains, Solana utilizes its native coin, โSOLโ, to provide network security via Solanaโs hybrid DeFi staking consensus. SOL is also used to cover transaction fees on Solana. Like most cryptocurrencies, it can be used to transfer value on the Solana network.
Raj Gokal and Anatoly Yakovenko launched Solana back in 2017. Both of these devs are still deeply involved with Solana through Solana Labs. The latter is a technology company that builds tools, products, and reference implementations that expand the Solana ecosystem.
Note: To learn more about Solana, use the โwhat is Solana?โ link above.

What is Solana Blockchain Development?
Solana blockchain development is any sort of dev activity that revolves around the Solana blockchain. At its core, it refers to the creation and continuous improvement (updates implementation) of the Solana blockchain itself. This is what Solanaโs core team and community focus on.
On the other hand, Solana blockchain development can also refer to Solana smart contract building and the creation of dapps that interact with this popular decentralized network. For most developers, this is far more exciting and accessible, especially when they use the right Solana blockchain development services, resources, and tools.

Which Programming Language is Used for Solana Development?
Rust is the programming language that Solana supports for writing on-chain programs. So, if you want to code your unique and advanced smart contracts for Solana, youโll want to be skilled in Rust. As two alternatives to Rust, you may also create Solana on-chain programs with C or C++. However, if you want to create NFTs on Solana, you can do so without any advanced programming skills, thanks to some neat Solana dev tools (more on that below).
When it comes to Solana blockchain app development, youโve already learned that NodeJS and Python can get the job done. Moreover, Moralis also supports cURL, Go, and PHP. As such, you can use different legacy programming languages to build killer Solana dapps.

Solana Blockchain Development Services and Resources
The Solana API from Moralis provides the best Solana blockchain development services. They come in the following Web3 data endpoints, which you can use with all leading programming languages/frameworks:
- Balance API endpoints:
- Get native balance by wallet
- Get token balance by wallet
- Get portfolio by wallet
- Token API endpoints:
- NFT API endpoints:
- Get NFTs by wallet
- Get NFT metadata
With the above APIs supporting Solanaโs mainnet and devnet, you can fetch NFT metadata, wallet portfolios, token balances, and SPL token prices. As such, you can use the Moralis Solana API in countless ways. For instance, you can build NFT marketplaces, token price feeds, portfolio dapps, and much more.
Aside from Web3 data, all dapps also need user-friendly Web3 authentication. This is where the Moralis Authentication API enters the scene. The latter supports Ethereum and all leading EVM-compatible chains and Solana. With the โRequest challengeโ and โVerify challengeโ endpoints, you can incorporate seamless Web3 logins for all leading Solana wallets into your dapps. If you are unsure how to answer the โwhat is a Solana wallet?โ question, explore our article on that subject.
When it comes to creating Solana on-chain programs, Solana smart contract examples can save you a lot of time. Also, if you want to create NFTs on this network, Solana NFT mint tools simplify things immensely, such as Metaplex Candy Machine. If you decide to dive deeper into Solana development, youโll also want to get familiar with Solana Labsโ native programs and Solana Program Library (SPL).
Nonetheless, a reliable Solana testnet faucet will provide you with testnet SOL to test your dapps and smart contracts on the Solana devnet:
How to Get Started with Solana Blockchain App Development โ Summary
We covered quite a distance in todayโs article. In the first half of this Solana blockchain app development guide, you had a chance to follow our tutorial and use Python to create an example Solana backend dapp. As for the second part of todayโs article, we ensured you know what Solana is and what Solana blockchain development entails. You also learned that Rust is the leading programming language for creating Solana smart contracts. Finally, we covered the best Solana blockchain development services, resources, and tools. As such, you are all set to start BUIDLing killer Solana dapps!
If you have your own ideas and the required skills, use the information obtained herein and join the Web3 revolution. However, if you need more practice or some other ideas, make sure to explore our Solana tutorials, which await you in the Moralis docs, on our blockchain development videos, and our crypto blog. These are also the outlets for exploring Web3 development on other leading blockchains and learning about other practical tools. Great examples are our gwei to ETH โโcalculator, Goerli faucet, Sepolia testnet faucet, and list of Web3 libraries. If youโre not fixated on Solana, you can even use Notify API alternatives to listen to blockchain wallet and smart contract addresses. Or, make sure to check out our guide on how to create your own ERC-20 token. These are just some of the countless options that Moralis provides.
Itโs also worth pointing out that blockchain offers many great job opportunities, and becoming blockchain-certified can help you land your dream position in crypto. If that interests you, make sure to consider enrolling in Moralis Academy! We recommend starting with blockchain and Bitcoin fundamentals.
Read More: moralis.io