To fetch the token metadata about a Pump token such as name, ticker, image etc.

Send a GET request to:

https://pumpapi.fun/api/get_metadata/9QUYvUGiqCALxrMCyJrVYXtJSpt4BYzPRv5ZRjsdqzkh

import requests



def get_pump_token_info(token_id):

  url = f"https://pumpapi.fun/api/get_metadata/{token_id}"

  response = requests.get(url)



  if response.status_code == 200:

    data = response.json()

    return {

      "name": data.get("name"),

      "ticker": data.get("ticker"),

      "image": data.get("image"),

      # Add other fields as needed based on the API response

    }

  else:

    print(f"Error retrieving data: {response.status_code}")

    return None



# Example usage

token_id = "9QUYvUGiqCALxrMCyJrVYXtJSpt4BYzPRv5ZRjsdqzkh"

info = get_pump_token_info(token_id)



if info:

  print(f"Name: {info['name']}")

  print(f"Ticker: {info['ticker']}")

  print(f"Image: {info['image']}")

else:

  print("Failed to retrieve information.")


Below shows the response from the API Endpoint:

Response
{

  "success": true,

  "message": "Tokens info",

  "result": {

    "name": "BARRON",

    "symbol": "BARRON",

    "description": "$Barron is being coronation!",

    "image": "https://cf-ipfs.com/ipfs/QmNLoZLoo47z4QcBKWPXYJEL7LX38Fu6EcqH5f2P8cAURv",

    "decimals": 6,

    "address": "9QUYvUGiqCALxrMCyJrVYXtJSpt4BYzPRv5ZRjsdqzkh",

    "mint_authority": "",

    "freeze_authority": "",

    "current_supply": 965838274.841946,

    "extensions": []

  }

}

Error Codes

  • 400 Bad Request: Invalid request parameters or missing required fields.
  • 401 Unauthorized: Authentication failed.
  • 404 Not Found: The requested resource (endpoint) is not found.
  • 429 Too Many Requests: Rate limit exceeded.
  • 500 Internal Server Error: Unexpected server-side error.

API Codes

  • 200 OK: The request was successful.