Pinata Docs
Searchโ€ฆ
List Content In Submarined Folder
/content/:id/list
When uploading folders, it is possible to query one level deep into those folders with this endpoint. This endpoint accepts one URL argumentโ€”the file's ID, not the CID.
If a folder has sub folders, this endpoint will not allow you to list the contents of each individual sub folder. Instead, it will list the path of the content like this: folderName/fileName.

List Content in Submarined Folder

get
https://managed.mypinata.cloud/api/v1
/content/:id/list
cURL
Node.js
Python
Go
curl --location --request GET 'https://managed.mypinata.cloud/api/v1/content/95c904a0-4d61-4598-a4c8-fb5f0793c7ab/list' \
--header 'x-api-key: SUBMARINE KEY'
var axios = require('axios');
โ€‹
var config = {
method: 'get',
url: 'https://managed.mypinata.cloud/api/v1/content/95c904a0-4d61-4598-a4c8-fb5f0793c7ab/list',
headers: {
'x-api-key': 'SUBMARINE KEY'
}
};
โ€‹
const res = await axios(config);
โ€‹
console.log(res.data);
import requests
โ€‹
url = "https://managed.mypinata.cloud/api/v1/content/95c904a0-4d61-4598-a4c8-fb5f0793c7ab/list"
โ€‹
payload={}
headers = {
'x-api-key': 'SUBMARINE KEY'
}
โ€‹
response = requests.request("GET", url, headers=headers, data=payload)
โ€‹
print(response.text)
โ€‹
package main
โ€‹
import (
"fmt"
"net/http"
"io/ioutil"
)
โ€‹
func main() {
โ€‹
url := "https://managed.mypinata.cloud/api/v1/content/95c904a0-4d61-4598-a4c8-fb5f0793c7ab/list"
method := "GET"
โ€‹
client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)
โ€‹
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("x-api-key", "SUBMARINE KEY")
โ€‹
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
โ€‹
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}