IPFS Gateway
HomeUploadRetrieveFilesDocsLogin/Register
HomeUploadRetrieveFilesDocsLogin/Register

IPFS Gateway

Secure IPFS gateway for decentralized storage workflows.

Quick links

  • Upload
  • Retrieve
  • Files

Resources

  • Documentation
  • Create account
  • Login
Copyright 2026 IPFS Gateway. All rights reserved.
Documentation
Docs
  • Overview
  • Getting Started
  • Authentication
  • API Reference
  • Code Examples
    • cURL
    • Python
    • JavaScript
  • FAQ

Code Examples

Copy-ready code snippets for the most common operations in cURL, Python, and JavaScript.

Register

register.shbash
curl -X POST https://your-domain.com/api/v1/users/register \
  -H "Content-Type: application/json" \
  -d '{"email": "user@example.com", "password": "securePassword123"}'

Upload a file

upload.shbash
curl -X POST https://your-domain.com/api/v1/files/upload \
  -H "X-API-Key: YOUR_API_KEY" \
  -F "file=@/path/to/your/file.pdf"

Retrieve a file

retrieve.shbash
curl https://your-domain.com/api/v1/files/retrieve/bafkreih5... \
  -H "X-API-Key: YOUR_API_KEY" \
  -o downloaded_file.pdf

List files

list.shbash
curl https://your-domain.com/api/v1/files \
  -H "X-API-Key: YOUR_API_KEY"

Delete a file

delete.shbash
curl -X DELETE https://your-domain.com/api/v1/files/bafkreih5... \
  -H "X-API-Key: YOUR_API_KEY"

Register

register.pypython
import requests

url = "https://your-domain.com/api/v1/users/register"
payload = {"email": "user@example.com", "password": "securePassword123"}

response = requests.post(url, json=payload)
data = response.json()
print("API Key:", data["data"]["api_key"])  # save this!

Upload a file

upload.pypython
import requests

url = "https://your-domain.com/api/v1/files/upload"
headers = {"X-API-Key": "YOUR_API_KEY"}

with open("/path/to/file.pdf", "rb") as f:
    response = requests.post(url, headers=headers, files={"file": f})

data = response.json()
cid = data["data"]["cid"]
print("CID:", cid)

Retrieve a file

retrieve.pypython
import requests

cid = "bafkreih5..."
url = f"https://your-domain.com/api/v1/files/retrieve/{cid}"
headers = {"X-API-Key": "YOUR_API_KEY"}

response = requests.get(url, headers=headers)
with open("downloaded_file.pdf", "wb") as f:
    f.write(response.content)

List files

list.pypython
import requests

url = "https://your-domain.com/api/v1/files"
headers = {"X-API-Key": "YOUR_API_KEY"}

response = requests.get(url, headers=headers)
files = response.json()["data"]
for file in files:
    print(file["cid"], file["original_filename"])

Delete a file

delete.pypython
import requests

cid = "bafkreih5..."
url = f"https://your-domain.com/api/v1/files/{cid}"
headers = {"X-API-Key": "YOUR_API_KEY"}

response = requests.delete(url, headers=headers)
print(response.json()["message"])

Register

register.jsjavascript
const response = await fetch("https://your-domain.com/api/v1/users/register", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    email: "user@example.com",
    password: "securePassword123",
  }),
});
const data = await response.json();
const apiKey = data.data.api_key; // save this!
console.log("API Key:", apiKey);

Upload a file

upload.jsjavascript
const file = document.querySelector('input[type="file"]').files[0];
const formData = new FormData();
formData.append("file", file);

const response = await fetch("https://your-domain.com/api/v1/files/upload", {
  method: "POST",
  headers: { "X-API-Key": "YOUR_API_KEY" },
  body: formData,
});

const data = await response.json();
console.log("CID:", data.data.cid);

Retrieve a file

retrieve.jsjavascript
const cid = "bafkreih5...";
const response = await fetch(
  `https://your-domain.com/api/v1/files/retrieve/${cid}`,
  { headers: { "X-API-Key": "YOUR_API_KEY" } },
);

const blob = await response.blob();
const url = URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url;
a.download = "downloaded_file";
a.click();

List files

list.jsjavascript
const response = await fetch("https://your-domain.com/api/v1/files", {
  headers: { "X-API-Key": "YOUR_API_KEY" },
});

const { data } = await response.json();
data.forEach((file) => {
  console.log(file.cid, file.original_filename);
});

Delete a file

delete.jsjavascript
const cid = "bafkreih5...";
const response = await fetch(
  `https://your-domain.com/api/v1/files/${cid}`,
  {
    method: "DELETE",
    headers: { "X-API-Key": "YOUR_API_KEY" },
  },
);
const data = await response.json();
console.log(data.message);