# NFTport API 使用手册 **Published by:** [XiaoShin](https://paragraph.com/@xiaoshin/) **Published on:** 2022-04-18 **URL:** https://paragraph.com/@xiaoshin/nftport-api ## Content 写了个测试脚本,利用nftport API ,使用脚本mint NFT,完成后可在opensea等平台查看。 在 官网 获取api_key。avatarMint NFT1、Deploy your own contract with Deploy a contract for NFT productsSendcurl --request POST \ --url https://api.nftport.xyz/v0/contracts \ --header 'Authorization: ...' \ --header 'Content-Type: application/json' \ --data '{ "chain": "polygon", "name": "...", "symbol": "C", "owner_address": "...", "metadata_updatable": false, "type": "erc721" }' Response{ "response": "OK", "chain": "polygon", "transaction_hash": "...", "transaction_external_url": "https://polygonscan.com/tx/...", "owner_address": "...", "name": "...", "symbol": "C" } 2 、Get the Contract_address After a real long timeSendcurl --request GET \ --url 'https://api.nftport.xyz/v0/contracts/...?chain=polygon' \ --header 'Authorization: ...' \ --header 'Content-Type: application/json' Response{ "response": "OK", "chain": "polygon", "contract_address": "...", "transaction_hash": "...", "error": null } 3、Upload your file to IPFS with Upload a file to IPFSSendcurl --request POST \ --url https://api.nftport.xyz/v0/files \ --header 'Authorization: ...' \ --header 'Content-Type: multipart/form-data' \ --header 'content-type: multipart/form-data; boundary=---011000010111000001101001' \ --form file=picture_path Response{ "response": "OK", "ipfs_url": "https://ipfs.io/ipfs/...", "file_name": "...", "content_type": "image/png", "file_size": 64856, "file_size_mb": 0.0619, "error": null } 4、Create and upload your NFT metadata file with Upload metadata to IPFSSendcurl --request POST \ --url https://api.nftport.xyz/v0/metadata \ --header 'Authorization: ...' \ --header 'Content-Type: application/json' \ --data '{ "name": "...", "description": "...", "file_url": "https://ipfs.io/ipfs/..." }' Response{ "response": "OK", "metadata_uri": "ipfs://...", "name": "...", "description": "...", "file_url": "https://ipfs.io/ipfs/...", "external_url": null, "animation_url": null, "custom_fields": null, "attributes": null, "error": null } 5、Mint NFTs to your contract with Customizable mintingSendcurl --request POST \ --url https://api.nftport.xyz/v0/mints/customizable \ --header 'Authorization: ...' \ --header 'Content-Type: application/json' \ --data '{ "chain": "polygon", "contract_address": "...", "metadata_uri": "ipfs://...", "mint_to_address": "..." }' Response{ "response": "OK", "chain": "polygon", "contract_address": "...", "transaction_hash": "...", "error": null } Python code on Github: https://github.com/WoKough/nftport-api-demo ## Publication Information - [XiaoShin](https://paragraph.com/@xiaoshin/): Publication homepage - [All Posts](https://paragraph.com/@xiaoshin/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@xiaoshin): Subscribe to updates