---
title: "Count element in directory"
method: GET
path: "/3/drive/{drive_id}/files/{file_id}/count"
tags: ["Drive > Files > File/Directory"]
---

# Count element in directory

`GET /3/drive/{drive_id}/files/{file_id}/count`

Get number of element in a directory by ID

## Path parameters

- `drive_id` integer, required
- `file_id` integer, required

## Query parameters

- `depth` 'folder' | 'unlimited' — Specifies how elements are counted within given folder. Choose either to count only within the specified folder (folder) or to include subfolders in the count (unlimited). The default mode is folder.<ul><small><li><strong>folder:</strong> Count elements only in the specified folder, excluding subfolders.</li><li><strong>unlimited:</strong> Count elements in the specified folder and all subfolders.</li></small></ul>

## Response `200`

OK

- object
  - `result` 'success' | 'error' | 'asynchronous', required — Result of the HTTP request
  - `data` 91ac10ffCountFile
    - `count` integer, required — Total of element in the directory
    - `files` integer, required — Total of files in the directory
    - `directories` integer, required — Total of directories in the directory

## Other responses

- `400` — Bad Request
- `403` — Forbidden
- `503` — Service Unavailable

---

[API](https://skmtc.dev/infomaniak/apis/api-reference-developer-tools.md) · [All operations](https://skmtc.dev/infomaniak/apis/api-reference-developer-tools/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/infomaniak/api-reference-developer-tools/revisions/667aae28fec6/schema)
