# List trades

GET https://api.bb.no/v1/trades

Lists the user's executed trades, newest first. When hasMore is true, pass
 nextBefore and nextBeforeId as before and beforeId to fetch the next page.

## Authentication

x-bb-api-key: Public part of your API key. Starts with `bb/public/`.

Or:

OAuth: Authorization: Bearer <access token>. Required scopes: api:trades:read.

[API keys and signing](https://barebitcoin.no/developers/authentication/api-keys)

## MCP

Also available as the MCP tool `list_trades`, which takes the parameters below as its arguments. See [MCP server](https://barebitcoin.no/developers/mcp#list-trades).

## Parameters

### pageSize

query parameter · integer · int32

Items per page (max 200). When set to 0, all matching trades are returned,
 except through MCP, where it defaults to 50.

### before

query parameter · string · date-time

Trades are listed newest first, so pagination walks backward in time. Only
 return trades created before this time. Can be used standalone to filter
 down to an end date; pass next_before from the previous response (together
 with next_before_id) to fetch the next page.

### beforeId

query parameter · string

Pagination cursor tiebreaker: when multiple trades share the same
 create_time, this ID breaks the tie. Pass next_before_id from the previous
 response. Requires 'before'; supplying 'before_id' alone is rejected.



## Examples

### API key

```sh
curl -X GET \
  https://api.bb.no/v1/trades \
  -H "x-bb-api-key: $BB_API_KEY"
```


### OAuth

```sh
curl -X GET \
  https://api.bb.no/v1/trades \
  -H "Authorization: Bearer $BB_TOKEN"
```



## Responses

### 200

OK

Example:

```json
{
  "trades": [
    {
      "id": "tr_01HVXHG9PMDKR3YQV4Z8W5T2BN",
      "accountId": "acc_01HQZX3V9KJ4M2P8R6T0W5Y7BC",
      "direction": "DIRECTION_BUY",
      "amountNok": "65000",
      "amountBtc": "0.10000000",
      "feeAmount": "455",
      "feeCurrency": "NOK",
      "createTime": "2024-02-01T10:22:36Z"
    }
  ],
  "hasMore": true,
  "nextBefore": "2026-01-01T12:00:00Z",
  "nextBeforeId": "string"
}
```

[ListTradesResponse](https://barebitcoin.no/developers/models/ListTradesResponse).

Source: https://barebitcoin.no/developers/api/orders/trades


## Model: ListTradesResponse





### trades

Type: array of Trade.





Items: [Trade](https://barebitcoin.no/developers/models/Trade).

### hasMore

Type: boolean.

Whether there are more trades to fetch.





### nextBefore

Type: string · date-time.

Pass as 'before' in the next request to fetch the next page.





### nextBeforeId

Type: string.

Pass as 'before_id' in the next request to fetch the next page.





## Model: Trade





### id

Type: string.







### accountId

Type: string.

The bitcoin account the trade belongs to.





### direction

Type: string · enum.



Values: DIRECTION_BUY, DIRECTION_SELL



### amountNok

Type: string.

Stringified decimal number: the NOK amount paid when buying, or received
 when selling.





### amountBtc

Type: string.

Stringified decimal number with 8 decimal places: the BTC amount received
 when buying, or sold when selling.





### feeAmount

Type: string.

Stringified decimal number. When the fee is zero, fee_currency may be
 empty.





### feeCurrency

Type: string.







### createTime

Type: string · date-time.





