getAllTokenIds()

hello,

Looking at the documentation, I can understand that getAllTokenIds check all the tokens contained in one contract and returns the info.
According the documentation, this is the output:

[
  {
    token_address: "0x7de3085b3190b3a787822ee16f23be010f5f8686",
    token_id: "728",
    amount: "1",
    contract_type: "ERC721",
    name: "Baby Ape Mutant Club",
    symbol: "BAMC",
    token_uri:
      "https://gateway.moralisipfs.com/ipfs/QmajSqgxY3cWBgBeRm38vasJAcTit1kp5EwqVHxszJYgUC/728.json",
    metadata:
      '{\n  "name": "Baby Mutant #728",\n  "description": "",\n  "image": "ipfs://QmPUDVLP9W1pWpCTpGvpPbMu4nVpCuu2A7M6tQovDpVDoD/728.png",\n  "dna": "172bef0b78106072e4eacb26db57ae70fb17b37b",\n  "edition": 728,\n  "date": 1645023568505,\n  "artist": "Skurvydogg",\n  "attributes": [\n    {\n      "trait_type": "BackGrounds",\n      "value": "Putrid_Purple"\n    },\n    {\n      "trait_type": "Furs",\n      "value": "Red_rum"\n    },\n    {\n      "trait_type": "Eyes",\n      "value": "Robot_M1"\n    },\n    {\n      "trait_type": "Hats",\n      "value": "Bunny_Ears_M2"\n    },\n    {\n      "trait_type": "Mouths",\n      "value": "Xenomorf_M1"\n    }\n  ]\n}',
    synced_at: "2022-03-05T02:29:18.441Z",
  },
];

How can I select only ONE token from the list of returned tokens?
Is there a function that allows me to select only one token?

Thanks

Is it a specific token you want (based on id, etc.) or just only one in the result?

I want one result based on Id

You can use the “getTokenIdMetadata” endpoint by passing in the same contract address and the token_id.

Web3API.token - Moralis

If you just want to target that particular token object in the same set of results, assuming you’re using JS, you can use the .find method.