> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hotstuff.trade/llms.txt
> Use this file to discover all available pages before exploring further.

# account_history

> Send POST request to /info with method: "account_history"

Retrieve historical account data including total PnL, total volume, account value, and timestamps for a user.

```bash cURL theme={null}
curl --request POST \
  --url https://api.hotstuff.trade/info \
  --header 'Content-Type: application/json' \
  --data '{
    "method": "account_history",
    "params": {
        "user": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
    }
}'
```

```python Python theme={null}
import requests

url = "https://api.hotstuff.trade/info"
payload = {
    "method": "account_history",
    "params": {
        "user": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
    }
}
response = requests.post(url, json=payload)
print(response.json())
```

```javascript Javascript theme={null}
const url = "https://api.hotstuff.trade/info";
const payload = {
  method: "account_history",
  params: {
    user: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
  },
};

fetch(url, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify(payload),
})
  .then((response) => response.json())
  .then((data) => console.log(data));
```

```php PHP theme={null}
<?php
$url = "https://api.hotstuff.trade/info";
$payload = json_encode([
    "method" => "account_history",
    "params" => [
        "user" => "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
    ]
]);

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
$response = curl_exec($ch);
curl_close($ch);
print_r(json_decode($response, true));
?>
```

```go Go theme={null}
package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "io/ioutil"
    "net/http"
)

func main() {
    url := "https://api.hotstuff.trade/info"
    payload := map[string]interface{}{
        "method": "account_history",
        "params": map[string]string{
            "user": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
        },
    }

    jsonData, _ := json.Marshal(payload)
    resp, _ := http.Post(url, "application/json", bytes.NewBuffer(jsonData))
    defer resp.Body.Close()
    body, _ := ioutil.ReadAll(resp.Body)
    fmt.Println(string(body))
}
```

```java Java theme={null}
import java.net.HttpURLConnection;
import java.net.URL;
import java.io.*;

URL url = new URL("https://api.hotstuff.trade/info");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/json");
conn.setDoOutput(true);

String jsonPayload = "{\"method\":\"account_history\",\"params\":{\"user\":\"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\"}}";
OutputStream os = conn.getOutputStream();
os.write(jsonPayload.getBytes());
os.flush();

BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String response = in.readLine();
System.out.println(response);
```

```ruby Ruby theme={null}
require 'net/http'
require 'json'

uri = URI('https://api.hotstuff.trade/info')
payload = {
  method: "account_history",
  params: {
    user: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
  }
}

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.path, 'Content-Type' => 'application/json')
request.body = payload.to_json
response = http.request(request)
puts JSON.parse(response.body)
```


## OpenAPI

````yaml openapi/info/accounts/account-history.json POST /info
openapi: 3.0.3
info:
  title: Hotstuff Info API — account_history
  version: 1.0.0
servers:
  - url: https://api.hotstuff.trade
  - url: https://testnet-api.hotstuff.trade
security: []
paths:
  /info:
    post:
      summary: account_history
      operationId: infoAccountsaccount_history
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                method:
                  type: string
                params:
                  type: object
                  properties:
                    user:
                      type: string
                  required:
                    - user
              required:
                - method
                - params
              example:
                method: account_history
                params:
                  user: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'
            examples:
              default:
                summary: Example request
                value:
                  method: account_history
                  params:
                    user: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    address:
                      type: string
                    total_pnl:
                      type: string
                    total_volume:
                      type: integer
                    account_value:
                      type: string
                    created_at:
                      type: string
              example:
                - address: '0xdE66c594AF8e4AD2C62DcFadCb6714F8b176A4ef'
                  total_pnl: '-22970142.870113'
                  total_volume: 61310268146
                  account_value: '225475874.025176'
                  created_at: '2026-02-03T17:00:01.841Z'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
              example:
                error: <error message>

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.