block_get

/api/v0/block/get

Get a raw IPFS block.

REQUEST

GET https://ipfs.infura.io:5001/api/v0/block/get?arg=<key>

REQUEST PARAMS

  • arg [required] - The base58 multihash of an existing block to get.

EXAMPLE

// GET
curl "https://ipfs.infura.io:5001/api/v0/block/get?arg=QmaYL7E4gDTPNfLxrCEEEcNJgcHBJ55NxxTnxpDKWqMtJ3"

RESPONSE

On success, the call to this endpoint will return with 200 and the following body:

BODY

This endpoint returns a `text/plain` response body.

block_stat

/api/v0/block/stat

Print information of a raw IPFS block.

REQUEST

GET https://ipfs.infura.io:5001/api/v0/block/stat?arg=<key>

REQUEST PARAMS

  • arg [required] - The base58 multihash of an existing block to stat.

EXAMPLE

// GET
curl "https://ipfs.infura.io:5001/api/v0/block/stat?arg=QmfQ5QAjvg4GtA3wg3adpnDJug8ktA1BxurVqBD8rtgVjM"

RESPONSE

On success, the call to this endpoint will return with 200 and the following body:

RESULT FIELDS

  • Key - The base58 multihash string of the block
  • Size - An integer representing the size in bytes

BODY

{
    Key: "QmfQ5QAjvg4GtA3wg3adpnDJug8ktA1BxurVqBD8rtgVjM",
    Size: 18
}

cat

/api/v0/cat

Show IPFS object data.

REQUEST

GET https://ipfs.infura.io:5001/api/v0/cat?arg=<key>

REQUEST PARAMS

  • arg [required] - The IPFS object hash

EXAMPLE

// GET
curl "https://ipfs.infura.io:5001/api/v0/cat?arg=QmZtmD2qt6fJot32nabSP3CUjicnypEBz7bHVDhPQt9aAy"

RESPONSE

On success, the call to this endpoint will return with 200 and the following body:

BODY

This endpoint returns a `text/plain` response body.

dag_get

/api/v0/dag/get

Get a dag node from IPFS.

REQUEST

GET https://ipfs.infura.io:5001/api/v0/dat/get?arg=<key>

REQUEST PARAMS

  • arg [required] - The IPFS object hash

EXAMPLE

// GET
curl "https://ipfs.infura.io:5001/api/v0/dag/get?arg=QmZtmD2qt6fJot32nabSP3CUjicnypEBz7bHVDhPQt9aAy"

RESPONSE

On success, the call to this endpoint will return with 200 and the following body:

RESULT FIELDS

  • data
  • links - An array of associated link objects

BODY

{
    data: "CAISFXZlcnNpb24gMSBvZiBteSB0ZXh0ChgV",
    links: [ ]
}

dag_resolve

/api/v0/dag/resolve

Resolve IPLD block

REQUEST

GET https://ipfs.infura.io:5001/api/v0/dat/resolve?arg=<key>

REQUEST PARAMS

  • arg [required] - The IPFS object hash; the path to resolve

EXAMPLE

// GET
curl "https://ipfs.infura.io:5001/api/v0/dag/resolve?arg=QmZtmD2qt6fJot32nabSP3CUjicnypEBz7bHVDhPQt9aAy"

RESPONSE

On success, the call to this endpoint will return with 200 and the following body:

RESULT FIELDS

  • Cid - Content ID (see more here)
  • RemPath

BODY

{
    Cid: {
        /: "QmZtmD2qt6fJot32nabSP3CUjicnypEBz7bHVDhPQt9aAy"
    },
    RemPath: ""
}

get

/api/v0/get

Download IPFS objects.

REQUEST

GET https://ipfs.infura.io:5001/api/v0/get?arg=<ipfs-path>&output=<value>&archive=false&compress=false&compression-level=-1

REQUEST PARAMS

  • arg [required] - The IPFS object hash
  • output [optional] - The path where the output should be stored.
  • archive [optional] - Output a TAR archive. Default: “false”.
  • compress [optional] - Compress the output with GZIP compression. Default is “false”.
  • compression-level [optional] - The level of compression (1-9). Default: “-1”.

EXAMPLE

// GET
curl "https://ipfs.infura.io:5001/api/v0/get?arg=QmZtmD2qt6fJot32nabSP3CUjicnypEBz7bHVDhPQt9aAy&archive=true"

RESPONSE

On success, the call to this endpoint will return with 200 and the following body:

BODY

This endpoint returns a `text/plain` response body.

