Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Api/IPFSApi

IPFS API Reference

// Set your API Keys 👇 here
$sdk = new \Tatum\Sdk();

// MainNet API Call
$sdk->mainnet()->api()->iPFS();

// TestNet API Call
$sdk->testnet()->api()->iPFS();

Methods

Method Description
getIPFSData() Get file from IPFS
storeIPFS() Store data to IPFS

getIPFSData()

Example

#️⃣ Execute command in terminal

✨ php -f getIPFSData.php

Request

GET /v3/ipfs/{id}

Type signature

(new \Tatum\Sdk())->{mainnet/testnet}()->api()->iPFS()->getIPFSData(
    string $id
): \SplFileObject

Parameters

Name Type Description Notes
$id string IPFS CID of the file  

Return type

\SplFileObject

Description

Get file from IPFS

1 credit per API call.

Gets data from the IPFS.

Back to top


storeIPFS()

Example

#️⃣ Execute command in terminal

✨ php -f storeIPFS.php

Request

POST /v3/ipfs

Type signature

(new \Tatum\Sdk())->{mainnet/testnet}()->api()->iPFS()->storeIPFS(
    [ \SplFileObject $file ]
): \Tatum\Model\StoreIPFS200Response

Parameters

Name Type Description Notes
$file \SplFileObject \SplFileObject Your file to store [optional]

Return type

\Tatum\Model\StoreIPFS200Response

Description

Store data to IPFS

2 credits per API call. Only files up to 50MB are available for storing.

Stores file on the IPFS. We are leveraging nft.storage from Protocol Labs for free storage on the IPFS.

Back to top