> From TickerLayer docs, Perpetuals: https://tickerlayer.com/docs/products/perpetuals#perpetuals-last-trade
> REST base URL https://api.tickerlayer.com, API key in the `x-api-key` header. WebSocket wss://stream.tickerlayer.com?apiKey=YOUR_API_KEY. Full API reference: https://tickerlayer.com/llms-full.txt

## Last trade

**Endpoint:** `GET /perpetuals/trade/last/:symbol`

The most recent execution across sources, with the aggressor side when the source reports it.

### Path parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `symbol` | string | Yes | Perpetual contract symbol (for example XAUUSDT, TSMUSDT, BTCUSDT). Trimmed and uppercased before lookup. Retrieve the full list from GET /perpetuals/symbols. |

### Request

```bash
curl -sS "https://api.tickerlayer.com/perpetuals/trade/last/TSMUSDT" \
  -H "x-api-key: <YOUR_API_KEY>"
```

```python
import requests

res = requests.get(
    "https://api.tickerlayer.com/perpetuals/trade/last/TSMUSDT",
    headers={"x-api-key": "<YOUR_API_KEY>"},
)
print(res.json())
```

```javascript
const res = await fetch("https://api.tickerlayer.com/perpetuals/trade/last/TSMUSDT", {
  headers: { "x-api-key": "<YOUR_API_KEY>" },
});
const data = await res.json();
console.log(data);
```

```go
req, _ := http.NewRequest("GET", "https://api.tickerlayer.com/perpetuals/trade/last/TSMUSDT", nil)
req.Header.Set("x-api-key", "<YOUR_API_KEY>")
```

### Response

```json
{
  "symbol": "TSMUSDT",
  "price": 423.36,
  "size": 1.5,
  "side": "buy",
  "timestamp": 1789640506413
}
```

### Notes

Trades are the one per-event stream, so the trade tape runs on demand: a contract joins it when a client subscribes to its trades or when this route is called, and stays on it for ten minutes after the last request. The first call for a quiet contract can answer `404 no trade available`; the next print fills it. `side` is `buy`, `sell` or `null`. `403 perpetuals access not enabled for your account`: the account does not include Perpetuals. `404 unknown symbol`: the symbol is not in the perpetuals list. `404` with a `no ... available` message: the contract is known but has no live value right now.
