api-pump.fun
  • General
    • Getting started
  • Reference
    • API Reference
      • Generate API Key
      • Balance
      • Token information
      • Get Quote
      • Bonding Curve
      • King of The Hill
      • Trade tokens
      • Trade tokens [local RPC]
      • Create token
  • Streams
    • Websocket subscription
Powered by GitBook
On this page
  1. Reference
  2. API Reference

Create token

Create new token

Method is used to create new token

Attention! If you want to use the generated one-time wallet to sign transactions, just leave parameter "private" blank

If you want to sign transaction via API using you own private key - fill in the field "private" in base58 format

POST /createToken

Multipart/form-data method is used to create new token

Headers

Name
Value

Content-Type

application/json

x-api-key

The API key for authentication

Parameters

Parameter
Description
Required

file

Image of new token

Yes

name

Name of new token

Yes

symbol

Symbol of new token

Yes

description

Description of new token

Yes

twitter

Twitter of new token

telegram

Telegram of new token

website

Website of new token

amount

Amount of the token for initial buy (optional)

slippage

Allowed slippage percentage (optional)

priorityFee

Priority fee for the transaction

private

Private key (optional)

Body

Response

{
  "signature": "your_transaction_signature"
}
{
  "error": true,
  "message": "apiKey not found"
}

Examples

curl --location 'https://rpc.api-pump.fun/createToken' \
--header 'x-api-key: your_api_key' \
--form 'file=@"/path/to/image/image.jpg"' \
--form 'name="Coin"' \
--form 'symbol="COIN"' \
--form 'description="Coin description"'
package main

import (
  "fmt"
  "bytes"
  "mime/multipart"
  "os"
  "path/filepath"
  "io"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://rpc.api-pump.fun/createToken"
  method := "POST"

  payload := &bytes.Buffer{}
  writer := multipart.NewWriter(payload)
  file, errFile1 := os.Open("/D:/Downloads/origami.jpg")
  defer file.Close()
  part1, errFile1 := writer.CreateFormFile("file",filepath.Base("/path/to/image.jpg"))
  _, errFile1 = io.Copy(part1, file)
  if errFile1 != nil {
    fmt.Println(errFile1)
    return
  }
  _ = writer.WriteField("name", "Coin")
  _ = writer.WriteField("symbol", "COIN")
  _ = writer.WriteField("description", "Coin description")
  err := writer.Close()
  if err != nil {
    fmt.Println(err)
    return
  }


  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("x-api-key", "your_api_key")

  req.Header.Set("Content-Type", writer.FormDataContentType())
  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
let data = new FormData();
data.append('file', fs.createReadStream('/path/to/image.jpg'));
data.append('name', 'Coin');
data.append('symbol', 'COIN');
data.append('description', 'Coin description');

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://rpc.api-pump.fun/createToken',
  headers: { 
    'x-api-key': 'your_api_key', 
    ...data.getHeaders()
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});
import requests

url = "https://rpc.api-pump.fun/createToken"

payload = {'name': 'Coin',
'symbol': 'COIN',
'description': 'Coin description'}
files=[
  ('file',('origami.jpg',open('/path/to/image.jpg','rb'),'image/jpeg'))
]
headers = {
  'x-api-key': 'your_api_key'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
PreviousTrade tokens [local RPC]NextStreams

Last updated 10 months ago