List Files

The List API is used to browse the contents of your Terabox drive. It returns a paginated list of files and directories within a specified folder.

List Directory

Endpoint: GET /api/list

This endpoint retrieves metadata for all items in a target path, including file IDs (fs_id), names, sizes, creation times, and thumbnail URLs for images/videos.

Parameters

Parameter Type Required Description
app_id string Yes Always 250528.
jsToken string Yes Your session security token.
dir string No The absolute path to list. Defaults to root /. Example: /MyVideos.
num int No Number of items per page. Default 100. Max is usually 100 or 1000.
page int No The page number to retrieve. Default 1.
order string No Sorting field. Options: time (modification time), name, size. Default: time.
desc int No Sorting direction. 1 for Descending (newest first), 0 for Ascending. Default: 1.

Code Examples

=== "cURL"

```bash
curl "https://1024terabox.com/api/list?app_id=250528&web=1&channel=dubox&clienttype=0&jsToken=YOUR_TOKEN&dir=/&num=100&order=time&desc=1" \
  -H "Cookie: ndus=YOUR_COOKIE" \
  -H "User-Agent: Mozilla/5.0..."
```

=== "Python"

```python
params = {
    'app_id': '250528',
    'web': '1',
    'channel': 'dubox',
    'clienttype': '0',
    'jsToken': js_token,
    'dir': '/',  # Change this to list subfolders
    'num': '100',
    'order': 'time',
    'desc': '1'
}

resp = session.get('https://1024terabox.com/api/list', params=params)
data = resp.json()

if data['errno'] == 0:
    files = data.get('list', [])
    print(f"Found {len(files)} items.")
    for f in files:
        type_str = "DIR " if f['isdir'] == 1 else "FILE"
        print(f"[{type_str}] {f['server_filename']} ({f['size']} bytes)")
```

=== "Node.js"

```javascript
const resp = await client.get('/api/list', {
    params: {
        app_id: '250528',
        web: '1',
        channel': 'dubox',
        clienttype: '0',
        jsToken: 'YOUR_TOKEN',
        dir: '/',
        num: 100,
        order: 'time',
        desc: 1
    }
});

if (resp.data.errno === 0) {
    const list = resp.data.list || [];
    list.forEach(f => {
        console.log(`${f.isdir ? 'DIR' : 'FILE'}: ${f.server_filename}`);
    });
}
```

Response Object

The response contains a list array where each object represents a file or folder.

{
  "errno": 0,
  "guid": 1,
  "list": [
    {
      "fs_id": 123456789,
      "path": "/MyFolder/image.jpg",
      "server_filename": "image.jpg",
      "size": 102400,
      "isdir": 0,
      "category": 3,
      "server_ctime": 1672531200,
      "server_mtime": 1672531200,
      "thumbs": {
          "url1": "https://...",
          "url2": "https://..."
      }
    },
    {
      "fs_id": 987654321,
      "path": "/MyFolder/SubFolder",
      "server_filename": "SubFolder",
      "size": 0,
      "isdir": 1,
      "server_ctime": 1672531200,
      "server_mtime": 1672531200
    }
  ]
}