post https://rest-api.hellomoon.io/v0/nft/collection/name
The Collection Name to Collection Id Mapping endpoint maps a unique Hello Moon helloMoonCollectionId to an unique NFT Collection Name.
We offer 3 search strategies:
- \levenshtein: this searches based on the Levenshtein distance, which is how close a collection name matches your passed search string.
- \phonetic: this searches based on how your search string sounds, returning results that match.
- \default: this searches your search string pattern, and then sorts by the current 1D volume of the results.
Note: All search strings are normalized to lowercase
Note: only collection names will be fuzzy searched; IDs will NOT.
Examples
Get the name of a collection by HelloMoon collection Id
const axios = require("axios");
const url = "https://rest-api.hellomoon.io/v0/nft/collection/name";
async function getCollectionName() {
const { data } = await axios.post(
url,
{
"helloMoonCollectionId": "040de757c0d2b75dcee999ddd47689c4"
},
{
headers: {
Accept: "application/json",
"Content-Type": "application/json",
Authorization: "Bearer <your_token>",
},
}
);
console.log(data);
}
Search for HelloMoon collection IDs by name
const axios = require("axios");
const url = "https://rest-api.hellomoon.io/v0/nft/collection/name";
async function getCollections() {
const { data } = await axios.post(
url,
{
"collectionName": "DeGods"
},
{
headers: {
Accept: "application/json",
"Content-Type": "application/json",
Authorization: "Bearer <your_token>",
},
}
);
console.log(data);
}