---
agentTools:
  projectIndex: https://tokeninsight-api.readme.io/llms.txt
---

# Exchanges historical data

Retrieve crypto exchanges historical data including spot volume, derivatives volume and total volume.

🪣 *Call credit usage for this endpoint: 1 credit per 300 data points*

With this endpoint, you can get the historical data of any crypto exchange. Historical data includes

* 24-hour spot trading volume
* 24-hour derivatives trading volume
* open interest
* 24-hour total trading volume

The para and response are as follows

| variables    | type   | description                                                                                                                                                                  |
| ------------ | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| eid          | string | A unique ID to identify different exchanges. You can find the list of ids in [Retrieve exchanges list](https://tokeninsight-api.readme.io/reference/get_exchanges-list)      |
| days         | string | This para decides how many data points you will get in the response, and different lengths are supported for different intervals. The value should be between `1` and `365`. |
| vs\_currency | string | USD in default.                                                                                                                                                              |

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "description": "This is a simple API of fetching data from TI.",
    "title": "Tokeninsight API",
    "termsOfService": "https://tokeninsight.com/en/services",
    "contact": {
      "name": "API Support",
      "url": "https://twitter.com/TokenInsight"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
    },
    "version": "1.0"
  },
  "paths": {
    "/history/exchanges/{id}": {
      "get": {
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "description": "Retrieve crypto exchanges historical data including spot volume, derivatives volume and total volume.",
        "tags": [
          "history"
        ],
        "summary": "Exchanges historical data",
        "parameters": [
          {
            "description": "id of exchanges; e.g. binance",
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "1-365, 90 in default",
            "name": "days",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "usd in default",
            "name": "vs_currency",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "exchangeHistoryData",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/RespFormat"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/handlers.responseMarketChart"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/RespFailFormat"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "status": {
                          "$ref": "#/components/schemas/Status400"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/RespFailFormat"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "status": {
                          "$ref": "#/components/schemas/Status401"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/RespFailFormat"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "status": {
                          "$ref": "#/components/schemas/Status403"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/RespFailFormat"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "status": {
                          "$ref": "#/components/schemas/Status429"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/RespFailFormat"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "status": {
                          "$ref": "#/components/schemas/Status500"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://api.tokeninsight.com/api/v1"
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "name": "TI_API_KEY",
        "in": "header"
      }
    },
    "schemas": {
      "RespFailFormat": {
        "type": "object",
        "properties": {
          "status": {}
        }
      },
      "RespFormat": {
        "type": "object",
        "properties": {
          "data": {},
          "status": {
            "$ref": "#/components/schemas/Status200"
          }
        }
      },
      "Status200": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "example": 0
          },
          "message": {
            "type": "string",
            "example": ""
          },
          "timestamp": {
            "type": "integer",
            "example": 1640966400000
          }
        }
      },
      "Status400": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "example": 400
          },
          "message": {
            "type": "string",
            "example": "Invalid params"
          },
          "timestamp": {
            "type": "integer",
            "example": 1640966400000
          }
        }
      },
      "Status401": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "example": 401
          },
          "message": {
            "type": "string",
            "example": "TI_API_KEY missing."
          },
          "timestamp": {
            "type": "integer",
            "example": 1640966400000
          }
        }
      },
      "Status403": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "example": 403
          },
          "message": {
            "type": "string",
            "example": "Your TI_API_KEY  doesn't support this endpoint"
          },
          "timestamp": {
            "type": "integer",
            "example": 1640966400000
          }
        }
      },
      "Status429": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "example": 429
          },
          "message": {
            "type": "string",
            "example": "The key exceeds the frequency limit"
          },
          "timestamp": {
            "type": "integer",
            "example": 1640966400000
          }
        }
      },
      "Status500": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "example": 500
          },
          "message": {
            "type": "string",
            "example": "An internal server error occurred"
          },
          "timestamp": {
            "type": "integer",
            "example": 1640966400000
          }
        }
      },
      "handlers.formatUnitData": {
        "type": "object",
        "properties": {
          "market_cap": {
            "type": "number"
          },
          "price": {
            "type": "number"
          },
          "timestamp": {
            "type": "integer"
          },
          "vol_spot_24h": {
            "type": "number"
          }
        }
      },
      "handlers.responseMarketChart": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "logo": {
            "type": "string"
          },
          "market_chart": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/handlers.formatUnitData"
            }
          },
          "name": {
            "type": "string"
          },
          "symbol": {
            "type": "string"
          },
          "vs_currency": {
            "type": "string"
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 100,
      "1": 10,
      "2": 140,
      "3": 138,
      "4": 103,
      "5": 168,
      "6": 4,
      "7": 0,
      "8": 53,
      "9": 243,
      "10": 106,
      "11": 74
    }
  }
}
```