# Community Exchange API Documentation

## Exchange Info

<mark style="color:blue;">`GET`</mark> `https://api.new.capital/v1/exchangeInfo`

Current exchange trading rules and symbol information

{% tabs %}
{% tab title="200 Cake successfully retrieved." %}

```javascript
{
  "timezone": "UTC",
  "serverTime": 1561977363,
  "symbols": [{
    "symbol": "FIX_TWINS",
    "baseAsset": "FIX",
    "baseAssetPrecision": 8,
    "quoteAsset": "TWINS",
    "baseAssetName":"FIX Network",
    "quotePrecision": 4,
    "orderTypes": [
      // These are defined in the `ENUM definitions` section under `Order types (orderTypes)`.
      // All orderTypes are optional.
    ],
    "24h_volume":{"BTC":"0.03242766","TWINS":"423731.95413994"},
    "usd_price":{"BTC":"11395.58","TWINS":"0.000872"}}
  }]
}
```

{% endtab %}

{% tab title="404 Could not find matching in this query." %}

```javascript
{
    "message": "Not Found"
}
```

{% endtab %}
{% endtabs %}

## 24hr ticker price change statistics

<mark style="color:blue;">`GET`</mark> `https://api.new.capital/v1/ticker`

24-hour rolling window price change statistics. **Careful** when accessing this with no symbol.

#### Query Parameters

| Name   | Type   | Description    |
| ------ | ------ | -------------- |
| symbol | string | ex: FIX\_TWINS |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "symbol": "FIX_TWINS",
  "priceChange": "0.0000",
  "priceChangePercent": "0",
  "prevClosePrice": "0.10002000",
  "lastPrice": "0.0000",
  "bidPrice": "1000.0000",
  "askPrice": "0",
  "openPrice": "0",
  "highPrice": "0.0000",
  "lowPrice": "0.0000",
  "volume": "0.0000",
  "quoteVolume": ".00000000",
  "openTime": 0,
  "closeTime": 0,
  "firstId": 0,   // First tradeId
  "lastId": 0,    // Last tradeId
  "count": 0         // Trade count
}

```

{% endtab %}
{% endtabs %}

## Recent trades list

<mark style="color:blue;">`GET`</mark> `https://api.new.capital/v1/trades`

Get recent trades (up to last 500).

#### Query Parameters

| Name   | Type    | Description           |
| ------ | ------- | --------------------- |
| limit  | integer | Default 500; max 1000 |
| symbol | string  | ex: BTC\_TWINS        |

{% tabs %}
{% tab title="200 " %}

```java
[
  {
    "id": 77,
    "price": "30000000",
    "qty": "0.00788029",
    "quoteQty":"236408.69999998"
    "time": 1561709280
  }
]
```

{% endtab %}
{% endtabs %}

## Order book

<mark style="color:blue;">`GET`</mark> `https://api.new.capital/v1/depth`

Get asks and bids<br>

#### Query Parameters

| Name   | Type    | Description            |
| ------ | ------- | ---------------------- |
| limit  | integer | Default 100; max 1000. |
| symbol | string  | ex: BTC\_TWINS         |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "bids": [
    [
      "21000000",     // PRICE
      "0.00014285"    // QTY
    ]
  ],
  "asks": [
    [
      "21500000",
      "0.00011637"
    ]
  ]
}
```

{% endtab %}
{% endtabs %}
