Skip to main content

CoinAPI Data Source

CoinAPI provides real-time and historical cryptocurrency market data from 400+ exchanges worldwide, including OHLCV candlesticks, tick-by-tick trades, exchange rates, order book snapshots, and symbol metadata — all delivered through a single normalized REST API. Follow the instructions below to create a new data flow that ingests data from a CoinAPI source in Nexla.
coin_api.png

CoinAPI

Create a New Data Flow

  1. To create a new data flow, navigate to the Integrate section, and click the New Data Flow button. Then, select the desired flow type from the list, and click the Create button.

  2. Select the CoinAPI connector tile from the list of available connectors. Then, select the credential that will be used to connect to the CoinAPI instance, and click Next; or, create a new CoinAPI credential for use in this flow.

  3. In Nexla, CoinAPI data sources can be created using pre-built endpoint templates, which expedite source setup for common CoinAPI endpoints. Each template is designed specifically for the corresponding CoinAPI endpoint, making source configuration easy and efficient.
    • To configure this source using a template, follow the instructions in Configure Using a Template.

    CoinAPI sources can also be configured manually, allowing you to ingest data from CoinAPI endpoints not included in the pre-built templates or apply further customizations to exactly suit your needs.
    • To configure this source manually, follow the instructions in Configure Manually.

Configure Using a Template

Nexla provides pre-built templates that can be used to rapidly configure data sources to ingest data from common CoinAPI endpoints. Each template is designed specifically for the corresponding CoinAPI endpoint, making data source setup easy and efficient.

