Pumpfun API
  • 💊Pumpfun API – Your Unofficial Gateway to Effortless Token Trading
  • Api Endpoints
    • 💵Buy Tokens
    • 💵Sell Tokens
    • 💊Create Token
    • Stream New Tokens
    • 📈Token Price
Powered by GitBook
On this page
  1. Api Endpoints

Create Token

Launch your custom tokens on PumpFun with a single, low-cost POST request through PumpfunApi. Effortlessly include metadata to personalize your tokens for quick and convenient.

PreviousSell TokensNextStream New Tokens

Last updated 3 months ago

PumpFun Token Creation API The PumpFun Token Creation API streamlines the process of crafting tokens on PumpFun. Backed by PumpfunApi’s reliable infrastructure, it allows you to create tokens with minimal overhead in just one request. This solution is perfect for projects seeking an easy-to-implement token deployment method on the Solana blockchain, offering reduced fees and lightning-fast transaction processing.

KEY FEATURES AND BENEFITS

Tokens created using this endpoint always have 'PUMP' in the mint address

  1. Low Fees Enjoy minimal system costs at just 0.05 SOL and a transaction fee of 0.00065 SOL, making it highly cost-effective.

  2. Simple Process Create and launch tokens in a single step using a straightforward POST request.

  3. High Performance Handle up to 60 requests per minute per IP address, allowing you to scale quickly.

  4. Metadata Customization Add or refine attributes such as name, symbol, and other branding details to personalize your tokens.

HOW IT WORKS Send a POST request including mandatory fields like your private key, purchase amount, and any optional metadata you wish to add. The API then processes the transaction on the Solana blockchain, generating your new token on PumpFun and returning real-time status feedback.

STEP-BY-STEP GUIDE

  1. Prepare the Request Collect all necessary parameters, including any metadata for personalization.

  2. Submit the POST Request Direct your formatted data to the provided endpoint.

  3. Receive Response Upon success, you receive a confirmation. In case of errors, a detailed message helps you troubleshoot.

REQUIRED PARAMETERS • private_key: The Base58-encoded private key of your Solana wallet. Keep this secure as it authorizes the transaction. • amount: The SOL amount designated for purchasing the token.

OPTIONAL METADATA PARAMETERS • name: Assign a unique name to your token. • symbol: Set a short symbol (e.g., “PFT”) to represent your token. • Description: Provide a brief or detailed explanation of your token’s purpose. • Twitter: Include a Twitter link if applicable. • telegram: Add a Telegram group URL for community engagement. • website: Enhance trust by adding your official project website URL. • image: Supply a URL or file path to a token logo or representative image.

API ENDPOINT POST Endpoint:

CODE EXAMPLES

const axios = require('axios');
const dotenv = require('dotenv');
const fs = require('fs'); // To read image file
const FormData = require('form-data');

dotenv.config();

// Replace with your test values
const TEST_PRIVATE_KEY = '';
const TEST_AMOUNT = 0.1; // Buy Amount in SOL
const TEST_NAME = 'Pumpfun Api'
const TEST_SYMBOL = 'PFA'
const TEST_DESCRIPTION= 'Pumpfun token creation api by https://docs.pumpfunapi.org/' // This field is optional
const TEST_TWITTER = 'https://docs.pumpfunapi.org/' // This field is optional
const TEST_TELEGRAM = 'https://docs.pumpfunapi.org/' // This field is optional
const TEST_WEBSITE = 'https://docs.pumpfunapi.org/' // This field is optional

const testBuy = async () => {
    try {
        const formData = new FormData();
        formData.append("private_key", TEST_PRIVATE_KEY);
        formData.append("amount", TEST_AMOUNT);
        formData.append("name", TEST_NAME);
        formData.append("symbol", TEST_SYMBOL);
        formData.append("description", TEST_DESCRIPTION);
        formData.append("website", TEST_WEBSITE);
        formData.append("twitter", TEST_TWITTER);
        formData.append("telegram", TEST_TELEGRAM);
        formData.append("image", fs.createReadStream("test.png")); // Image file

        const response = await axios.post('https://api.pumpfunapi.org/pumpfun/create/token', formData, {
            headers: formData.getHeaders(),
        });

        console.log('Response:', response.data);
    } catch (error) {
        if (error.response) {
            console.error('Error response from server:', error.response.data);
        } else {
            console.error('Error making request:', error.message);
        }
    }
};

testBuy();
import requests
import os
from dotenv import load_dotenv

# Load environment variables
load_dotenv()

# Replace with your test values
TEST_PRIVATE_KEY = ''
TEST_AMOUNT = 0.1  # Buy Amount in SOL
TEST_NAME = 'Pumpfun Api'
TEST_SYMBOL = 'PFA'
TEST_DESCRIPTION = 'Pumpfun token creation api by https://docs.pumpfunapi.org/'  # Optional field
TEST_TWITTER = 'https://docs.pumpfunapi.org/'  # Optional field
TEST_TELEGRAM = 'https://docs.pumpfunapi.org/'  # Optional field
TEST_WEBSITE = 'https://docs.pumpfunapi.org/'  # Optional field

def test_buy():
    try:
        # Create form data
        files = {
            "private_key": (None, TEST_PRIVATE_KEY),
            "amount": (None, str(TEST_AMOUNT)),
            "name": (None, TEST_NAME),
            "symbol": (None, TEST_SYMBOL),
            "description": (None, TEST_DESCRIPTION),
            "website": (None, TEST_WEBSITE),
            "twitter": (None, TEST_TWITTER),
            "telegram": (None, TEST_TELEGRAM),
            "image": open("test.png", "rb")  # Image file
        }

        # Send POST request
        response = requests.post('https://api.pumpfunapi.org/pumpfun/create/token', files=files)

        # Print response
        if response.ok:
            print('Response:', response.json())
        else:
            print('Error response from server:', response.json())
    except Exception as e:
        print('Error making request:', str(e))

test_buy()

EXAMPLE RESPONSE

{ status: '', mint: '', txid: '' }

RATE LIMITS The endpoint supports up to 60 requests per minute per IP address, maintaining high performance and stability for all users.

💊
https://api.pumpfunapi.org/pumpfun/create/token