Collections

Collections

Get list of collections

The list of collections returned can be filtered by passing in parameters to this function.

  • Typescript Core SDK

📚SDK REFERENCE

  • listCollections

Request

Get a list of collections with "NFT" in the collection name or description:

const getListCollections = async (keyword: string) => {
  const response = await client.listCollections({
    keyword,
  });

  return response.result;
};

getListCollections('NFT')
  .then((result) => {
    console.log(result);
  })
  .catch((e) => {
    console.log(e);
  });

Example response

{
  result: [
     {
      address: '0x61e506cec264d5b2705f10e5a934dc5313a56a6e', // Contract address of the collection
      name: 'The ARK NFTs',
      description: 'Find all the NFTs Created on the ARK Marketplace',
      icon_url: 'https://cloudflare-ipfs.com/ipfs/bafkreiadl5kmdwy4tum4tgny4avxedlif33x2awux35c75j4exnz5s7xjm',
      collection_image_url: '',
      project_id: 92,
      project_owner_address: '0x59bb6d1b896a9a139380bf2b8d828819f0cf1409',
      metadata_api_url: 'https://api.thearknft.io/v1/nft',
      created_at: '2022-09-28T12:01:20.479636Z',
      updated_at: '2022-09-28T13:35:07.59868Z'
    },
    // Other collections returned
    ...
  ],
  cursor: "eyJuYW1lIjoiSnVqdSBNaW50cyIsImFkZHJlc3MiOiIweDIzZGIwZTcyYmQ3NzM4ZGEwZDBhZmU3YmNjYjQxMDlmNWYwNWVkY2YiLCJwcm9qZWN0X2lkIjoyNCwiY3JlYXRlZF9hdCI6IjIwMjItMDktMjJUMjM6MTI6NTcuNjY0NDU2WiIsInVwZGF0ZWRfYXQiOiIyMDIyLTA5LTIyVDIzOjEyOjU3LjY2NDQ1NloifQ",
  // Remaining results
  remaining: 1
}
  • Kotlin (JVM) Core SDK

📚SDK REFERENCE

  • listCollections

Request

Get a list of collections ordered by name in ascending order:

val response = CollectionsApi().listCollections(
    pageSize = 20,
    orderBy = "name",
    direction = "asc"
)
  • Swift Core SDK

📚SDK REFERENCE

  • listCollections

Request

Get a list of collections ordered by name in ascending order:

let collections = try await CollectionsAPI.listCollections(
    pageSize: 20,
    orderBy: .name,
    direction: "asc"
)
  • Golang Core SDK

📚SDK REFERENCE

  • ListCollections

  • C# Core SDK

📚SDK REFERENCE

  • ListCollections

Get details about a collection

  • Typescript Core SDK

📚SDK REFERENCE

  • getCollection

Request

Get details of a collection at a given contract address:

const getCollection = async (address: string) => {
  const response = await client.getCollection({
    address,
  });

  return response;
};

getCollection('0x61e506cec264d5b2705f10e5a934dc5313a56a6e')
  .then((result) => {
    console.log(result);
  })
  .catch((e) => {
    console.log(e);
  });

Example response

{
  address: '0x61e506cec264d5b2705f10e5a934dc5313a56a6e', // Contract address of the collection
  name: 'The ARK NFTs',
  description: 'Find all the NFTs Created on the ARK Marketplace',
  icon_url: 'https://cloudflare-ipfs.com/ipfs/bafkreiadl5kmdwy4tum4tgny4avxedlif33x2awux35c75j4exnz5s7xjm',
  collection_image_url: '',
  project_id: 92,
  project_owner_address: '0x59bb6d1b896a9a139380bf2b8d828819f0cf1409',
  metadata_api_url: 'https://api.thearknft.io/v1/nft',
  created_at: '2022-09-28T12:01:20.479636Z',
  updated_at: '2022-09-28T13:35:07.59868Z'
}

  • Kotlin (JVM) Core SDK

📚SDK REFERENCE

  • getCollection

  • Swift Core SDK

📚SDK REFERENCE

  • getCollection

  • Golang Core SDK

📚SDK REFERENCE

  • GetCollection

See GetCollection example in our SDK repo.

  • C# Core SDK

📚SDK REFERENCE

  • GetCollection

Last updated