Troubleshooting
Debugging the Python API Client
import os
from coinmetrics.api_client import CoinMetricsClient
api_key = os.environ['CM_API_KEY']
if __name__ == '__main__':
client = CoinMetricsClient(api_key=api_key, debug_mode=True)
reference_rates = client.get_asset_metrics(
assets=['btc', 'algo', 'eth'], metrics=['ReferenceRateUSD'],
)
for data in reference_rates:
continue[DEBUG] 2023-01-09 11:01:02,044 - Starting API Client debugging session. logging to stdout and cm_api_client_debug_2023_01_09_11_01_02.txt
[DEBUG] 2023-01-09 11:01:02,044 - Using coinmetrics version 2022.11.14.16
[DEBUG] 2023-01-09 11:01:02,044 - Current state of API Client, excluding API KEY: {'_verify_ssl_certs': True, '_api_base_url': 'https://api.coinmetrics.io/v4', '_ws_api_base_url': 'wss://api.coinmetrics.io/v4', '_http_header': {'Api-Client-Version': '2022.11.14.16'}, '_proxies': {'http': None, 'https': None}, 'debug_mode': True, 'verbose': False}
[DEBUG] 2023-01-09 11:01:02,044 - Attempting to call url: timeseries/asset-metrics with params: {'assets': ['btc', 'algo', 'eth'], 'metrics': ['ReferenceRateUSD'], ... }
[DEBUG] 2023-01-09 11:01:02,387 - Response status code: 200 for url: https://api.coinmetrics.io/v4/timeseries/asset-metrics?api_key=[REDACTED]&assets=btc%2Calgo%2Ceth&metrics=ReferenceRateUSD&paging_from=start took: 0:00:00.342874 response body size (bytes): 9832Common Errors
Proxy Error
SSLError: SSL Certificate Verification
400 Bad Parameter
401 Unauthorized
403 Forbidden
414 URI Too Long
429 Too Many Requests
Last updated
Was this helpful?