Pinata

Pinata

Cloud Storage & File Sharing

IPFS Pinning Services API

Visit API

πŸ“š Documentation & Examples

Everything you need to integrate with Pinata

πŸš€ Quick Start Examples

Pinata Javascript Examplejavascript
// Pinata API Example
const response = await fetch('https://docs.pinata.cloud/', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/json'
    }
});

const data = await response.json();
console.log(data);

The IPFS Pinning Services API is a powerful tool that simplifies the process of storing and accessing files on the InterPlanetary File System (IPFS). By leveraging pinning services, users can ensure that their files remain accessible even if the original host goes offline. This API is designed for developers looking to integrate seamless data storage and retrieval into their applications, providing a robust solution for web3 projects, decentralized apps, and NFT platforms. With user-friendly documentation available at Pinata Docs, developers can quickly get started with utilizing IPFS pinning, enabling them to focus on building innovative solutions without worrying about data persistence.

Using the IPFS Pinning Services API offers several advantages that enhance the overall development experience and file management. The benefits include:

  • Reliable storage to ensure your files are always available.
  • Enhanced performance for faster file retrieval.
  • Cost-effective solutions compared to traditional cloud storage.
  • Simplified management of IPFS files with intuitive API calls.
  • Robust security features to protect your data from unauthorized access.

Here’s a simple JavaScript code example demonstrating how to call the IPFS Pinning Services API:

const axios = require('axios');

const pinataApiKey = 'yourPinataApiKey';
const pinataSecretApiKey = 'yourPinataSecretApiKey';

const pinFileToIPFS = async (file) => {
    const url = 'https://api.pinata.cloud/pinning/pinFileToIPFS';
    
    const formData = new FormData();
    formData.append('file', file);

    const options = {
        headers: {
            'Content-Type': 'multipart/form-data',
            pinata_api_key: pinataApiKey,
            pinata_secret_api_key: pinataSecretApiKey,
        },
    };

    try {
        const response = await axios.post(url, formData, options);
        console.log('File pinned successfully:', response.data);
    } catch (error) {
        console.error('Error pinning file:', error);
    }
};

// Example usage:
// const file = document.querySelector('input[type="file"]').files[0];
// pinFileToIPFS(file);

πŸ“Š 30-Day Uptime History

Daily uptime tracking showing online vs offline minutes

May 31Jun 2Jun 4Jun 6Jun 8Jun 10Jun 12Jun 14Jun 16Jun 18Jun 20Jun 22Jun 24Jun 26Jun 2904008001440Minutes
Online
Offline

Related APIs in Cloud Storage & File Sharing