Get Exchange Rate By Assets IDs

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

Single Result - This endpoint returns only one single result. GET /market-data/exchange-rates/by-asset-ids/{fromAssetId}/{toAssetId}

Path Parameters

  • Required
    fromAssetId string

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

    Example : 5b1ea92e584bf50020130612
  • Required
    toAssetId string

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

    Example : 5b1ea92e584bf50020130615

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.

    Example : yourExampleString
  • Optional
    calculationTimestamp integer

    Defines the time of the market data used to calculate the exchange rate in UNIX Timestamp. Oldest possible timestamp is 30 days.

    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 successfull.

  • Object :

  • Required
    apiVersion string

    Specifies the version of the API that incorporates this endpoint.

    Example : 2023-04-25
  • 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 : yourExampleString
  • 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. Oldest possible timestamp is 30 days.

        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 : 54691.40481689715
      • 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

Credits Cost : 100 Credits For 1 Result(s)

Try it out

Request Example

GET
https://rest.cryptoapis.io/market-data/exchange-rates/by-asset-ids/5b1ea92e584bf50020130612/5b1ea92e584bf50020130615?context=yourExampleString&calculationTimestamp=1618577849
Headers
Content-Type: application/json
X-API-Key: my-api-key

Response Example

{
    "apiVersion": "2023-04-25",
    "requestId": "601c1710034ed6d407996b30",
    "context": "yourExampleString",
    "data": {
        "item": {
            "calculationTimestamp": 1618577849,
            "fromAssetId": "5b1ea92e584bf50020130612",
            "fromAssetSymbol": "BTC",
            "rate": "54691.40481689715",
            "toAssetId": "5b1ea92e584bf50020130615",
            "toAssetSymbol": "USD"
        }
    }
}