Endpoint Settings

  • Select the endpoint from which this source will fetch data from the Endpoint pulldown menu. Available endpoint templates are listed in the expandable boxes below. Click on an endpoint to see more information about it and how to configure your data source for this endpoint.

    OHLCV Historical Data

    Retrieves historical OHLCV (Open, High, Low, Close, Volume) candlestick data for a specific trading symbol and time period. Use this endpoint when you need to analyze price history, build charts, backtest trading strategies, or run quantitative analysis on cryptocurrency market data.

    • Enter the symbol identifier for the trading pair in the Symbol ID field. CoinAPI symbol IDs follow the format EXCHANGE_SPOT_BASE_QUOTE — for example, COINBASE_SPOT_BTC_USD for Bitcoin/USD on Coinbase, or BINANCE_SPOT_ETH_USDT for Ethereum/USDT on Binance. A full list of available symbols can be retrieved using the List Symbols endpoint.

    • Select the candle period from the Period ID field. CoinAPI supports a wide range of periods including:

      • 1SEC, 5SEC, 10SEC, 15SEC, 30SEC — sub-minute intervals
      • 1MIN, 2MIN, 3MIN, 5MIN, 10MIN, 15MIN, 30MIN — minute intervals
      • 1HRS, 2HRS, 3HRS, 4HRS, 6HRS, 8HRS, 12HRS — hourly intervals
      • 1DAY, 2DAY, 3DAY, 5DAY, 7DAY, 10DAY — daily intervals
      • 1MTH, 2MTH, 3MTH, 4MTH, 6MTH — monthly intervals
      • 1YRS, 2YRS, 3YRS, 4YRS, 5YRS — yearly intervals
    • Enter the start of the requested time range in the Time Start field using ISO 8601 format (for example, 2024-01-01T00:00:00). This is a required field.
    • Optionally, enter the end of the requested time range in the Time End field using ISO 8601 format. If left blank, CoinAPI will return data from Time Start up to the current time.
    • Optionally, enter the maximum number of candles to return in the Limit field. CoinAPI's default is 100 candles per request. Increasing this value retrieves more data per call; your plan's rate limits apply.

    OHLCV data availability varies by exchange and symbol. Some exchanges may have gaps in historical data for older periods. Consult the CoinAPI documentation at docs.coinapi.io/market-data/rest-api/ohlcv/ for full details on available periods and coverage.

    List Trades (Historical)

    Retrieves tick-by-tick historical trade executions for a specific symbol over a specified time range. Each trade record includes symbol ID, exchange time, CoinAPI normalized time, price, size (volume), a unique UUID, and the taker side (buy/sell). Use this endpoint for high-precision analysis, transaction-level auditing, or building order flow metrics.

    • Enter the symbol identifier in the Symbol ID field using the CoinAPI format, for example KRAKEN_SPOT_BTC_USD.
    • Enter the start timestamp for the trade history range in the Time Start field using ISO 8601 format (for example, 2024-06-01T00:00:00).
    • Optionally, enter the end timestamp in the Time End field. If omitted, trades through the current time are returned.
    • Optionally, set the Limit field to control the maximum number of trades returned per request. Defaults to 100; maximum is plan-dependent.

    Trade-level data produces large volumes of records for active symbols. Consider using a narrower time range or applying a reasonable limit when working with high-frequency pairs.

    Get Exchange Rate

    Returns the current or historical exchange rate between any two assets (assets can be cryptocurrency or fiat currency). CoinAPI calculates rates by aggregating cross-rates across all available exchanges. Use this endpoint for currency conversion, pricing, or portfolio valuation workflows.

    • Enter the base asset code in the Asset ID Base field, for example BTC, ETH, or USD.
    • Enter the quote asset code in the Asset ID Quote field, for example USD, EUR, or USDT.
    • Optionally, enter a specific timestamp in the Time field using ISO 8601 format to retrieve the historical exchange rate at that point in time. If left blank, the current exchange rate is returned.

    Asset codes use the CoinAPI asset ID format. A full list of supported assets is available at docs.coinapi.io/market-data/rest-api/metadata/.

    List All Exchange Rates for a Base Asset

    Returns the current exchange rates for a given base asset against all available quote assets in a single response. This is the most efficient way to retrieve a complete snapshot of an asset's value across all supported currencies at once, and is particularly useful for portfolio valuation and multi-currency reporting.

    • Enter the base asset code in the Asset ID Base field, for example BTC or ETH.
    • Optionally, enter a specific timestamp in the Time field using ISO 8601 format to retrieve historical rates at that point in time. Omitting this field returns current rates.

    List Symbols

    Returns metadata for all trading symbols available through CoinAPI, including symbol IDs, exchange IDs, base and quote asset codes, and data availability dates. Use this endpoint to discover available trading pairs and verify which symbols have historical data coverage for the exchanges and assets you need.

    • Optionally, filter results by entering an exchange ID in the Filter Exchange ID field (for example, COINBASE, BINANCE, or KRAKEN). Leaving this field blank returns metadata for all symbols across all exchanges.
    • Optionally, filter by asset by entering an asset ID in the Filter Asset ID field (for example, BTC or ETH). This returns only symbols that include the specified asset as either the base or quote.
    • Optionally, filter by symbol type using the Filter Symbol Type field. Valid values include SPOT, FUTURES, PERPETUAL, and OPTION.

    The List Symbols endpoint returns a large dataset. Using filters is recommended to limit the response to the exchanges, assets, or symbol types relevant to your use case. The full symbols list is also available in the CoinAPI documentation at docs.coinapi.io/market-data/rest-api/metadata/.

    List Assets

    Returns metadata for all assets (cryptocurrencies and fiat currencies) tracked by CoinAPI, including asset IDs, names, and whether each is a cryptocurrency. Use this endpoint to build reference tables, populate dropdowns in downstream applications, or understand the universe of assets available in CoinAPI.

    • Optionally, filter results by entering one or more asset IDs in the Filter Asset ID field (for example, BTC, ETH, or USD) to retrieve metadata for specific assets only.

    List Exchanges

    Returns metadata for all cryptocurrency exchanges supported by CoinAPI, including exchange IDs, names, website URLs, and the data types available (trades, quotes, order book, OHLCV). Use this endpoint to identify supported exchanges and confirm data availability before configuring other endpoints.

    • Optionally, filter results by entering one or more exchange IDs in the Filter Exchange ID field (for example, BINANCE or COINBASE). Leaving this blank returns all supported exchanges.

    CoinAPI supports 400+ exchanges. Refer to the full exchange list in the CoinAPI documentation at docs.coinapi.io/market-data/rest-api/metadata/ for exchange IDs and supported data types.

    Get Current Order Book

    Returns the current order book snapshot for a specific symbol, including the top bid and ask levels with prices and sizes. Use this endpoint for real-time market depth analysis, liquidity assessments, or monitoring spread and order book imbalance.

    • Enter the symbol identifier in the Symbol ID field using the CoinAPI format, for example COINBASE_SPOT_BTC_USD.
    • Optionally, enter the number of order book levels to return in the Limit Levels field. By default, CoinAPI returns up to 20 levels per side. Higher values provide deeper order book visibility at the cost of larger response payloads.

    Order book data availability (L2 vs. L3 depth) depends on the exchange. L3 (full order book with individual order IDs) is available only for selected exchanges including BITSO and COINBASE. For other exchanges, only aggregated L2 order book data is available.

