Fetch from IPFS
Retrieve a file or directory from IPFS by its CID hash. Returns the raw content. For JSON files (dispute templates, evidence, policy docs) the response body is the parsed JSON.
GET
/
ipfs
/
{hash}
Fetch content from IPFS
curl --request GET \
--url https://cdn.kleros.link/ipfs/{hash}import requests
url = "https://cdn.kleros.link/ipfs/{hash}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://cdn.kleros.link/ipfs/{hash}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://cdn.kleros.link/ipfs/{hash}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://cdn.kleros.link/ipfs/{hash}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://cdn.kleros.link/ipfs/{hash}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cdn.kleros.link/ipfs/{hash}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"title": "Should this item be accepted into the registry?",
"description": "Evaluate whether the item meets the registry criteria.",
"question": "Does this item comply with the required criteria?",
"answers": [
{
"id": "0x00",
"title": "Refuse to Arbitrate"
},
{
"id": "0x01",
"title": "Yes"
},
{
"id": "0x02",
"title": "No"
}
]
}Path Parameters
The IPFS CID (v0 or v1) of the content to retrieve. May include a subpath for directory traversal, e.g. QmHash.../metadata.json.
Example:
"QmTaZuQjJT9NZCYsqyRmEwLb1Vt3gme1a6BS4NQLiWXtH2"
Response
Content retrieved successfully
For JSON files: the parsed content. Schema varies by content type (dispute template, evidence, policy doc).
⌘I
Fetch content from IPFS
curl --request GET \
--url https://cdn.kleros.link/ipfs/{hash}import requests
url = "https://cdn.kleros.link/ipfs/{hash}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://cdn.kleros.link/ipfs/{hash}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://cdn.kleros.link/ipfs/{hash}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://cdn.kleros.link/ipfs/{hash}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://cdn.kleros.link/ipfs/{hash}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cdn.kleros.link/ipfs/{hash}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"title": "Should this item be accepted into the registry?",
"description": "Evaluate whether the item meets the registry criteria.",
"question": "Does this item comply with the required criteria?",
"answers": [
{
"id": "0x00",
"title": "Refuse to Arbitrate"
},
{
"id": "0x01",
"title": "Yes"
},
{
"id": "0x02",
"title": "No"
}
]
}