💸Buy SPL Token
Buy SPL token using SolanaAPIs one of the esiest and fastest way of buying SPL tokens
To buy an SPL token, send a POST request with the following parameters: private_key
, mint
, amount
, fee
, and slippage
.
Recommended Practice
We recommend creating a new wallet to interact with our APIs. Below is a guide on the required data for the request:
private_key: Your base58 private key, used to pay for the transaction and fee.
mint: The token mint CA of the token you want to buy.
amount: The amount in SOL you want to use to buy the token (e.g., 0.001 or 1).
fee: The transaction fee (e.g., 0.0005 or 0.001).
Example Node.js Form Code
Here's an example of how to send a POST request to the API endpoint using Node.js:
A successful response from the API will be in JSON format and include the following fields:
A failed transaction response will have 2 fields in JSON format status and txid
If your transactions are failing alot try increasing the fee
Status: Indicates the success of the transaction.
tokens: The amount of SPL tokens received.
txid: The transaction ID for reference.
Contact Information
These APIs are in beta and being tested. Any bug reports and suggestions are highly appreciated. If you need more information, have a suggestion, or want to report an issue, please use the contact details below:
Thank you for using SolanaAPIs!
Last updated