# Market data (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/market-data/

### GET /users/current/accounts/{account_id}/historical-market-data/symbols/{symbol}/ticks

**Historical Ticks**

Auth: `auth-token`

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

Responses:

- `200` Successful Response
- `422` Validation Error (`HTTPValidationError`)

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/)
- `400, 501` [`not_supported_on_mt4`](https://tickwire.io/docs/errors/not_supported_on_mt4/)

curl:

```bash
curl -sS -X GET 'https://api.tickwire.io/users/current/accounts/YOUR_ACCOUNT_ID/historical-market-data/symbols/EURUSD/ticks' \
  -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/historical-market-data/symbols/EURUSD/ticks",
    )
    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/historical-market-data/symbols/EURUSD/ticks");
console.log(result);
tw.close();
```

### GET /users/current/accounts/{account_id}/historical-market-data/symbols/{symbol}/timeframes/{timeframe}/candles

**Historical Candles**

Auth: `auth-token`

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

Responses:

- `200` Successful Response
- `422` Validation Error (`HTTPValidationError`)

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/)
- `400, 501` [`not_supported_on_mt4`](https://tickwire.io/docs/errors/not_supported_on_mt4/)

curl:

```bash
curl -sS -X GET 'https://api.tickwire.io/users/current/accounts/YOUR_ACCOUNT_ID/historical-market-data/symbols/EURUSD/timeframes/1h/candles' \
  -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/historical-market-data/symbols/EURUSD/timeframes/1h/candles",
    )
    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/historical-market-data/symbols/EURUSD/timeframes/1h/candles");
console.log(result);
tw.close();
```

### GET /users/current/accounts/{account_id}/symbols

**Symbols**

Auth: `auth-token`

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `account_id` | path | `string` | yes |  |

Responses:

- `200` Successful Response
- `422` Validation Error (`HTTPValidationError`)

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/symbols' \
  -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/symbols",
    )
    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/symbols");
console.log(result);
tw.close();
```

### GET /users/current/accounts/{account_id}/symbols/{symbol}/current-book

**Current Book**

Auth: `auth-token`

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `account_id` | path | `string` | yes |  |
| `symbol` | path | `string` | yes |  |
| `keepSubscription` | query | `string \| null` | no |  |

Responses:

- `200` Successful Response
- `422` Validation Error (`HTTPValidationError`)

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/)
- `400, 501` [`not_supported_on_mt4`](https://tickwire.io/docs/errors/not_supported_on_mt4/)

curl:

```bash
curl -sS -X GET 'https://api.tickwire.io/users/current/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/current-book' \
  -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/symbols/EURUSD/current-book",
    )
    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/symbols/EURUSD/current-book");
console.log(result);
tw.close();
```

### GET /users/current/accounts/{account_id}/symbols/{symbol}/current-candles/{timeframe}

**Current Candle**

Auth: `auth-token`

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `account_id` | path | `string` | yes |  |
| `symbol` | path | `string` | yes |  |
| `timeframe` | path | `string` | yes |  |
| `keepSubscription` | query | `string \| null` | no |  |

Responses:

- `200` Successful Response
- `422` Validation Error (`HTTPValidationError`)

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/symbols/EURUSD/current-candles/1h' \
  -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/symbols/EURUSD/current-candles/1h",
    )
    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/symbols/EURUSD/current-candles/1h");
console.log(result);
tw.close();
```

### GET /users/current/accounts/{account_id}/symbols/{symbol}/current-price

**Current Price**

Auth: `auth-token`

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `account_id` | path | `string` | yes |  |
| `symbol` | path | `string` | yes |  |
| `keepSubscription` | query | `string \| null` | no |  |

Responses:

- `200` Successful Response
- `422` Validation Error (`HTTPValidationError`)

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/symbols/EURUSD/current-price' \
  -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/symbols/EURUSD/current-price",
    )
    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/symbols/EURUSD/current-price");
console.log(result);
tw.close();
```

### GET /users/current/accounts/{account_id}/symbols/{symbol}/current-tick

**Current Tick**

Auth: `auth-token`

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `account_id` | path | `string` | yes |  |
| `symbol` | path | `string` | yes |  |
| `keepSubscription` | query | `string \| null` | no |  |

Responses:

- `200` Successful Response
- `422` Validation Error (`HTTPValidationError`)

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/symbols/EURUSD/current-tick' \
  -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/symbols/EURUSD/current-tick",
    )
    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/symbols/EURUSD/current-tick");
console.log(result);
tw.close();
```

### GET /users/current/accounts/{account_id}/symbols/{symbol}/specification

**Specification**

Auth: `auth-token`

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `account_id` | path | `string` | yes |  |
| `symbol` | path | `string` | yes |  |

Responses:

- `200` Successful Response
- `422` Validation Error (`HTTPValidationError`)

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/symbols/EURUSD/specification' \
  -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/symbols/EURUSD/specification",
    )
    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/symbols/EURUSD/specification");
console.log(result);
tw.close();
```

### POST /users/current/accounts/{account_id}/symbols/{symbol}/unsubscribe

**Unsubscribe**

Auth: `auth-token`

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `account_id` | path | `string` | yes |  |
| `symbol` | path | `string` | yes |  |

Responses:

- `200` Successful Response
- `422` Validation Error (`HTTPValidationError`)

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 POST 'https://api.tickwire.io/users/current/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/unsubscribe' \
  -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(
        "POST",
        "/users/current/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/unsubscribe",
        idempotency_key="my-request-1",
        reason="why you are doing this",
    )
    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("POST", "/users/current/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/unsubscribe", {
  idempotencyKey: "my-request-1",
  reason: "why you are doing this",
});
console.log(result);
tw.close();
```
