Type Alias PriceConversionV2Data

PriceConversionV2Data: {
    headers?: {
        x-cmc_pro_api_key?: string;
    };
    query?: {
        amount?: string;
        convert?: string;
        convert_id?: string;
        id?: string;
        symbol?: string;
        time?: string;
    };
}

Type declaration

  • Optionalheaders?: {
        x-cmc_pro_api_key?: string;
    }
    • Optionalx-cmc_pro_api_key?: string

      Provide your API Key here

  • Optionalquery?: {
        amount?: string;
        convert?: string;
        convert_id?: string;
        id?: string;
        symbol?: string;
        time?: string;
    }
    • Optionalamount?: string

      (Required) An amount of currency to convert. Example: 10.43

    • Optionalconvert?: string

      Pass up to 120 comma-separated fiat or cryptocurrency symbols to convert the source amount to.

    • Optionalconvert_id?: string

      Optionally calculate market quotes by CoinMarketCap ID instead of symbol. This option is identical to convert outside of ID format. Ex: convert_id=1,2781 would replace convert=BTC,USD in your query. This parameter cannot be used when convert is used.

    • Optionalid?: string

      The CoinMarketCap currency ID of the base cryptocurrency or fiat to convert from. Example: "1"

    • Optionalsymbol?: string

      Alternatively the currency symbol of the base cryptocurrency or fiat to convert from. Example: "BTC". One "id" or "symbol" is required. Please note that starting in the v2 endpoint, due to the fact that a symbol is not unique, if you request by symbol each quote response will contain an array of objects containing all of the coins that use each requested symbol. The v1 endpoint will still return a single object, the highest ranked coin using that symbol.

    • Optionaltime?: string

      Optional timestamp (Unix or ISO 8601) to reference historical pricing during conversion. If not passed, the current time will be used. If passed, we'll reference the closest historic values available for this conversion.