# Get historical orders

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

POST https://api.g.alchemy.com/hypercore/v1/{apiKey}/historical-orders

Retrieve historical orders 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-historical-orders

## 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/historical-orders \
  --header 'Content-Type: application/json' \
  --data '{
  "user": "string",
  "startTime": 1,
  "endTime": 1,
  "cursor": "string",
  "include": [
    "string"
  ],
  "type": "historicalOrders"
}'
```

### 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: 'historicalOrders'
  })
};

fetch('https://api.g.alchemy.com/hypercore/v1/string/historical-orders', 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/historical-orders"

payload = {
    "user": "string",
    "startTime": 1,
    "endTime": 1,
    "cursor": "string",
    "include": ["string"],
    "type": "historicalOrders"
}
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/historical-orders"

	payload := strings.NewReader("{\n  \"user\": \"string\",\n  \"startTime\": 1,\n  \"endTime\": 1,\n  \"cursor\": \"string\",\n  \"include\": [\n    \"string\"\n  ],\n  \"type\": \"historicalOrders\"\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/historical-orders")
  .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\": \"historicalOrders\"\n}")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://api.g.alchemy.com/hypercore/v1/string/historical-orders");
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\": \"historicalOrders\"\n}", false);
var response = await client.PostAsync(request);

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

```


## Operation Specification

```yaml
path: /{apiKey}/historical-orders
method: POST
operation:
  operationId: get-historical-orders
  summary: Get historical orders
  description: |
    Retrieve historical orders 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: historicalOrders
  responses:
    '200':
      description: Successful response.
      content:
        application/json:
          schema:
            type: object
            properties:
              orders:
                type: array
                items:
                  type: object
                  properties:
                    orderId:
                      type: string
                    coin:
                      type: string
                    side:
                      type: string
                      enum:
                        - A
                        - B
                    limitPx:
                      type: string
                    sz:
                      type: string
                    status:
                      type: string
                    timestamp:
                      type: integer
                      format: int64
                      description: Unix timestamp in milliseconds.
          examples:
            default:
              value:
                orders:
                  - orderId: '54321'
                    coin: BTC
                    side: B
                    limitPx: '100000.0'
                    sz: '0.10'
                    status: filled
                    timestamp: 1780000000000
```