object_data

/api/v0/object/data

Output the raw bytes of an IPFS object.

REQUEST

GET https://ipfs.infura.io:5001/api/v0/object/data?arg=<key>

REQUEST PARAMS

  • arg [required] - Key of the object to retrieve, in base58-encoded multihash format.

EXAMPLE

// GET
curl "https://ipfs.infura.io:5001/api/v0/object/data?arg=QmZtmD2qt6fJot32nabSP3CUjicnypEBz7bHVDhPQt9aAy"

RESPONSE

On success, the call to this endpoint will return with 200 and the following body:

BODY

This endpoint returns a `text/plain` response body.

object_get

/api/v0/object/get

Get and serialize the DAG node named by key.

REQUEST

GET https://ipfs.infura.io:5001/api/v0/object/get?arg=<key>

REQUEST PARAMS

  • arg [required] - Key of the object to retrieve, in base58-encoded multihash format.

EXAMPLE

// GET
curl "https://ipfs.infura.io:5001/api/v0/object/get?arg=QmfQ5QAjvg4GtA3wg3adpnDJug8ktA1BxurVqBD8rtgVjM"

RESPONSE

On success, the call to this endpoint will return with 200 and the following body:

RESULT FIELDS

  • links - An array of associated link objects
  • data

BODY

{
    Links: [ ],
    Data: "version 1 of my text "
}

object_stat

/api/v0/object/stat

Get stats for the DAG node named by key.

REQUEST

GET https://ipfs.infura.io:5001/api/v0/object/stat?arg=<key>

REQUEST PARAMS

  • arg [required] - Key of the object to retrieve, in base58-encoded multihash format.

EXAMPLE

// GET
curl "https://ipfs.infura.io:5001/api/v0/object/stat?arg=QmZtmD2qt6fJot32nabSP3CUjicnypEBz7bHVDhPQt9aAy"

RESPONSE

On success, the call to this endpoint will return with 200 and the following body:

RESULT FIELDS

  • Hash - Hash of the object
  • NumLinks - number of links the node contains
  • BlockSize - size of the raw serialized node
  • LinksSize - size of the links block section
  • DataSize - size of data block section
  • CumulativeSize - size of the tree (BlockSize + link sizes)

BODY

{
    Hash: "QmZtmD2qt6fJot32nabSP3CUjicnypEBz7bHVDhPQt9aAy",
    NumLinks: 0,
    BlockSize: 29,
    LinksSize: 2,
    DataSize: 27,
    CumulativeSize: 29
}

pin_add

/api/v0/pin/add

Pin objects to local storage.

REQUEST

GET https://ipfs.infura.io:5001/api/v0/pin/add?arg=<ipfs-path>&recursive=true&progress=<value>

REQUEST PARAMS

  • arg [Required] - Path to object(s) to be pinned.
  • recursive [Optional] - Recursively pin the object linked to by the specified object(s). Default: “true”
  • progress [Optional] - Show progress.

EXAMPLE

Argument 'file' is of file type. This endpoint expects a file in the body of the request as multipart/form-data.

// GET
curl "https://ipfs.infura.io:5001/api/v0/pin/add?arg=/ipfs/QmSTkR1kkqMuGEeBS49dxVJjgHRMH6cUYa7D3tcHDQ3ea3" 

RESPONSE

On success, the call to this endpoint will return with 200 and the following body:

RESULT FIELDS

  • Pins - An array of Pin hashes

BODY

{
    "Pins": [
        "QmSTkR1kkqMuGEeBS49dxVJjgHRMH6cUYa7D3tcHDQ3ea3"
    ],
}

version

/api/v0/version

Show IPFS version information.

REQUEST

GET https://ipfs.infura.io:5001/api/v0/version?number=false&commit=false&repo=false&all=false

REQUEST PARAMS

  • number [optional] - Only show the version number. Default is false
  • commit [optional] - Show the commit hash. Default is false
  • repo [optional] - Show repo version. Default is false
  • all [optional] - Show all version information. Default is false

EXAMPLE

// GET
curl "https://ipfs.infura.io:5001/api/v0/version"

RESPONSE

On success, the call to this endpoint will return with 200 and the following body:

RESULT FIELDS

  • Version - Current version number
  • Commit - Current commit id
  • Repo - Version number of the repo
  • System - System information
  • Golang - GoLang runtime version

BODY

{
    Version: "0.4.14",
    Commit: "",
    Repo: "6",
    System: "amd64/linux",
    Golang: "go1.10"
}

Other Resources