# Pix User

The Pix User resource lets you consult, through DICT, an end user's statistics on Pix keys, Pix requests, frauds and infractions registered across Bacen's systems (e.g. SPI for Pix requests).

Here we will show you how to retrieve user data.

### The Pix User Object

**Attributes**

| Name | Type | Description |
| --- | --- | --- |
| `id` | STRING | Tax ID (CPF or CNPJ) used to query the user. |
| `statistics.value` | INTEGER | Number of occurrences counted for this statistic. |
| `statistics.type` | STRING | Type of the statistic; the valid values depend on the source. Options: "registered", "unique" (pix-key); "settled" (pix-request); "identity", "mule", "scam", "other", "unknown", "amount", "unique" (pix-fraud); "open", "denied", "unique" (pix-infraction). |
| `statistics.source` | STRING | Source of the statistic. Options: "pix-key", "pix-fraud", "pix-request", "pix-infraction". |
| `statistics.after` | STRING | Datetime from which the statistic was computed. Example: "2020-04-23T23:00:00.000000+00:00". |
| `statistics.updated` | STRING | Last update datetime of the statistic. Example: "2020-04-23T23:00:00.000000+00:00". |

### Get a Pix User

`GET /v2/pix-user/:taxId`

Retrieve a user's aggregated Pix statistics — Pix keys, Pix requests, frauds and infractions — for a specific user by their tax ID.

**Parameters**

| Name | Required | Description |
| --- | --- | --- |
| `taxId` | REQUIRED | CPF or CNPJ of the user to query. |
| `keyId` | OPTIONAL | Pix key to retrieve statistics for. When provided, the response returns the key statistics instead of the owner statistics. |

**Request**

```python
import starkinfra

user = starkinfra.pixuser.get("012.345.678-90")

print(user)
```

**Response**

```python
PixUser(
    id="012.345.678-90",
    statistics=[
        PixUser.Statistics(
            value=3,
            type="open",
            source="pix-infraction",
            after="2020-04-23T23:00:00.000000+00:00",
            updated="2020-04-23T23:00:00.000000+00:00"
        )
    ]
)
```

## Available Languages

Code samples on this page are in Python. The same content is available with samples in:

- [Python](https://docs.starkinfra.com/api/v2/pix-user-python.md)
- [Node.js](https://docs.starkinfra.com/api/v2/pix-user-node.md)
- [PHP](https://docs.starkinfra.com/api/v2/pix-user-php.md)
- [Java](https://docs.starkinfra.com/api/v2/pix-user-java.md)
- [Ruby](https://docs.starkinfra.com/api/v2/pix-user-ruby.md)
- [Elixir](https://docs.starkinfra.com/api/v2/pix-user-elixir.md)
- [.NET](https://docs.starkinfra.com/api/v2/pix-user-dotnet.md)
- [Go](https://docs.starkinfra.com/api/v2/pix-user-go.md)
- [Clojure](https://docs.starkinfra.com/api/v2/pix-user-clojure.md)
- [cURL](https://docs.starkinfra.com/api/v2/pix-user-curl.md)
