NFT Collections

Create a new NFT Collection

POST https://api.nfty.dev/v1/collections

This endpoint creates a new Collection of NFTs. NFTYverse will upload and host all the metadata and optionally the images and media as well. If you prefer to host the metadata and media yourself, please see the "Self-Hosted" version below. This will deploy a new ERC721 or ERC1155 smart contract for the NFTs and can be thought of as a logical grouping for all your NFTs. Most apps will create a single Collection such as "My App NFTs", but you could also create multiple different collections, such as "App Badges", "App Coins", "App Cards", etc.

Headers

Request Body

{"request_id":"53e5079d941f14db8a24a8e8647e93071fdff93de9e424796010549fd3e573aa"}

Example Request:

curl --request POST \
     --url https://api.nfty.dev/v1/collections \
     --header 'Content-Type: application/json' \
     --header 'authorization: Bearer c4Vftx4kGiFYqpjM/3p4o5pgkmuthLWUNpXNlrig8EjlnSTeVgde4kEBdI1Uc1RFqWJBBRxkOmZ/QcHQXdQNjQ==' \
     --data '{
       "name": "Token Name",
  	   "symbol": "TKN",
       "description": "This is a description of my NFT collection.",
       "image": "https://domain.com/image.png",
       "external_link": "https://mywebsite.com",
       "mint_supply_count": 1000,
  	   "type": "ERC721"
       }'

Example Response:

{"request_id":"96c71219efed57b38068fc3fe3fcdbb9e4f41041f5d1fe8ea8b830dd3bd19586"}

Create a new NFT Collection (Self-Hosted)

POST https://api.nfty.dev/v1/collections

This endpoint creates a new "Self-Hosted" Collection of NFTs. "Self-Hosted" means that you will be hosting the metadata and images yourself and will pass in the URIs (base_uri and collection_uri) to the API. If you prefer that we host the metadata for you, please see above. This will deploy a new ERC721 or ERC1155 smart contract for the NFTs and can be thought of as a logical grouping for all your NFTs. Most apps will create a single Collection such as "My App NFTs", but you could also create multiple different collections, such as "App Badges", "App Coins", "App Cards", etc.

Headers

Request Body

{"request_id":"53e5079d941f14db8a24a8e8647e93071fdff93de9e424796010549fd3e573aa"}

Example Request:

curl --request POST \
     --url https://api.nfty.dev/v1/collections \
     --header 'Content-Type: application/json' \
     --header 'authorization: Bearer c4Vftx4kGiFYqpjM/3p4o5pgkmuthLWUNpXNlrig8EjlnSTeVgde4kEBdI1Uc1RFqWJBBRxkOmZ/QcHQXdQNjQ==' \
     --data '{
       "name": "Token Name",
  	   "symbol": "TKN",
       "base_uri": "https://base.com/",
       "collection_uri": "https://contract.com/721",
  	   "type": "ERC721"
       }'

Example Response:

{"request_id":"96c71219efed57b38068fc3fe3fcdbb9e4f41041f5d1fe8ea8b830dd3bd19586"}

View your NFT Collections

GET https://api.nfty.dev/v1/collections

This endpoint allows you to see all of your successfully created Collections. If you recently created a Collection and it is not listed yet, then the blockchain transaction may still be pending.

Headers

[
  {
    "address":"0xb9bf61b55f66afc64fd7fbf7fa4fea4e2e4c5fdd",
    "name":"ERC721 Token",
    "symbol":"TKN",
    "base_uri":"https://base.com/",
    "collection_uri":"https://contract.com/721",
    "type":"ERC721",
    "timestamp":"2021-08-30T07:34:17.516Z"
  },
  {
    "address":"0xcbec1a2ae881487fa642041cbd1bfe4b690af269",
    "name":"ERC1155 Tokens",
    "symbol":"TKNS",
    "base_uri":"https://base.com/{id}",
    "collection_uri":"https://contract.com/1155",
    "type":"ERC1155",
    "timestamp":"2021-08-30T07:35:26.151Z"
  }
]

Example Request:

curl --request GET \
     --url https://api.nfty.dev/v1/collections \
     --header 'Content-Type: application/json' \
     --header 'authorization: Bearer c4Vftx4kGiFYqpjM/3p4o5pgkmuthLWUNpXNlrig8EjlnSTeVgde4kEBdI1Uc1RFqWJBBRxkOmZ/QcHQXdQNjQ=='

Example Response:

[
  {
    "address":"0xb9bf61b55f66afc64fd7fbf7fa4fea4e2e4c5fdd",
    "name":"ERC721 Token",
    "symbol":"TKN",
    "base_uri":"https://base.com/",
    "collection_uri":"https://contract.com/721",
    "mint_supply_count":1000, 
    "type":"ERC721",
    "timestamp":"2021-08-30T07:34:17.516Z"
  },
  {
    "address":"0xcbec1a2ae881487fa642041cbd1bfe4b690af269",
    "name":"ERC1155 Tokens",
    "symbol":"TKNS",
    "base_uri":"https://base.com/{id}",
    "collection_uri":"https://contract.com/1155",
    "mint_supply_count":0,
    "type":"ERC1155",
    "timestamp":"2021-08-30T07:35:26.151Z"
  }
]

List NFTs in a Collection

GET https://api.nfty.dev/v1/collections/:address

This endpoint returns the NFT items currently in this NFT Collection. The address must be associated with a Collection that you created.

Path Parameters

Query Parameters

Headers

# For ERC721 tokens, there is no "amount"
{
"address":"0xb9bf61b55f66afc64fd7fbf7fa4fea4e2e4c5fdd",
"assets":
 [
  {"token_id":1,"token_url":"https://nfty.com/1","timestamp":"2021-08-30T07:35:26.151Z"},
  {"token_id":2,"token_url":"https://nfty.com/2","timestamp":"2021-08-30T07:35:26.151Z"},
  {"token_id":3,"token_url":"https://nfty.com/3","timestamp":"2021-08-30T07:35:26.151Z"}
 ]
}

# For ERC1155 tokens, "amount" is also included
{
"address":"0xcbec1a2ae881487fa642041cbd1bfe4b690af269",
"assets":
 [
  {"token_id":1,"amount":50,"token_url":"https://base.com/{id}","timestamp":"2021-08-30T07:43:13.602Z"},
  {"token_id":1,"amount":50,"token_url":"https://base.com/{id}","timestamp":"2021-08-30T07:45:04.029Z"},
  {"token_id":2,"amount":50,"token_url":"https://base.com/{id}","timestamp":"2021-08-30T07:46:04.029Z"}
 ]
}

Example Request:

curl --request GET \
     --url https://api.nfty.dev/v1/collections/0xb9bf61b55f66afc64fd7fbf7fa4fea4e2e4c5fdd \
     --header 'Content-Type: application/json' \
     --header 'Authorization: Bearer c4Vftx4kGiFYqpjM/3p4o5pgkmuthLWUNpXNlrig8EjlnSTeVgde4kEBdI1Uc1RFqWJBBRxkOmZ/QcHQXdQNjQ=='

Example Response:

{
"address":"0xb9bf61b55f66afc64fd7fbf7fa4fea4e2e4c5fdd",
"assets":
 [
  {"token_id":1,"token_url":"https://nfty.com/1","timestamp":"2021-08-30T07:35:26.151Z"},
  {"token_id":2,"token_url":"https://nfty.com/2","timestamp":"2021-08-30T07:35:26.151Z"},
  {"token_id":3,"token_url":"https://nfty.com/3","timestamp":"2021-08-30T07:35:26.151Z"}
 ]
}

Last updated