Skip to main content

Uploading JSON Files to IPFS

You can upload content on IPFS. Starton IPFS is a storage and pinning service, where you can host files, folders, and metadata on our IPFS nodes so that they remain available at all times.

const axios = require("axios")

// AUTHENTICATING TO THE API USING YOUR API KEY
const startonApi = axios.create({
baseURL: "https://api.starton.com",
headers: {
"x-api-key": "YOUR_API_KEY",
},
})

startonApi
.post("/v3/ipfs/json", {
name: "json name", // name of your json file on starton.
content: { my: "object" }, // json object.
// optional metadata stored on starton database.
metadata: { your: "additional", meta: "data" },
})
.then((res) => console.log(res.data))
.catch((e) => console.log(e))

JSON FORMATTING

When uploading a file, quotes need to be added around keys and values (except numbers).