Skip to content

List API

The List API supports retrieving file lists from CloudFlare ImgBed.

Basic Information

  • Endpoint: /api/manage/list
  • Method: GET
  • Authentication: Requires list permission
  • Content Type: application/json

Request Parameters

Query Parameters

ParameterTypeRequiredDefaultDescription
startnumberNo0Starting position for pagination
countnumberNo50Number of items to return, -1 means no limit
sumbooleanNofalseWhether to return only total count statistics (effective when count is -1)
recursivebooleanNofalseWhether to recursively get files in subdirectories
dirstringNo""Specify directory path
searchstringNo""Search keyword, supports filename search
includeTagsstringNo""Include tags filter, multiple tags separated by comma, files must contain all specified tags
excludeTagsstringNo""Exclude tags filter, multiple tags separated by comma, files cannot contain any specified tags
channelstringNo""Filter by storage channel: telegram, cfr2, s3
listTypestringNo""Filter by review result type: None, Block, White
actionstringNo""Special operations: rebuild, info

Feature Description

Regular File List Query

Retrieve lists of files and subdirectories in the specified directory, with support for pagination, search, and filtering.

Statistics Query

When count=-1 and sum=true, only returns total file count statistics (for the specified directory and subdirectories).

Recursive Query

When recursive=true, recursively retrieves all files in subdirectories.

Tag Filtering

Supports precise file filtering by tags:

  • Include Tags (includeTags): Files must contain all specified tags to be returned
  • Exclude Tags (excludeTags): Files cannot contain any of the specified tags
  • Tag matching is case-insensitive and supports multilingual tags (Chinese, Japanese, Korean, etc.)
  • Include and exclude tags can be used together for complex filtering

Special Operations

Rebuild Index (action=rebuild)

Asynchronously rebuild the file index to improve query performance.

Index Information (action=info)

Get basic information and status of the index.

Response Format

Regular List Response

json
{
  "files": [
    {
      "name": "example/image.jpg",
      "metadata": {
        "Channel": "telegram",
        "TimeStamp": "1754020094217",
        "File-Mime": "image/jpeg",
        "File-Size": "1024000"
      }
    }
  ],
  "directories": [
    "example/subfolder"
  ],
  "totalCount": 100, // Total file count in the specified directory and subdirectories
  "returnedCount": 50, // Actual number of files returned
  "indexLastUpdated": "1754020094217",
  "isIndexedResponse": true
}

Statistics Response

json
{
  "sum": 100,
  "indexLastUpdated": "1754020094217"
}

Index Information Response

json
{
  "totalFiles": 100,
  "lastUpdated": "1754020094217",
  "channelStats": {
    "telegram": 20
  },
  "directoryStats": {
    "/": 30
  },
  "typeStats": {
    "None": 20
  },
  "oldestFile": {},
  "newestFile": {}
}

Error Response

json
{
  "error": "Internal server error",
  "message": "Detailed error message"
}

Examples

Get File List

bash
curl --location --request GET 'https://your.domain/api/manage/list?start=0&count=50' \
--header 'Authorization: Bearer your_token'

Search Files

bash
curl --location --request GET 'https://your.domain/api/manage/list?search=image&count=20' \
--header 'Authorization: Bearer your_token'

Get Specific Directory

bash
curl --location --request GET 'https://your.domain/api/manage/list?dir=photos/2024' \
--header 'Authorization: Bearer your_token'

Filter by Storage Channel

bash
curl --location --request GET 'https://your.domain/api/manage/list?channel=telegram' \
--header 'Authorization: Bearer your_token'

Get Total Count Statistics

bash
curl --location --request GET 'https://your.domain/api/manage/list?count=-1&sum=true' \
--header 'Authorization: Bearer your_token'

Rebuild Index

bash
curl --location --request GET 'https://your.domain/api/manage/list?action=rebuild' \
--header 'Authorization: Bearer your_token'

Filter by Tags

bash
# Files containing specific tags
curl --location --request GET 'https://your.domain/api/manage/list?includeTags=landscape,travel' \
--header 'Authorization: Bearer your_token'
bash
# Files excluding specific tags
curl --location --request GET 'https://your.domain/api/manage/list?excludeTags=private,draft' \
--header 'Authorization: Bearer your_token'
bash
# Combined usage: include "landscape" tag but exclude "draft" tag
curl --location --request GET 'https://your.domain/api/manage/list?includeTags=landscape&excludeTags=draft' \
--header 'Authorization: Bearer your_token'

Released under the MIT License