---
title: "Counts a product's files and links by kind."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.sherpo.io/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Sherpo merchant API › file

`GET /v1/stores/{store}/products/{product}/file_stats`

## Authentication

- `bearer`, http, header `Authorization`, scopes: `file:read`

## Path parameters

- `store` (`productFileStats.path.store`; string, required) — The store's id.
- `product` (`productFileStats.path.product`; string, required) — An id, or `slug:<slug>`.
  - minLength 1

## Code samples

### cURL

```bash
curl --request GET \
  --url 'https://api.sherpo.io/merchant/v1/stores/<store>/products/<product>/file_stats' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://api.sherpo.io/merchant/v1/stores/<store>/products/<product>/file_stats';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.sherpo.io/merchant/v1/stores/<store>/products/<product>/file_stats"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
```

## Responses

### 200

Counts a product's files and links by kind.

#### Example

```json
{
  "files": 0,
  "links": 0,
  "bytes": 0
}
```

- `files` (`productFileStats.response.200.files`; number, required)
- `links` (`productFileStats.response.200.links`; number, required)
- `bytes` (`productFileStats.response.200.bytes`; number, required) — The files' size in bytes, as they count against the store's storage.

### default

A problem; see https://api.sherpo.io/merchant/docs/errors.

#### Example

```json
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "context": {},
  "reached_core": true,
  "core_answer": "string"
}
```

- `type` (`productFileStats.response.default.type`; string, required)
  - format `uri`
- `title` (`productFileStats.response.default.title`; string, required)
- `status` (`productFileStats.response.default.status`; integer, required)
- `detail` (`productFileStats.response.default.detail`; string, required)
- `code` (`productFileStats.response.default.code`; string, optional)
- `context` (`productFileStats.response.default.context`; object, optional)
- `reached_core` (`productFileStats.response.default.reached_core`; boolean, optional)
- `core_answer` (`productFileStats.response.default.core_answer`; string, optional)


Source: https://docs.sherpo.io/merchant-api/reference/product-file-stats/index.md
