SolPump API
  • Welcome
  • Getting Started
    • Quickstart
    • API Key
  • Pumpfun
    • Buy/Sell
    • Balance
    • Price
    • Social Analyze | waiting
    • Bundle Analyze | waiting
    • Rug Check | waiting
    • Creator Analyze | waiting
  • Real Time Data
    • Monitor New Token | waiting
    • Monitor Account Trading | waiting
  • Help
    • Support
    • Fee
Powered by GitBook
On this page
  • Endpoint
  • Code Examples
  1. Getting Started

Quickstart

Endpoint

Endpoint: https://solpump.api/pumpfun/buy

This endpoint allows you to buy tokens by specifying the buyer’s wallet key, token mint, and the purchase amount in SOL.

Code Examples

JavaScript (using Axios)

const axios = require('axios');

const url = 'https://api.solpumps.fun/pumpfun/buy';
const params = {
  buyerKey: '<your_buyer_key>',
  mint: 'xxxx',
  buyAmountSol: 0.05,
};
const headers = {
  'x-api-key': '<your_api_key>',
};

axios.get(url, { params, headers })
  .then(response => console.log('Purchase Successful:', response.data))
  .catch(error => console.error('Error:', error));

TypeScript (using Axios)

import axios from 'axios';

const url = 'https://api.solpumps.fun/pumpfun/buy';
const params = {
  buyerKey: '<your_buyer_key>',
  mint: 'xxx',
  buyAmountSol: 0.05,
};
const headers = {
  'x-api-key': '<your_api_key>',
};

axios.get(url, { params, headers })
  .then(response => {
    console.log('Purchase Successful:', response.data);
  })
  .catch(error => {
    console.error('Error:', error);
  });

Python (using Requests)

import requests

url = 'https://api.solpumps.fun/pumpfun/buy'
params = {
    'buyerKey': '<your_buyer_key>',
    'mint': 'ERtYWpNiS2c7Hm3sGHsuJupRNZuEFdhCht3Tj5wpump',
    'buyAmountSol': 0.05
}
headers = {
    'x-api-key': '<your_api_key>'
}

response = requests.get(url, headers=headers, params=params)

if response.status_code == 200:
    print('Purchase Successful:', response.json())
else:
    print('Error:', response.text)
PreviousWelcomeNextAPI Key

Last updated 7 months ago