<p>The error &quot;No variant matched&quot; likely means that the metadataOf method didn't find the asset you're querying for, or there might be some issue with how the Lucid library is initialized or called.</p>
<ul>
<li>Make sure Lucid and Blockfrost are properly imported.</li>
<li>Verify your BLOCKFROST_API_KEY is correctly set in your environment.</li>
<li>Confirm that &quot;ASSETNAME_HERE&quot; is actually the correct asset identifier.</li>
<li>Double-check if you're using the correct version of the Lucid library that supports the metadataOf method.</li>
</ul>
<p>If all these are fine, try reaching out to the Lucid library maintainers or community for specific issues with the metadataOf method. You can find them on their Discord channel: <a href="https://discord.com/invite/82MWs63Tdm" rel="nofollow noreferrer">https://discord.com/invite/82MWs63Tdm</a></p>
<p>If nothing works, you might want to look for some different library.</p>

CC BY-SA 4.0
2023-09-16T13:38:48.667Z
Yeah, all those were correct. So, I actually just skipped lucid and directly use blockfrost api commands to query the blockchain.
jycappucino
CC BY-SA 4.0
2023-09-17T14:40:10.283Z
Great to hear that. Please mark question as resolved.
Spawn
CC BY-SA 4.0
2023-09-13T00:12:44.490Z
2023-09-13T00:12:44.490Z
Spawn
<p>I am trying to extract the metadata of any NFT of interest on-chain. According to Lucid documentation, you can use metadataOf(). Here is my code:</p>
<pre><code>const lucid = await Lucid.new(
    new Blockfrost(
      &quot;https://cardano-preprod.blockfrost.io/api/v0&quot;,
      Deno.env.get(&quot;BLOCKFROST_API_KEY&quot;)
    ),
    &quot;Preprod&quot;
  );

const test = await lucid.metadataOf(&quot;ASSETNAME_HERE&quot;);
console.log(test)
</code></pre>
<p>The code throws an error: &quot;&quot;No variant matched.&quot; Meaning that it can't find <code>.metadataOf</code>. Anyone has an idea how to fix this?</p>

<nft><metadata><lucid>
Extracting Metadata of an NFT using Lucid
# Extracting Metadata of an NFT using Lucid

(Asked by: username_0 on 2023-09-09)

I am trying to extract the metadata of any NFT of interest on-chain. According to Lucid documentation, you can use metadataOf(). Here is my code:
const lucid = await Lucid.new(
    new Blockfrost(
      "https://cardano-preprod.blockfrost.io/api/v0",
      Deno.env.get("BLOCKFROST_API_KEY")
    ),
    "Preprod"
  );

const test = await lucid.metadataOf("ASSETNAME_HERE");
console.log(test)

The code throws an error: ""No variant matched." Meaning that it can't find .metadataOf. Anyone has an idea how to fix this?

**Tags:** nft, metadata, lucid

---

## 1 answers

### Answer by username_1 on 2023-09-13. Score: 1

The error "No variant matched" likely means that the metadataOf method didn't find the asset you're querying for, or there might be some issue with how the Lucid library is initialized or called.

* Make sure Lucid and Blockfrost are properly imported.
* Verify your BLOCKFROST\_API\_KEY is correctly set in your environment.
* Confirm that "ASSETNAME\_HERE" is actually the correct asset identifier.
* Double-check if you're using the correct version of the Lucid library that supports the metadataOf method.

If all these are fine, try reaching out to the Lucid library maintainers or community for specific issues with the metadataOf method. You can find them on their Discord channel: <https://discord.com/invite/82MWs63Tdm>

If nothing works, you might want to look for some different library.

> **Comments:**
> **username_0**: Yeah, all those were correct. So, I actually just skipped lucid and directly use blockfrost api commands to query the blockchain.  
> **username_1**: Great to hear that. Please mark question as resolved.  

---

