Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

395
Views
How to fetch JSON-file from ipfs and display on a webpage (using 'ipfs-core')
import * as IPFS from 'ipfs-core'

var ipfs = await IPFS.create({ repo: 'ok' + Math.random() })

const metadataMap = new Map()

//content.metadataCid is the ipfs-cid of the metadata.json file stored on ipfs.
var res = await ipfs.cat(content.metadataCid)
//var data = await res.Json()

console.log("** Metadata from Cid **")
console.log(res)

//This just maps the content (content-cid) to its metadata
//sets the metadata for each Content
 metadataMap.set(theCid, res)

 if (metadataMap) {
 console.log('**metadata map**')
 console.log(metadataMap)
 }

The console -

enter image description here

I am hosting those metadata files on pinata as well as on my desktop-ipfs. And you can access it using ipfs cli or gateways. eg_link: ipfs://bafybeibro7fxpk7sk2nfvslumxraol437ug35qz4xx2p7ygjctunb2wi3i/

The link opens in the browser using ipfs-gateway just fine: enter image description here

But when I use ipfs.cat(), the console just shows cat {suspended} (as shown in the image attached)]

I can access the image stored on ipfs using "img" tag without any problem:

enter image description here

In the image above, the images are from ipfs. I also wanna show title and description which is stored in that json file on ipfs

Same issue with ipfs.get() !

How can I access that metadata.json file and parse them. Am I missing any step here?

thanks 🤞

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!