Skip to content
This repository was archived by the owner on Dec 1, 2025. It is now read-only.

Latest commit

 

History

History
186 lines (138 loc) · 8.78 KB

File metadata and controls

186 lines (138 loc) · 8.78 KB

cryptoapis.AssetsApi

All URIs are relative to https://rest.cryptoapis.io

Method HTTP request Description
get_asset_details_by_asset_id GET /market-data/assets/assetId/{assetId} Get Asset Details By Asset ID
get_asset_details_by_asset_symbol GET /market-data/assets/{assetSymbol} Get Asset Details By Asset Symbol

get_asset_details_by_asset_id

GetAssetDetailsByAssetIDR get_asset_details_by_asset_id(asset_id, context=context)

Get Asset Details By Asset ID

Through this endpoint users can obtain information on assets by assetId. The details returned could include information on the latest rate and rate fluctuation of different periods of time - 24 hours, a week, one hour, the encoding of the logo, and more.

Example

  • Api Key Authentication (ApiKey):
import time
import os
import cryptoapis
from cryptoapis.models.get_asset_details_by_asset_idr import GetAssetDetailsByAssetIDR
from cryptoapis.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://rest.cryptoapis.io
# See configuration.py for a list of all supported configuration parameters.
configuration = cryptoapis.Configuration(
    host = "https://rest.cryptoapis.io"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'

# Enter a context with an instance of the API client
with cryptoapis.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = cryptoapis.AssetsApi(api_client)
    asset_id = '5b1ea92e584bf50020130612' # str | Defines the unique ID of the specific asset.
    context = 'yourExampleString' # str | 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)

    try:
        # Get Asset Details By Asset ID
        api_response = api_instance.get_asset_details_by_asset_id(asset_id, context=context)
        print("The response of AssetsApi->get_asset_details_by_asset_id:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling AssetsApi->get_asset_details_by_asset_id: %s\n" % e)

Parameters

Name Type Description Notes
asset_id str Defines the unique ID of the specific asset.
context str 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]

Return type

GetAssetDetailsByAssetIDR

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 The request has been successful. -
400 400 -
401 401 -
402 You have insufficient credits. Please upgrade your plan from your Dashboard or contact our team via email. -
403 403 -
409 The data provided seems to be invalid. -
415 The selected Media Type is unavailable. The Content-Type header should be 'application/json'. -
422 Your request body for POST requests must have a structure of { data: { item: [...properties] } } -
429 The request limit has been reached. There can be maximum {requests} requests per {seconds} second(s) made. Please contact our team via email if you need more or upgrade your plan. -
500 An unexpected server error has occurred, we are working to fix this. Please try again later and in case it occurs again please report it to our team via email. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_asset_details_by_asset_symbol

GetAssetDetailsByAssetSymbolR get_asset_details_by_asset_symbol(asset_symbol, context=context)

Get Asset Details By Asset Symbol

Through this endpoint users can obtain information on assets by asset symbol. The details returned could include information on the latest rate and rate fluctuation of different periods of time - 24 hours, a week, one hour, the encoding of the logo, and more.

Example

  • Api Key Authentication (ApiKey):
import time
import os
import cryptoapis
from cryptoapis.models.get_asset_details_by_asset_symbol_r import GetAssetDetailsByAssetSymbolR
from cryptoapis.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://rest.cryptoapis.io
# See configuration.py for a list of all supported configuration parameters.
configuration = cryptoapis.Configuration(
    host = "https://rest.cryptoapis.io"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'

# Enter a context with an instance of the API client
with cryptoapis.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = cryptoapis.AssetsApi(api_client)
    asset_symbol = 'BTC' # str | Specifies the asset's unique symbol in the Crypto APIs listings.
    context = 'yourExampleString' # str | 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)

    try:
        # Get Asset Details By Asset Symbol
        api_response = api_instance.get_asset_details_by_asset_symbol(asset_symbol, context=context)
        print("The response of AssetsApi->get_asset_details_by_asset_symbol:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling AssetsApi->get_asset_details_by_asset_symbol: %s\n" % e)

Parameters

Name Type Description Notes
asset_symbol str Specifies the asset's unique symbol in the Crypto APIs listings.
context str 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]

Return type

GetAssetDetailsByAssetSymbolR

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 The request has been successful. -
400 400 -
401 401 -
402 You have insufficient credits. Please upgrade your plan from your Dashboard or contact our team via email. -
403 403 -
409 The data provided seems to be invalid. -
415 The selected Media Type is unavailable. The Content-Type header should be 'application/json'. -
422 Your request body for POST requests must have a structure of { data: { item: [...properties] } } -
429 The request limit has been reached. There can be maximum {requests} requests per {seconds} second(s) made. Please contact our team via email if you need more or upgrade your plan. -
500 An unexpected server error has occurred, we are working to fix this. Please try again later and in case it occurs again please report it to our team via email. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]