api-ninjas-com Crypto Price API

The Crypto Price API provides access to live market prices for several hundred different cryptocurrencies.

Operations 3

GET /v1/cryptopricehistorical Get historical OHLCV data for a cryptocurrency #
GET /v1/cryptoprice Get current price of a cryptocurrency #
GET /v1/cryptotreasury Get SEC-reported corporate crypto treasury holdings #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/api-ninjas-com:api-ninjas-com-crypto-price-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

api-ninjas-com-crypto-price-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Ninjas Crypto Price API
  description: 'Combined OpenAPI specification for every API Ninjas endpoint. Requests go to https://api.api-ninjas.com with an `X-Api-Key` header; get a free key at https://api-ninjas.com/register. Human-readable docs: https://api-ninjas.com/api. Index for LLMs: https://api-ninjas.com/llms.txt.'
  version: 1.0.0
  contact:
    name: API Ninjas
    url: https://api-ninjas.com
  license:
    name: Proprietary
servers:
- url: https://api.api-ninjas.com
  description: API Ninjas Production
security:
- ApiKeyAuth: []
tags:
- name: Crypto Price
  description: The Crypto Price API provides access to live market prices for several hundred different cryptocurrencies.
paths:
  /v1/cryptopricehistorical:
    get:
      tags:
      - Crypto Price
      summary: Get historical OHLCV data for a cryptocurrency
      description: Returns historical OHLCV candles for a cryptocurrency at a chosen interval and time range. Requires a `symbol` such as ETHUSDT. For the live price use /cryptoprice.
      operationId: getCryptoPriceHistorical
      parameters:
      - name: symbol
        in: query
        required: true
        description: Cryptocurrency symbol (e.g. ETHUSDT).
        schema:
          type: string
      - name: interval
        in: query
        required: false
        description: Time interval between data points. Default is 1h.
        schema:
          type: string
          enum:
          - 1m
          - 5m
          - 15m
          - 30m
          - 1h
          - 4h
          - 1d
          default: 1h
      - name: start
        in: query
        required: false
        description: Start timestamp in Unix seconds. If omitted, the most recent `limit` data points are returned.
        schema:
          type: integer
          format: int64
      - name: end
        in: query
        required: false
        description: End timestamp in Unix seconds. Defaults to now.
        schema:
          type: integer
          format: int64
      - name: limit
        in: query
        required: false
        description: Maximum number of data points to return. Default 100, maximum 1000.
        schema:
          type: integer
          minimum: 1
          maximum: 1000
          default: 100
      responses:
        '200':
          description: 'Successful response: an array of OHLCV candles in descending order (most recent first).'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CryptoPriceHistoricalCandle'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CryptoPriceOpenapi_ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CryptoPriceOpenapi_ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CryptoPriceOpenapi_ErrorResponse'
      security:
      - ApiKeyAuth: []
  /v1/cryptoprice:
    get:
      tags:
      - Crypto Price
      summary: Get current price of a cryptocurrency
      description: Returns the current market price of a cryptocurrency. Requires a `symbol` such as ETHUSDT. For past prices and OHLCV candles use /cryptopricehistorical.
      operationId: getCryptoPrice
      parameters:
      - name: symbol
        in: query
        required: true
        description: Cryptocurrency symbol (e.g. ETHUSDT). To get the full list of available symbols, use the Crypto Symbols API.
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CryptoPriceResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CryptoPriceOpenapi_ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CryptoPriceOpenapi_ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CryptoPriceOpenapi_ErrorResponse'
      security:
      - ApiKeyAuth: []
  /v1/cryptotreasury:
    get:
      operationId: getCryptoTreasury
      summary: Get SEC-reported corporate crypto treasury holdings
      description: Crypto asset positions reported to the SEC in quarterly XBRL filings. Coverage is limited to SEC filers (holders listed only outside the US are not included), and each position is as of the filer's reported period end. With no parameters, returns the largest current positions ranked by dollar value. Positions whose unit count does not reconcile with the filer's own fair value are excluded unless include_unverified is set.
      tags:
      - Crypto Price
      parameters:
      - name: ticker
        in: query
        required: false
        description: Stock ticker of the filer, e.g. MSTR. Private filers have no ticker; use cik.
        schema:
          type: string
      - name: cik
        in: query
        required: false
        description: SEC Central Index Key of the filer, with or without leading zeros.
        schema:
          type: string
      - name: name
        in: query
        required: false
        description: Case-insensitive substring match on the filer name. Requires a Business or Professional subscription.
        schema:
          type: string
      - name: asset
        in: query
        required: false
        description: Restrict to one crypto asset. UNKNOWN returns positions whose asset the filing did not state and which could not be identified.
        schema:
          type: string
          enum:
          - BITCOIN
          - ETHEREUM
          - SOLANA
          - XRP
          - LITECOIN
          - DOGECOIN
          - CARDANO
          - INJECTIVE
          - CANTON
          - STABLECOIN
          - UNKNOWN
      - name: entity_type
        in: query
        required: false
        description: OPERATING is a company holding crypto on its balance sheet. ETP is an exchange-traded product whose holdings are the fund itself. PRIVATE is a filer with no listed ticker.
        schema:
          type: string
          enum:
          - OPERATING
          - ETP
          - PRIVATE
      - name: period
        in: query
        required: false
        description: Reporting period end as YYYY-MM-DD, or 'latest'. Defaults to the most recent period. History depth is limited by subscription tier.
        schema:
          type: string
      - name: include_unverified
        in: query
        required: false
        description: Include positions whose unit count does not reconcile with the filer's own reported fair value. Excluded by default; when included they are reproduced exactly as filed and carry a warning.
        schema:
          type: boolean
          default: false
      - name: limit
        in: query
        required: false
        description: 'Maximum results to return. Capped by tier: 5 on Free, 50 on Developer, 250 on Business and Professional.'
        schema:
          type: integer
          minimum: 1
          maximum: 250
      - name: offset
        in: query
        required: false
        description: Number of results to skip, for pagination.
        schema:
          type: integer
          minimum: 0
          maximum: 10000
          default: 0
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CryptoTreasuryResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CryptoTreasuryOpenapi_Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CryptoTreasuryOpenapi_Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CryptoTreasuryOpenapi_Error'
components:
  schemas:
    CryptoTreasuryAttribution:
      type: object
      description: How each figure was derived, so callers can audit rather than trust.
      properties:
        asset_source:
          type: string
          description: dimensional_member when the filing tagged the asset explicitly; unit_string when the XBRL unit named it; valuation_inference when identified by matching implied unit price to the period-end market close; unknown when undetermined.
        units_basis:
          type: string
          description: 'How overlapping unit facts were collapsed: single_fact, stated_total, undimensioned_total, summed_components, labelled_total or max_of_ambiguous.'
        units_facts_reconciled:
          type: integer
          description: How many raw XBRL facts were reconciled into this figure.
        recovered_from_instance_document:
          type: boolean
          description: True when recovered by parsing the filing's XBRL instance because SEC's JSON APIs do not expose it.
        quality:
          type: string
          description: consistent, unverified, scale_suspect or inconsistent.
        implied_unit_price_usd:
          type:
          - number
          - 'null'
          description: Reported fair value divided by reported units.
        market_price_at_period_end_usd:
          type:
          - number
          - 'null'
          description: Market close for the asset on the period end date.
        warning:
          type: string
          description: Present when quality is scale_suspect or inconsistent.
    CryptoTreasuryOpenapi_Error:
      type: object
      properties:
        error:
          type: string
    CryptoPriceResponse:
      type: object
      properties:
        symbol:
          type: string
          example: ETHUSDT
        price:
          type: string
          example: '0.00381400'
          description: The price of the trading pair. Live on paid plans; on the free plan it is the close of the last completed hour.
        timestamp:
          type: integer
          format: int64
          example: 1637809196
          description: 'Unix timestamp (seconds) of the moment the data was measured. On paid plans this is the moment the price was read. On the free plan it is the top of the current hour: the free tier updates once per hour, so every request within the same hour returns the same values and the same timestamp.'
        exchange_rate_timestamp:
          type: integer
          format: int64
          example: 1637809190
          description: Fiat quotes only (e.g. BTCEUR). Unix timestamp (seconds) of the exchange rate used to convert the US-dollar price. Can be older than timestamp, e.g. at weekends when currency markets are closed.
    CryptoPriceHistoricalCandle:
      type: object
      properties:
        open:
          type: string
          description: Opening price for the period.
        high:
          type: string
          description: Highest price during the period.
        low:
          type: string
          description: Lowest price during the period.
        close:
          type: string
          description: Closing price for the period.
        volume:
          type: string
          description: Trading volume during the period.
        close_time:
          type: integer
          format: int64
          description: Closing timestamp in Unix milliseconds.
        timestamp:
          type: integer
          format: int64
          description: Period start timestamp in Unix seconds.
        price:
          type: string
          description: Current price (matches close).
    CryptoTreasuryDisclosure:
      type: object
      properties:
        source:
          type: string
        license:
          type: string
          description: Grants storage, redistribution and commercial display.
        not_advice:
          type: string
    CryptoTreasuryResponse:
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/CryptoTreasuryPosition'
        count:
          type: integer
          description: Number of results returned.
        data_last_refreshed:
          type: integer
          description: Unix timestamp of the last successful ingestion run.
        note:
          type: string
          description: Present when unverified filings were excluded.
        disclosure:
          $ref: '#/components/schemas/CryptoTreasuryDisclosure'
        upgrade_hint:
          type: string
          description: Present on the Free tier.
    CryptoTreasuryPosition:
      type: object
      properties:
        entity_name:
          type: string
          description: Filer name as it appears in EDGAR.
        ticker:
          type:
          - string
          - 'null'
          description: Stock ticker.
        cik:
          type: string
          description: SEC Central Index Key, zero-padded to 10 digits.
        entity_type:
          type: string
          description: OPERATING, ETP or PRIVATE.
        asset:
          type: string
          description: Canonical asset name, e.g. BITCOIN.
        units:
          type: number
          description: Number of coins held at the period end.
        fair_value_usd:
          type:
          - number
          - 'null'
          description: Value of THIS asset position.
        cost_usd:
          type:
          - number
          - 'null'
          description: Cost basis as reported.
        entity_total_crypto_fair_value_usd:
          type:
          - number
          - 'null'
          description: The filer's total crypto fair value across all assets.
        entity_holds_multiple_assets:
          type: boolean
          description: True when the filer reported more than one crypto asset for this period.
        period_end:
          type: string
          description: Reporting period end, YYYY-MM-DD. Positions are quarterly and may be materially stale.
        calendar_year:
          type:
          - integer
          - 'null'
          description: Calendar year of the reporting period. Not the filer's fiscal year.
        calendar_quarter:
          type:
          - string
          - 'null'
          description: Calendar quarter, Q1 to Q4. Not the filer's fiscal quarter.
        accession:
          type:
          - string
          - 'null'
          description: SEC accession number of the source filing.
        sec_filing_url:
          type:
          - string
          - 'null'
          description: Link to the source filing on EDGAR.
        attribution:
          $ref: '#/components/schemas/CryptoTreasuryAttribution'
    CryptoPriceOpenapi_ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
externalDocs:
  description: API Ninjas documentation
  url: https://api-ninjas.com/api