Get Exchange Rate By Asset Symbols

Through this endpoint customers can obtain exchange rates by asset symbols. The process represents the exchange rate value of a single unit of one asset versus another one. Data is provided per unique asset symbol.

GET /market-data/exchange-rates/by-symbols/{fromAssetSymbol}/{toAssetSymbol}

Path Parameters

  • Required
    fromAssetSymbol string

    Defines the base asset symbol to get a rate for.

    Example : btc
  • Required
    toAssetSymbol string

    Defines the relation asset symbol in which the base asset rate will be displayed.

    Example : usd

Query parameters

  • Optional
    context string

    In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. context is specified by the user.

  • Optional
    calculationTimestamp integer

    Defines the time of the market data used to calculate the exchange rate in UNIX Timestamp.

    Example : 1618577849

Response schema

200 400 401 402 403 409 415 422 429 500
HTTP Status Code: 200
Content-Type: application/json

The request has been successful.

  • Object :

  • Required
    apiVersion string

    Specifies the version of the API that incorporates this endpoint.

    Example : 2.0
  • Required
    requestId string

    Defines the ID of the request. The requestId is generated by Crypto APIs and it's unique for every request.

    Example : 601c1710034ed6d407996b30
  • Optional
    context string

    In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. context is specified by the user.

    Example : You can add any text here
  • Required
    data object
    • Required
      item object
      • Required
        calculationTimestamp integer

        Defines the time of the market data used to calculate the exchange rate in UNIX Timestamp.

        Example : 1618577849
      • Required
        fromAssetId string

        Defines the base asset Reference ID to get a rate for.

        Example : 5b1ea92e584bf50020130612
      • Required
        fromAssetSymbol string

        Defines the base asset symbol to get a rate for.

        Example : BTC
      • Required
        rate string

        Defines the exchange rate between assets calculated by weighted average of the last trades in every exchange for the last 24 hours by giving more weight to exchanges with higher volume.

        Example : 54768.26745499848
      • Required
        toAssetId string

        Defines the relation asset Reference ID in which the base asset rate will be displayed.

        Example : 5b1ea92e584bf50020130615
      • Required
        toAssetSymbol string

        Defines the relation asset symbol in which the base asset rate will be displayed.

        Example : USD
Try it out

Request Example

GET
https://rest.cryptoapis.io/v2/market-data/exchange-rates/by-symbols/btc/usd?calculationTimestamp=1618577849
Headers
Host: https://rest.cryptoapis.io/v2
Content-Type: application/json
X-API-Key: my-api-key

Response Example

{
    "apiVersion": "2.0",
    "requestId": "601c1710034ed6d407996b30",
    "context": "You can add any text here",
    "data": {
        "item": {
            "calculationTimestamp": 1618577849,
            "fromAssetId": "5b1ea92e584bf50020130612",
            "fromAssetSymbol": "BTC",
            "rate": "54768.26745499848",
            "toAssetId": "5b1ea92e584bf50020130615",
            "toAssetSymbol": "USD"
        }
    }
}