IPFS RPC API
Filebase now supports a limited set of IPFS RPC-compatible API endpoints. These endpoints allow developers and tools that integrate with Kubo to communicate directly with Filebase using familiar IPFS HTTP API routes.
This API is complementary to our S3-compatible API and simplifies integration with the IPFS CLI, IPFS-compatible libraries, and other standard HTTP clients.
Base URL
https://rpc.filebase.io
All API requests require a Bearer API key via the Authorization
header.
π Authentication
API keys can be found at the bottom of the Access Keys page. Keys are bucket-specific. All requests must include an API key in the Authorization
header:
Authorization: Bearer <api-key>
π§ͺ IPFS CLI Integration
You can use the IPFS CLI directly with Filebase by passing the --api
flag:
ipfs --api="/dns4/rpc.filebase.io/tcp/443/https" \
--api-auth="<api-key>" add file1
π /api/v0/pin/ls
/api/v0/pin/ls
List all pinned objects.
Method: POST
curl -X POST -H "Authorization: Bearer <api-key>" \
"https://rpc.filebase.io/api/v0/pin/ls"
π’ /api/v0/version
/api/v0/version
Get the version of the IPFS daemon.
Method: POST
curl -X POST -H "Authorization: Bearer <api-key>" \
"https://rpc.filebase.io/api/v0/version"
π /api/v0/cat
/api/v0/cat
Fetch and return the contents of a file by CID.
Method: POST
Query Parameter:
arg
(string) β CID of the file.
curl -X POST -H "Authorization: Bearer <api-key>" \
"https://rpc.filebase.io/api/v0/cat?arg=Qm..."
π¦ /api/v0/block/get
/api/v0/block/get
Retrieve a raw block by CID.
Method: POST
Query Parameter:
arg
(string) β CID of the block.
curl -X POST -H "Authorization: Bearer <api-key>" \
"https://rpc.filebase.io/api/v0/block/get?arg=Qm..."
β /api/v0/add
/api/v0/add
Add a file to IPFS.
Method: POST
Form Field:
file
(multipart/form-data) β The file to upload.
Supported Query Parameters:
wrap-with-directory
Boolean
Wrap the uploaded file in a directory. Default: false
.
cid-version
Integer
CID version to use (0 or 1). Default: 0
.
Basic Example:
curl -X POST -H "Authorization: Bearer <api-key>" \
"https://rpc.filebase.io/api/v0/add" \
-F "file=@file1"
Example with wrap-with-directory
and cid-version
:
curl -X POST -H "Authorization: Bearer <api-key>" \
"https://rpc.filebase.io/api/v0/add?wrap-with-directory=true&cid-version=1" \
-F "file=@file1" -F "file=@file2"
π‘ When using
wrap-with-directory=true
, the returned CID will represent a directory containing the file rather than the file directly.
π /api/v0/pin/add
/api/v0/pin/add
Pin a CID to ensure it remains stored.
Method: POST
Query Parameter:
arg
(string) β CID to pin.
curl -X POST -H "Authorization: Bearer <api-key>" \
"https://rpc.filebase.io/api/v0/pin/add?arg=Qm..."
π§Ή /api/v0/pin/rm
/api/v0/pin/rm
Unpin a CID to remove it from persistent storage.
Method: POST
Query Parameter:
arg
(string) β CID to unpin.
curl -X POST -H "Authorization: Bearer <api-key>" \
"https://rpc.filebase.io/api/v0/pin/rm?arg=Qm..."
Last updated
Was this helpful?