getCollectionTokens

:moneybag: Contextualizing getCollectionTokens

  • getCollectionTokens will retrieve information about tokens (NFTs) within a given collection. This information includes their attributes, owner, etc. It takes the following path parameters:

    • chainId - integer.

    • contractAddress - string.

    And the following query parameters:

    • page - integer, 1 by default.

    • limit - integer, 100 by default.

    • query - JSON string.query is used for filtering.


Query example

const Axios = require("axios");

const projectUuId = 'Your Project Id';
const projectKey = 'Your Project Client Or Server Key';
const chainId = 5; // Goerli
const baseUrl = 'https://api-market.particle.network';
const contractAddress = '0x14CC6aF7A7318347419758274049e93DB03236C9';
const url = `${baseUrl}/chains/${chainId}/contractAddress/${contractAddress}/tokens`;

(async () => {
    const response = await axios.get(url, {
        params: {
            projectUuid,
            projectKey,
            page: 1,
            limit: 10,
            query: JSON.stringify({
                filter: {
                    attributes: [
                        {
                            trait_type: "HairColor",
                            value: "Orange blonde",
                        },
                    ],
                },
                sortBy: "rarity_desc",
            }),
        },
    });

    console.log(JSON.stringify(response.data));
})();
Language
Click Try It! to start a request and see the response here!