End-to-end Example
Programmatically minting an Ethereum ERC1155 NFT
1. Get your API keys

2. Deploy a contract



3. Upload NFT Data


4. Mint with Code
Last updated
Programmatically minting an Ethereum ERC1155 NFT






Last updated
curl -X POST https://api.3mint.io/api/v1/mint
-H "Content-Type: application/json"
-H "X-API-KEY: [YOUR_API_KEY]"
-d '{"to": ["[WALLET_OF_USER]"],
"chain": "ethereum",
"network": "mainnet",
"type":"erc1155",
"contractAddress": "[CONTRACT_ADDRESS]",
"quantity": 1
}'import axios from 'axios';
// replace with your 3mint api key
const apiKey = 'demo';
const url = 'https://api.3mint.io/api/v1/mint';
// Include conditions to verify
const to = '[WALLET_OF_USER]'
const contractAddress = '[PROJECT_CONTRACT_ADDRESS]'
var requestOptions = {
method: 'POST',
url: `${url}`,
headers: {
'Content-Type': 'application/json',
'X-API-KEY': `${apiKey}`
},
data: {
'to': [`${to}`],
'chain': 'ethereum',
'network': 'mainnet',
'type':'erc1155',
'contractAddress': `${contractAddress}`,
'quantity': 1
}
};
axios(config)
.then(response => console.log(response))
.catch(error => console.log(error));import fetch from 'node-fetch';
// replace with your 3mint api key
const apiKey = 'demo';
const fetchURL = 'https://api.3mint.io/api/v1/mint';
// Include conditions to verify
const to = '[WALLET_OF_USER]'
const contractAddress = '[PROJECT_CONTRACT_ADDRESS]'
var requestBody = JSON.stringify({
'to': `${to}`,
'chain': 'ethereum',
'network': 'mainnet',
'type':'erc1155',
'contractAddress': `${contractAddress}`,
'quantity': 1
});
var requestOptions = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-KEY': `${apiKey}`
},
body: requestBody,
};
// Make the request and print the formatted response:
fetch(fetchURL, requestOptions)
.then(response => response.json())
.then(response => console.log(response))
.catch(error => console.log('error', error));