Endpoint Testing

Once the selected endpoint template has been configured, Nexla can retrieve a sample of the data that will be fetched according to the current settings. This allows users to verify that the source is configured correctly before saving.

  • To test the current endpoint configuration, click the Test button to the right of the endpoint selection menu. Sample data will be fetched & displayed in the Endpoint Test Result panel on the right.

  • If the sample data is not as expected, review the selected endpoint and associated settings, and make any necessary adjustments. Then, click the Test button again, and check the sample data to ensure that the correct information is displayed.

Configure Manually

CoinAPI data sources can be manually configured to ingest data from any valid CoinAPI REST API endpoint. Manual configuration provides maximum flexibility for accessing endpoints not covered by pre-built templates or when you need custom API configurations.

With manual configuration, you can also create more complex CoinAPI sources, such as sources that use chained API calls to fetch data from multiple endpoints or sources that require custom authentication headers or request parameters.

API Method

  1. To manually configure this source, select the Advanced tab at the top of the configuration screen.

  2. Select the API method that will be used for calls to the CoinAPI API from the Method pulldown menu. CoinAPI's Market Data REST API exclusively uses GET for data retrieval. The most common methods are:

    • GET: For retrieving data from the API (used by all CoinAPI Market Data endpoints)
    • POST: Not used for standard CoinAPI Market Data queries

API Endpoint URL

  1. Enter the URL of the CoinAPI API endpoint from which this source will fetch data in the Set API URL field. The CoinAPI base URL is https://rest.coinapi.io/v1/. Some example endpoint URLs include:

    • OHLCV data: https://rest.coinapi.io/v1/ohlcv/COINBASE_SPOT_BTC_USD/history?period_id=1DAY&time_start=2024-01-01
    • Latest trades: https://rest.coinapi.io/v1/trades/BINANCE_SPOT_ETH_USDT/latest
    • Exchange rate: https://rest.coinapi.io/v1/exchangerate/BTC/USD
    • Symbol list: https://rest.coinapi.io/v1/symbols?filter_exchange_id=COINBASE

CoinAPI also provides region-specific endpoints to reduce latency. If your use case requires lower latency, consult the CoinAPI documentation at docs.coinapi.io/market-data/rest-api/ for available regional endpoint URLs.

Date/Time Macros (API URL)

Optional

Optionally, the API URL can be customized using macros—all macros added to the API URL will be converted into values when Nexla executes the API call. Macros are dynamic placeholders that allow you to create flexible API endpoints that can adapt to different time periods or data requirements.

