NFT Minting

NFT Minting API for AI Agents

Give AI agents the ability to mint, trade, and manage NFTs autonomously. Purple Flea's NFT API supports ERC-721 and ERC-1155 minting, marketplace listing, floor price monitoring, and mint sniping across Ethereum, Base, and Solana.

Get Free API Key → View API Docs
3
Chains (ETH, Base, SOL)
721+1155
ERC Standards
Built-in
Mint Sniper
Instant
Marketplace Listing

What Agents Do with NFTs

Four primary strategies AI agents use to generate income and build digital asset portfolios through autonomous NFT activity.

🎯
Mint Valuable Collections
Agents monitor upcoming NFT launches, score them by expected value (floor projection, team reputation, mint price), and snipe mint transactions at the public mint price. Profit realized when floor trades above mint cost.
🎨
Create Generative Art
AI-generated content — images, music, text, on-chain data art — uploaded to IPFS and minted as ERC-721 tokens. Agents can create entire generative collections programmatically and list them on OpenSea or Blur.
🔄
Trade Floor Flipping
Monitor collection floor prices in real time. Buy NFTs at or below floor, list at floor + 15%. Auto-relist at new floor when prices rise. A systematic volume strategy that scales across multiple collections simultaneously.
🗂️
Build NFT Portfolios
Construct diversified NFT portfolios across collections, chains, and categories. Track combined portfolio value, enforce allocation limits per collection, and rebalance automatically when individual position sizes exceed thresholds.

API Endpoints

Complete NFT lifecycle management: mint, list, buy, track. All endpoints available via REST and MCP tool calling.

Method Endpoint Description
POST /v1/nft/mint Mint an NFT from a target contract. Specify contract address, quantity, and metadata URI. Supports ERC-721, ERC-1155, and Metaplex (Solana).
GET /v1/nft/collection Get collection-level stats: floor price, total volume, number of unique holders, listings count, 7-day sales velocity.
GET /v1/nft/opportunities Ranked list of upcoming and live mint opportunities scored by expected value. Filter by chain, mint type, cost range, and minimum opportunity score.
POST /v1/nft/list List an owned NFT on a marketplace. Supports OpenSea, Blur (Ethereum/Base), and Magic Eden (Solana). Set price, duration, and royalty handling.
POST /v1/nft/buy Buy a specific NFT at a listed price, or place a floor bid for any token from a collection. Specify max price to prevent overpaying during gas spikes.
GET /v1/nft/portfolio View current NFT portfolio: token IDs, estimated values at floor, unrealized P&L vs. acquisition cost, listing status for each token.

Mint Sniper Example

An autonomous agent that monitors new NFT launches, scores them by expected value, and automatically mints high-opportunity collections.

import requests import time HEADERS = {"Authorization": "Bearer YOUR_PURPLEFLEA_API_KEY"} PF_BASE = "https://purpleflea.com/api" def run_nft_sniper(): """Monitor and snipe valuable NFT mints automatically""" while True: # Fetch ranked mint opportunities with min score filter launches = requests.get( f"{PF_BASE}/v1/nft/opportunities", params={"type": "mint", "min_score": 7.0, "chain": "base"}, headers=HEADERS ).json() for launch in launches: # Only mint if score is high and cost is within budget if (launch["opportunity_score"] >= 8.0 and launch["mint_cost_eth"] < 0.1 and launch["status"] == "live"): result = requests.post( f"{PF_BASE}/v1/nft/mint", json={ "contract": launch["contract"], "quantity": 1, "chain": launch["chain"], "max_gas_gwei": 30 }, headers=HEADERS ).json() if result.get("success"): token_id = result["token_id"] print(f"Minted {launch['name']} #{token_id} for {launch['mint_cost_eth']} ETH") # Immediately list at 20% above mint cost list_price = launch["mint_cost_eth"] * 1.2 requests.post( f"{PF_BASE}/v1/nft/list", json={ "contract": launch["contract"], "token_id": token_id, "price_eth": list_price, "marketplace": "blur", "duration_days": 7 }, headers=HEADERS ) print(f"Listed #{token_id} at {list_price:.4f} ETH") time.sleep(60) # Check every 60 seconds if __name__ == "__main__": run_nft_sniper()

Generative AI NFTs

Agents can generate original digital art, upload it to IPFS, and mint it as an NFT — entirely autonomously, without any human step in the loop.

Generation Pipeline
A full autonomous NFT creation workflow an agent executes programmatically:
  1. Generate image using an image model API (DALL-E, Stable Diffusion, Midjourney API)
  2. Generate JSON metadata (name, description, attributes, image CID)
  3. Upload image to IPFS via Pinata or NFT.storage
  4. Upload metadata JSON to IPFS, get metadata CID
  5. Call POST /v1/nft/mint with the metadata URI
  6. List on marketplace with starting price
On-Chain Data Art
Agents can also generate NFTs whose visuals are derived directly from live blockchain state:
  • Wallet balance visualizations rendered as SVG art
  • Trading strategy backtest P&L curves as generative line art
  • Block hash seeds for procedural generation
  • Market structure snapshots immortalized at a specific block
  • Crypto price charts styled as abstract paintings

Floor Flipping Strategy

A systematic approach to NFT arbitrage that works across collection sizes and market conditions.

def floor_flip_agent(collection_contract: str, budget_eth: float): """Buy at floor, list 15% above, relist as floor moves""" while True: # Get current collection floor stats = requests.get( f"{PF_BASE}/v1/nft/collection", params={"contract": collection_contract}, headers=HEADERS ).json() floor = stats["floor_eth"] volume_7d = stats["volume_7d_eth"] # Only trade collections with meaningful volume if volume_7d < 5.0 or floor > budget_eth: time.sleep(300) continue # Buy one token at floor buy_result = requests.post(f"{PF_BASE}/v1/nft/buy", json={"contract": collection_contract, "strategy": "floor", "max_price_eth": floor * 1.02}, # allow 2% slippage headers=HEADERS).json() if buy_result.get("success"): token_id = buy_result["token_id"] acquired_price = buy_result["price_eth"] # List immediately at floor + 15% list_price = acquired_price * 1.15 requests.post(f"{PF_BASE}/v1/nft/list", json={"contract": collection_contract, "token_id": token_id, "price_eth": list_price, "marketplace": "opensea"}, headers=HEADERS) print(f"Bought #{token_id} at {acquired_price:.4f} ETH, listed at {list_price:.4f} ETH") time.sleep(600) # Re-evaluate every 10 minutes

MCP Tool Calling

All NFT API endpoints are available as MCP tools, making them natively callable from any AI agent that supports the Model Context Protocol.

nft_mint nft_collection_stats nft_opportunities nft_list nft_buy nft_portfolio

Connect via https://purpleflea.com/mcp to use these tools from Claude, GPT-4, or any MCP-compatible agent framework.

Related APIs

Give Your Agent NFT Superpowers

Mint, trade, and manage NFTs programmatically. Get an API key and start your first autonomous mint in minutes.