Skip to content

API Usage

With Fileship, you can easily create your own IPFS server endpoint.

Example

This example demonstrates how to get a signed download URL for the file QmVho2gzgp8H3PrV5T5WFxowvqX2Qbx6hP9Ps9DjHCp8vZ using the parameters cid, size and download.

js
    const cid = "QmVho2gzgp8H3PrV5T5WFxowvqX2Qbx6hP9Ps9DjHCp8vZ"
    const size = 2            //Resolution: 1024 
    const download = false   //Response.data: Signed URL

    axios.get(`fileship.xyz/${cid}?size=${size}&download=${download}`, {
            headers: {
                "APP_ID": YOUR APP ID,
                "APP_SECRET": YOUR APP SECRET,
            }
        })
        .then(res => {
            let url = res.data.url;
            //Your code here...
        })
        .catch(err => console.log(err.message));

Parameters

NameTypeDefaultValuesDescription
cidstringnull-CIDv0 or CIDv1
sizeint0
0
1
2
Max resolution:
256
512
1024
downloadboolfalsetrue
false
The response data is the signed download URL
The response will redirect to the download URL

Supported Files

Below you can see a list of supported file types, as development progresses the number of supported file types will increase.

Image

Request Mime TypeSupportOutput
image/webp✔️.webp
image/png✔️.webp
image/apng✔️.webp
image/jpg✔️.webp
image/tiff✔️.webp
image/avif✔️.webp
image/bmp✔️.webp
image/svg+xml✔️.svg
image/gif✔️.mp4

WARNING

Note that animated images will be encoded to video/mp4.

Audio

Request Mime TypeSupportOutput
audio/ogg✔️.ogg
audio/mp3✔️.ogg
audio/wav✔️.ogg
audio/flac✔️.ogg
audio/aac✔️.ogg
audio/midi✔️.midi

Video

Request Mime TypeSupportOutput
video/mp4✔️.mp4
video/avi✔️.mp4
video/webm✔️.mp4