# Speed and execution quality (Account REST API (/users/current))

> Tickwire API reference, generated from the OpenAPI document the services export. Base URL: https://api.tickwire.io. Replace YOUR_API_KEY and YOUR_ACCOUNT_ID with your own values; use a sandbox key (twsk_…) to experiment.

Source: https://tickwire.io/docs/reference/speed-quality/

### `GET /users/current/accounts/{account_id}/execution-quality`

**Account Execution Quality**

Auth: `auth-token`

Execution quality of this account over a time range: slippage per fill,
time to fill, rejects and requotes (TASK-212). See the module docstring.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `account_id` | path | `string` | yes |  |
| `startTime` | query | `string \| null` | no |  |
| `endTime` | query | `string \| null` | no |  |
| `days` | query | `integer \| null` | no |  |
| `symbol` | query | `string \| null` | no |  |
| `limit` | query | `integer` | no |  |

Responses:

- `200` Successful Response
- `400` Bad request. On the account API paths a body or query validation failure is a 400 ``ValidationError`` with ``details: [{parameter, message}]``. (`ErrorEnvelope`)
- `401` No credential was sent, or it is not valid or has expired. (`ErrorEnvelope`)
- `403` The credential is valid but may not do this, for example a read-only key on a change, or a token without the needed role or account. (`ErrorEnvelope`)
- `404` The account does not exist or this credential cannot see it, or the position, order or symbol in the path was not found. (`ErrorEnvelope`)
- `422` The body is not valid JSON, or a typed query parameter is not valid. ``details`` lists each one. (`ErrorEnvelope`)
- `429` Too many requests. Wait the ``Retry-After`` seconds, then try again. (`ErrorEnvelope`)
- `503` The terminal is not connected or not synchronized yet. Wait the ``Retry-After`` seconds, then try again. (`ErrorEnvelope`)

Common errors:

- `401` [`unauthorized`](https://tickwire.io/docs/errors/unauthorized/)
- `429` [`rate_limited`](https://tickwire.io/docs/errors/rate_limited/)
- `400, 422` [`validation_error`](https://tickwire.io/docs/errors/validation_error/)
- `404` [`account_not_found`](https://tickwire.io/docs/errors/account_not_found/)
- `503` [`not_connected`](https://tickwire.io/docs/errors/not_connected/)

curl:

```bash
curl -sS -X GET 'https://api.tickwire.io/users/current/accounts/YOUR_ACCOUNT_ID/execution-quality' \
  -H 'auth-token: YOUR_API_KEY'
```

Python:

```python
from tickwire import Tickwire

with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
    result = tw.request(
        "GET",
        "/users/current/accounts/YOUR_ACCOUNT_ID/execution-quality",
    )
    print(result)
```

TypeScript:

```typescript
import { TickwireClient } from "@tickwire/sdk";

const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("GET", "/users/current/accounts/YOUR_ACCOUNT_ID/execution-quality");
console.log(result);
tw.close();
```

### `GET /users/current/accounts/{account_id}/speed`

**Account Speed**

Auth: `auth-token`

Event latency, close-confirm time and time to fill of this account
(TASK-231). See the module docstring for the body.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `account_id` | path | `string` | yes |  |
| `startTime` | query | `string \| null` | no |  |
| `endTime` | query | `string \| null` | no |  |
| `days` | query | `integer \| null` | no |  |

Responses:

- `200` Successful Response
- `400` Bad request. On the account API paths a body or query validation failure is a 400 ``ValidationError`` with ``details: [{parameter, message}]``. (`ErrorEnvelope`)
- `401` No credential was sent, or it is not valid or has expired. (`ErrorEnvelope`)
- `403` The credential is valid but may not do this, for example a read-only key on a change, or a token without the needed role or account. (`ErrorEnvelope`)
- `404` The account does not exist or this credential cannot see it, or the position, order or symbol in the path was not found. (`ErrorEnvelope`)
- `422` The body is not valid JSON, or a typed query parameter is not valid. ``details`` lists each one. (`ErrorEnvelope`)
- `429` Too many requests. Wait the ``Retry-After`` seconds, then try again. (`ErrorEnvelope`)
- `503` The terminal is not connected or not synchronized yet. Wait the ``Retry-After`` seconds, then try again. (`ErrorEnvelope`)

Common errors:

- `401` [`unauthorized`](https://tickwire.io/docs/errors/unauthorized/)
- `429` [`rate_limited`](https://tickwire.io/docs/errors/rate_limited/)
- `400, 422` [`validation_error`](https://tickwire.io/docs/errors/validation_error/)
- `404` [`account_not_found`](https://tickwire.io/docs/errors/account_not_found/)
- `503` [`not_connected`](https://tickwire.io/docs/errors/not_connected/)

curl:

```bash
curl -sS -X GET 'https://api.tickwire.io/users/current/accounts/YOUR_ACCOUNT_ID/speed' \
  -H 'auth-token: YOUR_API_KEY'
```

Python:

```python
from tickwire import Tickwire

with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
    result = tw.request(
        "GET",
        "/users/current/accounts/YOUR_ACCOUNT_ID/speed",
    )
    print(result)
```

TypeScript:

```typescript
import { TickwireClient } from "@tickwire/sdk";

const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("GET", "/users/current/accounts/YOUR_ACCOUNT_ID/speed");
console.log(result);
tw.close();
```

### `GET /users/current/execution-quality/compare`

**Compare Execution Quality**

Auth: `auth-token`

Execution quality of 2 to 4 accounts side by side (TASK-212).

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `accountIds` | query | `string` | yes |  |
| `startTime` | query | `string \| null` | no |  |
| `endTime` | query | `string \| null` | no |  |
| `days` | query | `integer \| null` | no |  |
| `symbol` | query | `string \| null` | no |  |
| `limit` | query | `integer` | no |  |

Responses:

- `200` Successful Response
- `400` Bad request. On the account API paths a body or query validation failure is a 400 ``ValidationError`` with ``details: [{parameter, message}]``. (`ErrorEnvelope`)
- `401` No credential was sent, or it is not valid or has expired. (`ErrorEnvelope`)
- `403` The credential is valid but may not do this, for example a read-only key on a change, or a token without the needed role or account. (`ErrorEnvelope`)
- `404` The account or resource in the path does not exist, or this credential cannot see it. (`ErrorEnvelope`)
- `429` Too many requests. Wait the ``Retry-After`` seconds, then try again. (`ErrorEnvelope`)

Common errors:

- `401` [`unauthorized`](https://tickwire.io/docs/errors/unauthorized/)
- `429` [`rate_limited`](https://tickwire.io/docs/errors/rate_limited/)
- `400, 422` [`validation_error`](https://tickwire.io/docs/errors/validation_error/)

curl:

```bash
curl -sS -X GET 'https://api.tickwire.io/users/current/execution-quality/compare?accountIds=string' \
  -H 'auth-token: YOUR_API_KEY'
```

Python:

```python
from tickwire import Tickwire

with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
    result = tw.request(
        "GET",
        "/users/current/execution-quality/compare",
        params={"accountIds": "string"},
    )
    print(result)
```

TypeScript:

```typescript
import { TickwireClient } from "@tickwire/sdk";

const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("GET", "/users/current/execution-quality/compare", {
  params: {"accountIds":"string"},
});
console.log(result);
tw.close();
```

### `GET /users/current/speed`

**Organisation Speed**

Auth: `auth-token`

Speed of the organisation's accounts together (TASK-231).

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `accountIds` | query | `string \| null` | no |  |
| `startTime` | query | `string \| null` | no |  |
| `endTime` | query | `string \| null` | no |  |
| `days` | query | `integer \| null` | no |  |

Responses:

- `200` Successful Response
- `400` Bad request. On the account API paths a body or query validation failure is a 400 ``ValidationError`` with ``details: [{parameter, message}]``. (`ErrorEnvelope`)
- `401` No credential was sent, or it is not valid or has expired. (`ErrorEnvelope`)
- `403` The credential is valid but may not do this, for example a read-only key on a change, or a token without the needed role or account. (`ErrorEnvelope`)
- `404` The account or resource in the path does not exist, or this credential cannot see it. (`ErrorEnvelope`)
- `429` Too many requests. Wait the ``Retry-After`` seconds, then try again. (`ErrorEnvelope`)

Common errors:

- `401` [`unauthorized`](https://tickwire.io/docs/errors/unauthorized/)
- `429` [`rate_limited`](https://tickwire.io/docs/errors/rate_limited/)
- `400, 422` [`validation_error`](https://tickwire.io/docs/errors/validation_error/)

curl:

```bash
curl -sS -X GET 'https://api.tickwire.io/users/current/speed' \
  -H 'auth-token: YOUR_API_KEY'
```

Python:

```python
from tickwire import Tickwire

with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
    result = tw.request(
        "GET",
        "/users/current/speed",
    )
    print(result)
```

TypeScript:

```typescript
import { TickwireClient } from "@tickwire/sdk";

const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("GET", "/users/current/speed");
console.log(result);
tw.close();
```
