Skip to main content

Pinning CID on IPFS

You can pin content already available on IPFS with Starton using the Content IDentifier (CID).

const axios = require("axios");

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

startonApi.post("/v3/ipfs/pin", {
name: "pin name", // name of the file you would like to pin
cid: "bafybeid7ybbefggfv6y7gkkbyt3tpi647p66mrmcjkujrlbfbtb6mmbklq", // cid of the file you would like to pin
metadata: { your: "additionnal", meta: "data" },
})
.then(res=>console.log(res.data))
.catch(e=>console.log(e))