Active Orders
Endpoint
GET /active-orders
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
skip | int32 | Yes | Number of orders to skip (for pagination) |
take | int32 | Yes | Number of orders to retrieve. Maximum is 100 . |
Headers
Header | Type | Required | Description |
---|---|---|---|
session-token | string | Yes | Authorization token. |
api-key | string | Yes | API key for user authentication. |
Note: You must provide either session-token
or api-key
in the headers for authentication.
Response
JSON Array of Objects
Response Fields
Field | Type | Description |
---|---|---|
o | string | Order ID. |
g | string | Linked Order ID. |
s | string | Symbol name (e.g., ETH_USDT ). |
p | string | Limit Price. |
c | string | Stop Price. |
v | string | Size of the order (amount of base currency). |
b | string | Budget (amount of quote currency). |
f | string | Filled amount (amount of base currency already matched). |
q | string | Purchased amount (amount of quote currency already bought/sold). |
a | int32 | Order Action |
t | int32 | Order Type |
e | int32 | Original Order Type |
r | int32 | Order Status |
u | string | User ID. |
w | string | Created time (timestamp in milliseconds). |
d | string | Last updated time (timestamp in milliseconds). |
z | string | Trigger time (timestamp in milliseconds). |
h | int32 | Trigger Direction |
Example Usage
- cURL
- ReactJS
- React Native
- Node.js
- Java
- C#
- Python
- Go
- Rust
curl --location 'https://spot-markets.goonus.io/active-orders?skip=0&take=100' \
--header 'session-token: xxx'
import React, { useEffect, useState } from 'react';
function ActiveOrders() {
const [data, setData] = useState(null);
useEffect(() => {
fetch('https://spot-markets.goonus.io/active-orders?skip=0&take=100', {
headers: {
'session-token': 'xxx'
}
})
.then(response => response.json())
.then(setData)
.catch(error => console.error('Error:', error));
}, []);
return (
<div>
<h1>Active Orders</h1>
<pre>{data ? JSON.stringify(data, null, 2) : 'Loading...'}</pre>
</div>
);
}
export default ActiveOrders;
import { useEffect } from 'react';
import { Text, View } from 'react-native';
const fetchData = async () => {
try {
const response = await fetch('https://spot-markets.goonus.io/active-orders?skip=0&take=100', {
headers: {
'session-token': 'xxx'
}
});
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
};
export default function App() {
useEffect(() => {
fetchData();
}, []);
return (
<View>
<Text>Check console for API data.</Text>
</View>
);
}
const axios = require('axios');
axios.get('https://spot-markets.goonus.io/active-orders', {
params: {
skip: 0,
take: 100
},
headers: {
'session-token': 'xxx'
}
})
.then(response => console.log(response.data))
.catch(error => console.error('Error:', error));
import java.net.http.*;
import java.net.URI;
public class ActiveOrders {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://spot-markets.goonus.io/active-orders?skip=0&take=100"))
.header("session-token", "xxx")
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program {
static async Task Main(string[] args) {
var client = new HttpClient();
client.DefaultRequestHeaders.Add("session-token", "xxx");
var response = await client.GetStringAsync("https://spot-markets.goonus.io/active-orders?skip=0&take=100");
Console.WriteLine(response);
}
}
import requests
url = "https://spot-markets.goonus.io/active-orders"
params = {"skip": 0, "take": 100}
headers = {"session-token": "xxx"}
response = requests.get(url, params=params, headers=headers)
print(response.json())
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://spot-markets.goonus.io/active-orders?skip=0&take=100"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("session-token", "xxx")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
use reqwest;
use tokio;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = reqwest::Client::new();
let resp = client
.get("https://spot-markets.goonus.io/active-orders")
.query(&[ ("skip", "0"), ("take", "100") ])
.header("session-token", "xxx")
.send()
.await?
.text()
.await?;
println!("{}", resp);
Ok(())
}
Response Example
[
{
"o": "7217339258215330666",
"s": "ETH_USDT",
"p": "1.0000000",
"v": "0.170",
"b": null,
"f": null,
"q": null,
"a": 1,
"t": 0,
"r": 0,
"u": "1",
"w": "1720747770838",
"d": "1720747770838"
},
{
"o": "7217339023736825805",
"s": "ETH_USDT",
"p": "4.0000000",
"v": "0.010",
"b": null,
"f": null,
"q": null,
"a": 0,
"t": 0,
"r": 0,
"u": "1",
"w": "1720747714936",
"d": "1720747714936"
},
{
"o": "7217339067281847805",
"s": "ETH_USDT",
"p": "5.0000000",
"v": "0.130",
"b": null,
"f": null,
"q": null,
"a": 0,
"t": 0,
"r": 0,
"u": "1",
"w": "1720747725318",
"d": "1720747725318"
}
]