# Get user fills

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

POST https://api.g.alchemy.com/hypercore/v1/{apiKey}/user-fills

Retrieve fills associated with a user. Coming with HyperCore; this route is not yet callable.


Reference: https://www.alchemy.com/docs/data/hypercore/rest-api/hyper-core-data-api-endpoints/get-user-fills

## Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| apiKey | string | Yes |  |

## Code Examples

### cURL

```bash
curl --request POST \
  --url https://api.g.alchemy.com/hypercore/v1/string/user-fills \
  --header 'Content-Type: application/json' \
  --data '{
  "user": "string",
  "startTime": 1,
  "endTime": 1,
  "cursor": "string",
  "include": [
    "string"
  ],
  "type": "userFills"
}'
```

### JavaScript

```javascript
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    user: 'string',
    startTime: 1,
    endTime: 1,
    cursor: 'string',
    include: ['string'],
    type: 'userFills'
  })
};

fetch('https://api.g.alchemy.com/hypercore/v1/string/user-fills', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.g.alchemy.com/hypercore/v1/string/user-fills"

payload = {
    "user": "string",
    "startTime": 1,
    "endTime": 1,
    "cursor": "string",
    "include": ["string"],
    "type": "userFills"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

### Go

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.g.alchemy.com/hypercore/v1/string/user-fills"

	payload := strings.NewReader("{\n  \"user\": \"string\",\n  \"startTime\": 1,\n  \"endTime\": 1,\n  \"cursor\": \"string\",\n  \"include\": [\n    \"string\"\n  ],\n  \"type\": \"userFills\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
```

### Java

```java
HttpResponse<String> response = Unirest.post("https://api.g.alchemy.com/hypercore/v1/string/user-fills")
  .header("Content-Type", "application/json")
  .body("{\n  \"user\": \"string\",\n  \"startTime\": 1,\n  \"endTime\": 1,\n  \"cursor\": \"string\",\n  \"include\": [\n    \"string\"\n  ],\n  \"type\": \"userFills\"\n}")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://api.g.alchemy.com/hypercore/v1/string/user-fills");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n  \"user\": \"string\",\n  \"startTime\": 1,\n  \"endTime\": 1,\n  \"cursor\": \"string\",\n  \"include\": [\n    \"string\"\n  ],\n  \"type\": \"userFills\"\n}", false);
var response = await client.PostAsync(request);

Console.WriteLine("{0}", response.Content);

```


## Operation Specification

```yaml
path: /{apiKey}/user-fills
method: POST
operation:
  operationId: get-user-fills
  summary: Get user fills
  description: |
    Retrieve fills associated with a user. Coming with HyperCore; this route is not yet callable.
  parameters:
    - name: apiKey
      in: path
      required: true
      schema:
        type: string
  requestBody:
    required: true
    content:
      application/json:
        schema:
          allOf:
            - type: object
              required:
                - user
              properties:
                user:
                  type: string
                  pattern: ^0x[a-fA-F0-9]{40}$
                  description: EVM-style account address.
                startTime:
                  type: integer
                  format: int64
                  description: Unix timestamp in milliseconds.
                endTime:
                  type: integer
                  format: int64
                  description: Unix timestamp in milliseconds.
                cursor:
                  type: string
                  description: Opaque cursor. Store and return it unmodified; its format may change.
                include:
                  type: array
                  items:
                    type: string
            - type: object
              required:
                - type
              properties:
                type:
                  const: userFills
        examples:
          userFills:
            value:
              type: userFills
              user: '0x1111111111111111111111111111111111111111'
  responses:
    '200':
      description: Successful response.
      content:
        application/json:
          schema:
            type: object
            properties:
              fills:
                type: array
                items:
                  type: object
                  properties:
                    coin:
                      type: string
                    px:
                      type: string
                    sz:
                      type: string
                    side:
                      type: string
                      enum:
                        - A
                        - B
                    time:
                      type: integer
                      format: int64
                      description: Unix timestamp in milliseconds.
                    tid:
                      type: integer
                    oid:
                      type: integer
                    closedPnl:
                      type: string
                    fee:
                      type: string
                    feeToken:
                      type: string
          examples:
            default:
              value:
                fills:
                  - coin: BTC
                    px: '100000.0'
                    sz: '0.01'
                    side: B
                    time: 1780000000000
                    tid: 12345
                    oid: 54321
                    closedPnl: '0'
                    fee: '0.20'
                    feeToken: USDC
```
