Skip to content

Quick Start

Upload your first file to IPFS in under two minutes.

Upload page with drag-and-drop file upload

1. Get your API key

Sign up at ipfs.ninja with your Google account. A default API key is created automatically. Go to your Profile page to view and manage your API keys.

WARNING

Note: API keys don't expire. You can create multiple keys and revoke them individually from your Profile page.

2. Upload a file

Send a POST request to /upload/new with your content. Here's an example uploading a JSON object:

curl

bash
curl -X POST https://api.ipfs.ninja/upload/new \
  -H "X-Api-Key: bws_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "content": {
      "name": "My NFT",
      "description": "A permanent file on IPFS",
      "image": "ipfs://QmExampleCID..."
    },
    "description": "NFT metadata"
  }'

JavaScript

javascript
const response = await fetch("https://api.ipfs.ninja/upload/new", {
  method: "POST",
  headers: {
    "X-Api-Key": "bws_your_api_key_here",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    content: {
      name: "My NFT",
      description: "A permanent file on IPFS",
      image: "ipfs://QmExampleCID..."
    },
    description: "NFT metadata"
  })
});

const data = await response.json();
console.log(data.cid);       // "QmXmCX9S6ANV..."
console.log(data.uris.url);  // "https://ipfs.ninja/ipfs/QmXmCX9S6ANV..."

The API returns the CID, file size, and access URIs:

json
{
  "cid": "QmXmCX9S6ANVjYJh3rJmXjqgYtYv7WZLUDL2XCwdPrvUwN",
  "sizeMB": 0.001,
  "uris": {
    "ipfs": "ipfs://QmXmCX9S6ANVjYJh3rJmXjqgYtYv7WZLUDL2XCwdPrvUwN",
    "url": "https://ipfs.ninja/ipfs/QmXmCX9S6ANVjYJh3rJmXjqgYtYv7WZLUDL2XCwdPrvUwN"
  }
}

3. Retrieve your file

Access your file in two ways:

Via the IPFS gateway (public, no auth needed)

bash
curl https://ipfs.ninja/ipfs/QmXmCX9S6ANVjYJh3rJmXjqgYtYv7WZLUDL2XCwdPrvUwN

Via the API (returns file metadata)

bash
curl https://api.ipfs.ninja/file/QmXmCX9S6ANVjYJh3rJmXjqgYtYv7WZLUDL2XCwdPrvUwN \
  -H "X-Api-Key: bws_your_api_key_here"

Response:

json
{
  "cid": "QmXmCX9S6ANVjYJh3rJmXjqgYtYv7WZLUDL2XCwdPrvUwN",
  "fileName": "NFT metadata",
  "fileType": "json",
  "sizeMB": 0.001,
  "createdAt": 1711036800000,
  "uris": {
    "ipfs": "ipfs://QmXmCX9S6ANVjYJh3rJmXjqgYtYv7WZLUDL2XCwdPrvUwN",
    "url": "https://ipfs.ninja/ipfs/QmXmCX9S6ANVjYJh3rJmXjqgYtYv7WZLUDL2XCwdPrvUwN"
  }
}

Alternative: Use the AWS SDK (S3-compatible)

Already using S3? Point your existing AWS SDK at https://s3.ipfs.ninja and use your API key as credentials:

javascript
import { S3Client, PutObjectCommand } from "@aws-sdk/client-s3";

const s3 = new S3Client({
  endpoint: "https://s3.ipfs.ninja",
  credentials: { accessKeyId: "bws_prefix", secretAccessKey: "bws_fullkey" },
  region: "us-east-1",
  forcePathStyle: true
});

await s3.send(new PutObjectCommand({
  Bucket: "my-project",
  Key: "my-file.json",
  Body: JSON.stringify({ hello: "IPFS" })
}));

See S3 Compatibility for full documentation with Python, Go, and migration examples.

Next steps