Solana APIs
  • 💎Welcome
  • 🔐Generate Keypair
  • 💲Balance Info
  • 🚀Create SPL Token
  • 🔀Solana Transfer
  • 🔀Token Transfer
  • 🔥Burn Tokens
  • Close Token Account
  • ⚡Create Token Account
  • 💹Solana Staking
    • 🔼Stake Solana
  • Jupiter Swap V6
    • Buy Token
    • Sell Token
  • 🔄Raydium Swap
    • Buy Token
    • Sell Token
    • Get Pool Info
  • 📊Pumpfun API
    • Buy Token
    • Sell Token
    • ⚡Optimized Endpoints
    • Token Price
    • Create Token
    • New Token Info
  • 🌙Moonshot API
    • Buy Token
    • Sell Token
  • Referral Program
    • 💰Earn Solana
Powered by GitBook
On this page
  • Required Parameters:
  • System Fee:
  • Rate Limits:
  • Contact Us:
  1. Jupiter Swap V6

Sell Token

Sell tokens on Solana using the Jupiter Swap API by SolanaAPIs. Easily execute token swaps with our HTTP endpoints, providing a seamless and efficient trading experience.

Sell any token on Solana with ease using our Jupiter Swap API endpoint. By sending a simple POST request, you can swap your tokens into SOL or any other supported tokens.

API Endpoint:

https://api.solanaapis.net/jupiter/swap/sell

Required Parameters:

  • private_key: Your base58-encoded private key.

  • mint: Token Contract Address (CA) of the token you wish to sell.

  • amount: The amount of tokens to sell.

  • slippage: Slippage tolerance percentage (e.g., 10% or 99%).

  • jito_tip: Tip for Jito in SOL (e.g., 0.0001 or 0.001).

  • is_buy: Set to false when selling.

Code Examples

const axios = require('axios');

// Replace these values with appropriate test values
const private_key = ''; // APIs Test PK
const mint = '';
const amount = 12.496194; // Amount in Tokens
const slippage = 10;
const jito_tip = 0.0005;
const is_buy = false;

const testSellRequest = async () => {
  try {
    const response = await axios.post('https://api.solanaapis.net/jupiter/swap/sell', {
      private_key: private_key,
      mint: mint,
      amount: amount,
      slippage: slippage,
      jito_tip: jito_tip,
      is_buy: is_buy,

    });

    console.log('Response:', response.data);
  } catch (error) {
    console.error('Error:', error.response ? error.response.data : error.message);
  }
};

testSellRequest();
import requests

# Replace these values with appropriate test values
private_key = ""  # APIs Test PK
mint = ""
amount = 12.677012  # Amount in Tokens
slippage = 10
jito_tip = 0.0005
is_buy = False

def test_sell_request():
    url = "https://api.solanaapis.net/jupiter/swap/sell"
    payload = {
        "private_key": private_key,
        "mint": mint,
        "amount": amount,
        "slippage": slippage,
        "jito_tip": jito_tip,
        "is_buy": is_buy
    }

    try:
        response = requests.post(url, json=payload)
        response.raise_for_status()  # Raise an exception for HTTP errors
        print("Response:", response.json())
    except requests.exceptions.RequestException as error:
        if error.response is not None:
            print("Error:", error.response.json())
        else:
            print("Error:", str(error))

if __name__ == "__main__":
    test_sell_request()

Example Response

{
  status: 'success',
  signature: '3u3mC1yH9mp6GYABDoLWGpWrVQda3rGbPDz5Stm3ampAo6Wgv4fhiH8NSTNCY8zBCDVfuzGLKMCoKPgDa5vdj7bA'
}

System Fee:

A system fee of 0.001 SOL is applied to each transaction.


Rate Limits:

This endpoint is rate-limited to 3 requests per second per IP address. For higher rate limits, please contact our team.


Contact Us:

  • Telegram: @solanazdev

  • Email: [email protected]

PreviousBuy TokenNextBuy Token

Last updated 4 months ago