Get File by ID
curl --request GET \
--url https://api.pinata.cloud/v3/files/{network}/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.pinata.cloud/v3/files/{network}/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.pinata.cloud/v3/files/{network}/{id}', 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://api.pinata.cloud/v3/files/{network}/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://api.pinata.cloud/v3/files/{network}/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.pinata.cloud/v3/files/{network}/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pinata.cloud/v3/files/{network}/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "e5323ea7-8a02-4486-9b6f-63c788810aeb",
"name": "e093dbd3-f276-4bb3-a43e-60437725f410.txt",
"cid": "bafkreicnu2aqjkoglrlrd65giwo4l64pdajxffk6jtq2vb7yaiopc3yu7m",
"size": 36,
"number_of_files": 1,
"mime_type": "text/plain",
"group_id": "18893556-de8e-4229-8a9a-27b95468dd3e",
"keyvalues": {
"whimsey": "true"
},
"created_at": "2024-08-27T14:57:51.485934Z"
}
}Files
Get File by ID
org:files:read
GET
/
files
/
{network}
/
{id}
Get File by ID
curl --request GET \
--url https://api.pinata.cloud/v3/files/{network}/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.pinata.cloud/v3/files/{network}/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.pinata.cloud/v3/files/{network}/{id}', 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://api.pinata.cloud/v3/files/{network}/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://api.pinata.cloud/v3/files/{network}/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.pinata.cloud/v3/files/{network}/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pinata.cloud/v3/files/{network}/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "e5323ea7-8a02-4486-9b6f-63c788810aeb",
"name": "e093dbd3-f276-4bb3-a43e-60437725f410.txt",
"cid": "bafkreicnu2aqjkoglrlrd65giwo4l64pdajxffk6jtq2vb7yaiopc3yu7m",
"size": 36,
"number_of_files": 1,
"mime_type": "text/plain",
"group_id": "18893556-de8e-4229-8a9a-27b95468dd3e",
"keyvalues": {
"whimsey": "true"
},
"created_at": "2024-08-27T14:57:51.485934Z"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Target either the public or private IPFS network
Available options:
public, private Response
200 - application/json
OK
Show child attributes
Show child attributes
⌘I