Retrieve data

There are multiple ways to fetch data from a storage provider. This pages covers some of the most popular methods.


Lassie is a simple retrieval client for Filecoin. It finds and fetches your data over the best retrieval protocols available.


Make sure that you have Go installed and that your GOPATH is set up. By default, your GOPATH will be set to ~/go.

Install Lassie

  1. Download and install Lassie using the Go package manager:
go install
go: downloading v0.3.1
go: downloading v0.23.2
go: downloading v0.9.9
  1. Install the go-car package using the Go package manager:
go install
go: downloading v0.6.0
go: downloading v0.0.0-20230215023242-a2a8d2f9f60f
go: downloading v1.6.0 

The go-car package makes it easier to work with content-addressed archive (CAR) files.


To retrieve data from Filecoin using Lassie, all you need is the CID of the content you want to download. You can use the following CIDs to test the process:

  1. The format for retrieving data using Lassie is:
lassie fetch -o <OUTFILE_FILE_NAME> -p <CID>

For example:

lassie fetch -o -p bafykbzaceatihez66rzmzuvfx5nqqik73hlphem3dvagmixmay3arvqd66ng6
Fetching bafykbzaceatihez66rzmzuvfx5nqqik73hlphem3dvagmixmay3arvqd66ng6
Querying indexer for bafykbzaceatihez66rzmzuvfx5nqqik73hlphem3dvagmixmay3arvqd66ng6...
Found 4 storage providers candidates from the indexer, querying all of them:
Querying [12D3KooWLDf6KCzeMv16qPRaJsTLKJ5fR523h65iaYSRNfrQy7eU] (started)...
Querying [12D3KooWKGCcFVSAUXxe7YP62wiwsBvpCmMomnNauJCA67XbmHYj] (started)...

  1. This will create an file within your current directory:
ls -l
total 143M
-rw-rw-r-- 1 user user 143M Feb 16 11:21

Extract data

Now that we’ve downloaded a CAR file, we need to find out what’s inside it.

  1. The format for extracting a .car file using Go-car is:
car extract --file <INPUT_FILE>
  1. Extract the file we just downloaded using Lassie:
car extract --file

This command does not output anything on success.

  1. You can list the output of the car command with ls:
ls -lh
-rw-rw-r-- 1 user user 143M Feb 16 11:21
-rw-rw-r-- 1 user user 143M Feb 16 11:36 moon-data.tar.gz
  1. You can then manage the data as you need.

And there we have it! Downloading and managing data from Filecoin is super simple when you use Lassie and Go-car!

Edit this page on GitHub