# Views API

Source: https://frameleaf.app/docs/api/reference/views/

Use your own server and its scoped API keys.

## Retrieve best photos

GET /api/best-photos

Retrieve visible photo assets ranked by the locally computed Best Photos score.

```json
{
  "description": "Retrieve visible photo assets ranked by the locally computed Best Photos score.",
  "operationId": "getBestPhotos",
  "parameters": [
    {
      "name": "includeArchived",
      "required": false,
      "in": "query",
      "schema": {
        "type": "boolean"
      }
    },
    {
      "name": "limit",
      "required": false,
      "in": "query",
      "schema": {
        "minimum": 1,
        "maximum": 500,
        "default": 100,
        "type": "integer"
      }
    },
    {
      "name": "minScore",
      "required": false,
      "in": "query",
      "schema": {
        "minimum": 0,
        "maximum": 1,
        "format": "double",
        "type": "number"
      }
    },
    {
      "name": "page",
      "required": false,
      "in": "query",
      "schema": {
        "minimum": 1,
        "maximum": 9007199254740991,
        "default": 1,
        "type": "integer"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/BestPhotosResponseDto"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Retrieve best photos",
  "tags": [
    "Views"
  ],
  "x-frameleaf-permission": "asset.read"
}
```

## Retrieve assets by original path

GET /api/view/folder

Retrieve assets that are children of a specific folder.

```json
{
  "description": "Retrieve assets that are children of a specific folder.",
  "operationId": "getAssetsByOriginalPath",
  "parameters": [
    {
      "name": "path",
      "required": true,
      "in": "query",
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "items": {
              "$ref": "#/components/schemas/AssetResponseDto"
            },
            "type": "array"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Retrieve assets by original path",
  "tags": [
    "Views"
  ],
  "x-frameleaf-permission": "folder.read"
}
```

## Retrieve folder summaries

GET /api/view/folder/summary

Retrieve, for each folder, how many originals it holds directly and their size in bytes, counting only the Timeline items the folder views list.

```json
{
  "description": "Retrieve, for each folder, how many originals it holds directly and their size in bytes, counting only the Timeline items the folder views list.",
  "operationId": "getFolderSummary",
  "parameters": [],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "items": {
              "$ref": "#/components/schemas/FolderSummaryResponseDto"
            },
            "type": "array"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Retrieve folder summaries",
  "tags": [
    "Views"
  ],
  "x-frameleaf-permission": "folder.read"
}
```

## Retrieve unique paths

GET /api/view/folder/unique-paths

Retrieve a list of unique folder paths from asset original paths.

```json
{
  "description": "Retrieve a list of unique folder paths from asset original paths.",
  "operationId": "getUniqueOriginalPaths",
  "parameters": [],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Retrieve unique paths",
  "tags": [
    "Views"
  ],
  "x-frameleaf-permission": "folder.read"
}
```
