Finding Collection ID for Flow NFT Project
I’m working with an NFT project on Flow blockchain and need help locating the collection identifier. I want to fetch details about a specific NFT collection but I’m stuck on finding the correct ID parameter.
I’m looking at the Flow HTTP API documentation for collections endpoint, but I can’t figure out where to get the collection ID that goes in the URL path. The NFT contract I’m working with is called TopShotCards and I can see it deployed on the blockchain explorer.
The API endpoint expects a collection ID parameter, but I only have the contract address and name. Is there a way to derive the collection ID from the contract information? Or do I need to call a different endpoint first to get this identifier?
Any guidance on the proper workflow to get NFT collection data would be really helpful. Thanks!
Oh nice, I’ve been messing with Flow NFTs too! Quick question - you using mainnet or testnet for TopShotCards? Collection IDs act weird sometimes depending on which environment you’re on.
Have you checked the contract metadata on FlowScan? When I’m debugging this stuff, I usually poke around there first before hitting APIs. You might catch something that clicks.
One thing that tripped me up early on - is the collection ID case-sensitive? Also, what are you using - an SDK or just raw HTTP calls?
Asking because I’m building something similar and hitting my own walls with Flow. Let me know how your project goes!
I encountered a similar issue while working with Flow NFTs. The collection identifier is not something you derive; it is formatted based on the contract address and the name. You should follow this format: A.{contract_address}.{contract_name}. For instance, if your contract address for TopShotCards is 0877631d4d84b4c5, the corresponding collection ID would be A.0877631d4d84b4c5.TopShotCards. Always verify this format on the Flow blockchain explorer, where you can confirm that the identifier appears as required. This formatted ID can be placed directly into the API endpoint URL without the need for additional calls.