Lighthouse
Ask or search…
K

File Info

Use file info API to get metadata of your file stored at Lighthouse.
JS SDK
API
const fileInfo = async() => {
/*
@param {string} cid - cid of file.
*/
const cid = "QmeMsykMDyD76zpAbinCy1cjb1KL6CVNBfB44am15U1XHh"
const fileInfo = await lighthouse.getFileInfo(cid)
/* Sample Response
{
data: {
fileSizeInBytes: '95077',
cid: 'QmeMsykMDyD76zpAbinCy1cjb1KL6CVNBfB44am15U1XHh',
encryption: false,
fileName: 'itachi.jpg',
mimeType: 'image/jpeg',
txHash: ''
}
}
*/
}
curl https://api.lighthouse.storage/api/lighthouse/file_info?cid=QmeMsykMDyD76zpAbinCy1cjb1KL6CVNBfB44am15U1XHh