# Get NFT Metadata by IPFS url or ARC id

**URL:** https://forum.algorand.co/t/get-nft-metadata-by-ipfs-url-or-arc-id/8122
**Category:** ARCs
**Tags:** asa
**Created:** [October 27, 2022, 7:19pm UTC](https://forum.algorand.co/t/get-nft-metadata-by-ipfs-url-or-arc-id/8122 "2022-10-27T19:19:26Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![OnMyHorizon](https://avatars.discourse-cdn.com/v4/letter/o/71c47a/32.png) [@OnMyHorizon](https://forum.algorand.co/u/OnMyHorizon)
#### Post date: [October 27, 2022, 7:19pm UTC](https://forum.algorand.co/t/get-nft-metadata-by-ipfs-url-or-arc-id/8122/1 "2022-10-27T19:19:26Z")

</div>

How can I go about getting a NFT’s metadata, like image link, from its IPFS url or its ARC id, both of which I have. I want to retrieve this info in javascript, fetch does not work for IPFS addresses. Let me know if anyone knows how to solve this, thanks!

---

<div class="post-metadata">

### Author: ![fabrice](https://avatars.discourse-cdn.com/v4/letter/f/5fc32e/32.png) [@fabrice](https://forum.algorand.co/u/fabrice)
#### Post date: [October 28, 2022, 6:10pm UTC](https://forum.algorand.co/t/get-nft-metadata-by-ipfs-url-or-arc-id/8122/2 "2022-10-28T18:10:04Z")

</div>

You need to use an IPFS gateway.  
See [IPFS Gateway | IPFS Docs](https://docs.ipfs.tech/concepts/ipfs-gateway/#overview)

For example, for this ARC69 NFT: [Algorand](https://algoexplorer.io/asset/358524324)  
the URL of the asset is:  
ipfs://QmeRgH3a5BYXer6X3KwEpFedTFXz8svSpfC84FvRR3MXSd

and you can access it through the gateway, such as:

 ![](https://us1.discourse-cdn.com/flex016/uploads/algorand/original/2X/2/2b6a0fa5b7c3451d6de85f9c39cf7d985fa5a4cd.png)  
Important note: Public gateways need to be trusted by you: [IPFS Gateway | IPFS Docs](https://docs.ipfs.tech/concepts/ipfs-gateway/#limitations-and-potential-workarounds)

---

<div class="post-metadata">

### Author: ![zorev](https://avatars.discourse-cdn.com/v4/letter/z/e0b2c6/32.png) [@zorev](https://forum.algorand.co/u/zorev)
#### Post date: [February 24, 2023, 5:14am UTC](https://forum.algorand.co/t/get-nft-metadata-by-ipfs-url-or-arc-id/8122/3 "2023-02-24T05:14:14Z")

</div>

@fabrice can you elaborate on how you constructed the URL for the asset given the NFT information you linked to in AlgoExplorer please?

---

<div class="post-metadata">

### Author: ![StephaneBarroso](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.algorand.co/stephanebarroso/32/3186_2.png) [@StephaneBarroso](https://forum.algorand.co/u/StephaneBarroso)
#### Post date: [February 24, 2023, 9:52am UTC](https://forum.algorand.co/t/get-nft-metadata-by-ipfs-url-or-arc-id/8122/4 "2023-02-24T09:52:15Z")

</div>

@zorev To download the png file and rename the file mngo.png:

```console
$ curl -G https://ipfs.io/ipfs/QmeRgH3a5BYXer6X3KwEpFedTFXz8svSpfC84FvRR3MXSd --output mngo.png

```

To get the cid hash of the file you downloaded and renamed mngo.png, you need to use [Kubo CLI | IPFS Docs](https://docs.ipfs.tech/reference/kubo/cli/#ipfs-pin-add)

```console
$ ipfs add --cid-version 0 --hash sha2-256 -q -n mngo.png 

```

output will be `QmeRgH3a5BYXer6X3KwEpFedTFXz8svSpfC84FvRR3MXSd`

> `--cid-version 0 --hash sha2-256` are default values for `ipfs add`. I just added them to make it clearer  
> -n is here to display the generated hash without pining the file to your IPFS node.

You can also find more information here: [Pin files | IPFS Docs](https://docs.ipfs.tech/how-to/pin-files/#three-kinds-of-pins)