Date/time macros are especially useful for CoinAPI endpoints that accept time_start and time_end query parameters, enabling you to configure incremental data pulls that automatically advance with each execution.

  1. To add a macro, type { at the appropriate position in the API URL (within the Set API URL field), and select the desired macro from the dropdown list.

    • {now} – The current datetime
    • {now-1} – The datetime one time unit before the current datetime
    • {now+1} – The datetime one time unit after the current datetime
    • custom – Datetime macros can reference any number of time units before or after the current datetime—for example, enter (now-4) to indicate the datetime four time units before the current datetime
  2. Select the format that will be applied to datetime macros from the Date Format for Date/Time Macro pulldown menu. This format will be applied to the base datetime value of the macro—i.e., the value of {now} in {now-1}. CoinAPI accepts ISO 8601 format (for example, yyyy-MM-dd'T'HH:mm:ss).

  3. Select the datetime unit that will be used to perform mathematical operations in the included macro(s) from the Time Unit for Operations pulldown menu—for example, for the macro {now-1}, when Day is selected, {now-1} will be converted to the datetime one day before the current datetime.

Lookup-Based Macros (API URL)

Optional

Column values from existing lookups can also be included as macros in the API URL. Lookup-based macros allow you to reference data from previously configured data sources or lookups, enabling dynamic API endpoints that can adapt based on existing data.

Lookup-based macros are useful when, for example, you need to iterate over a list of symbol IDs retrieved from the List Symbols endpoint to fetch OHLCV or trade data for each one.

  1. To include a lookup column value macro, select the relevant lookup from the Add Lookups to Supported Macros pulldown menu.

  2. Type { at the appropriate position in the API URL, and select the lookup column-based macro from the dropdown list. Lookup-based macros are automatically populated into the macro list when a lookup is selected in the Add Lookups to Supported Macros pulldown menu.

Path to Data

Optional

If only a subset of the data that will be returned by API endpoint is needed, you can designate the part(s) of the response that should be included in the Nexset(s) produced from this source by specifying the path to the relevant data within the response. This is particularly useful when CoinAPI responses contain metadata, pagination information, or other data that you don't need for your analysis.

For example, CoinAPI's OHLCV endpoint returns a JSON array at the top level where each element is a candle record. By setting the path to data, you can configure Nexla to treat each array element as an individual record.

Path to Data is essential when API responses have nested structures. Without specifying the correct path, Nexla might not be able to properly parse and organize your data into usable records.

  • To specify which data should be treated as relevant in responses from this source, enter the path to the relevant data in the Set Path to Data in Response field.

    • For responses in JSON format enter the JSON path that points to the object or array that should be treated as relevant data. JSON paths use dot notation (for example, $[*] to access a top-level array, or $.data[*] to access an array nested under a data key).

    • For responses in XML format, enter the XPath that points to the object/array containing relevant data.

    Path to Data Example:

    CoinAPI OHLCV and trade responses return a top-level JSON array where each element is a record. The path to the relevant data in these responses would be entered as $[*].

Autogenerate Path Suggestions

Nexla can also autogenerate data path suggestions based on the response from the API endpoint. These suggested paths can be used as-is or modified to exactly suit your needs.

  • To use this feature, click the Test button next to the Set API URL field to fetch a sample response from the API endpoint. Suggested data paths generated based on the content & format of the response will be displayed in the Suggestions box below the Set Path to Data in Response field.

  • Click on a suggestion to automatically populate the Set Path to Data in Response field with the corresponding path. The populated path can be modified directly within the field if further customization is needed.

    PathSuggestions.png

Metadata

If metadata is included in the response but is located outside of the defined path to relevant data, you can configure Nexla to include this data as common metadata in each record. This is useful when you want to preserve important contextual information that applies to all records but isn't part of the main data array.

For example, some CoinAPI endpoints include top-level fields such as symbol_id or time_period_start alongside the data array. If you have specified the path to the relevant data array but want to include those top-level fields with each record, you can specify a metadata path to capture them.

Metadata paths are particularly useful for preserving API response context like request IDs, timestamps, or summary statistics that apply to all records in the response.

  • To specify the location of metadata that should be included with each record, enter the path to the relevant metadata in the Path to Metadata in Response field.

    • For responses in JSON format, enter the JSON path to the object or array that contains the metadata, and for responses in XML format, enter the XPath.

Request Headers

Optional
  • If Nexla should include any additional request headers in API calls to this source, enter the headers & corresponding values as comma-separated pairs in the Request Headers field (for example, header1:value1,header2:value2). Additional headers are often required for API versioning, content type specifications, or custom authentication requirements.

    You do not need to include the X-CoinAPI-Key authentication header here — that header is added automatically by Nexla using the credentials configured for this data source. You also do not need to set Accept: application/json as that is added automatically. A common reason to add a custom header for CoinAPI is to request responses in a specific data format, such as Accept: text/csv for CSV output on supported endpoints.

Endpoint Testing

After configuring all settings for the selected endpoint, Nexla can retrieve a sample of the data that will be fetched according to the current configuration. This allows users to verify that the source is configured correctly before saving.

  • To test the current endpoint configuration, click the Test button to the right of the endpoint selection menu. Sample data will be fetched & displayed in the Endpoint Test Result panel on the right.

  • If the sample data is not as expected, review the selected endpoint and associated settings, and make any necessary adjustments. Then, click the Test button again, and check the sample data to ensure that the correct information is displayed.

Save & Activate the Source

  1. Once all of the relevant steps in the above sections have been completed, click the Create button in the upper right corner of the screen to save and create the new CoinAPI data source. Nexla will now begin ingesting data from the configured endpoint and will organize any data that it finds into one or more Nexsets.