---
title: "TSCARD"
url: "https://docs.yugabyte.com/stable/yedis/api/tscard/"
---

# TSCARD

## Synopsis

**`TSCARD key`**

This command returns the number of entires in the given time series.

- If the given `key` is associated with non-time series data, an error is raised.
- If the given `key` is not associated with any data, 0 is returned.

## Return value

Returns the number of entries in the given time series.

## Examples

```sh
$ TSADD ts_key 10 v1 20 v2 30 v3 40 v4 50 v5
```

```
"OK"
```

```sh
$ TSCARD ts_key
```

```
(integer) 5
```

```sh
$ TSADD ts_key1 10 v1 20 v2 30 v3
```

```
"OK"
```

```sh
$ TSCARD ts_key1
```

```
(integer) 3
```

Non-existent key returns 0.

```sh
$ TSCARD ts_key2
```

```
(integer) 0
```

## See also

[`tsadd`](/stable/yedis/api/tsadd/ "tsadd"), [`tsget`](/stable/yedis/api/tsget/ "tsget"), [`tsrem`](/stable/yedis/api/tsrem/ "tsrem"), [`tsrangebytime`](/stable/yedis/api/tsrangebytime "tsrangebytime"), [`tsrevrangebytime`](/stable/yedis/api/tsrevrangebytime "tsrevrangebytime"), [`tslastn`](/stable/yedis/api/tslastn "tslastn")
