openapi: 3.0.2
info:
title: Coin Metrics API v4 Blockchain Explorer Job Constituent Timeframes API
description: '[Coin Metrics Homepage](https://coinmetrics.io/)
[API Backward Compatibility Policy](https://docs.coinmetrics.io/access-our-data/api#backward-compatibility)
[Python API Client](https://coinmetrics.github.io/api-client-python/site/index.html)
HTTP API root endpoint URL is `https://api.coinmetrics.io/v4`. Coin Metrics' paid product.
WebSocket API root endpoint is `wss://api.coinmetrics.io/v4`. Coin Metrics' paid product.
The Community HTTP API root endpoint URL is `https://community-api.coinmetrics.io/v4`. API key is not required when accessing community endpoints. Available to the community under the [Creative Commons](https://creativecommons.org/licenses/by-nc/4.0/) license.
# Authentication
# Response headers
Note that Coin Metrics API responses have a `CF-RAY` HTTP header e.g. `88a6ec1d2f930774-IAD` which can be used for diagnostic purposes. When raising Support requests, please ensure to provide the value of this header. '
termsOfService: https://coinmetrics.io/api/terms
contact:
name: Coin Metrics Support
url: https://coinmetrics.io/support/
email: support@coinmetrics.io
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
version: 4.0.0
servers:
- url: https://api.coinmetrics.io/v4
- url: wss://api.coinmetrics.io/v4
- url: https://community-api.coinmetrics.io/v4
tags:
- name: Constituent Timeframes
description: Endpoints for getting the timeframes of various constituents
paths:
/constituent-timeframes/asset-metrics:
servers:
- url: https://api.coinmetrics.io/v4
- url: https://community-api.coinmetrics.io/v4
get:
summary: Timeframes of asset metric constituents
description: "Returns timeframes of asset metric constituents. \\\nResults are sorted by tuple (`start_time`, `constituent_name`), where constituent depends on a target metric. \nE.g., the `volume_trusted_spot_usd_1d` metric constituents are exchanges, \ni.e. the output will be sorted by (`start_time`, `exchange`).\n"
operationId: getConstituentTimeframesAssetMetrics
x-codeSamples:
- label: Shell
source: '# Gets timeframes of asset metric constituents
curl --compressed "https://api.coinmetrics.io/v4/constituent-timeframes/asset-metrics?metric=volume_trusted_spot_usd_1d&api_key="
'
- label: Python
source: '# Gets timeframes of asset metric constituents
import requests
response = requests.get(''https://api.coinmetrics.io/v4/constituent-timeframes/asset-metrics?metric=volume_trusted_spot_usd_1d&api_key='').json()
print(response)
'
- label: Python Client
source: '# Gets timeframes of asset metric constituents
from coinmetrics.api_client import CoinMetricsClient
client = CoinMetricsClient()
response = client.get_timeframes_of_asset_metric_constituents(metric="volume_trusted_spot_usd_1d").to_list()
print(response)
'
tags:
- Constituent Timeframes
parameters:
- $ref: '#/components/parameters/ConstituentsMetricName'
- $ref: '#/components/parameters/ConstituentId'
- $ref: '#/components/parameters/ConstituentsStartTime'
- $ref: '#/components/parameters/ConstituentsEndTime'
- $ref: '#/components/parameters/NextPageToken'
- $ref: '#/components/parameters/PageSize'
- $ref: '#/components/parameters/PagingFrom'
- $ref: '#/components/parameters/Format'
- $ref: '#/components/parameters/Pretty'
responses:
'200':
$ref: '#/components/responses/AssetMetricsConstituentTimeframes'
'400':
$ref: '#/components/responses/MetricNotFound'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'414':
$ref: '#/components/responses/UriTooLong'
security:
- api_key: []
components:
schemas:
NextPageToken:
description: Token of the next page results for a given request.
type: string
ErrorResponse:
properties:
error:
$ref: '#/components/schemas/ErrorObject'
required:
- error
type: object
Time:
description: The time in ISO 8601 date-time format. Always with nanoseconds precision.
type: string
format: date-time
ErrorObject:
properties:
type:
description: Error type string. Can be used for error identification.
type: string
message:
description: Human-friendly error description. Can be amended without prior notification. Do not use for error identification in your code.
type: string
required:
- type
- description
type: object
NextPageUrl:
description: URL of the next page results for a given request.
type: string
ConstituentTimeframesAssetMetricsResponse:
description: Timeframes of asset metric constituents response.
type: object
properties:
data:
type: array
items:
type: object
properties:
start_time:
$ref: '#/components/schemas/Time'
end_time:
$ref: '#/components/schemas/Time'
required:
- start_time
additionalProperties:
nullable: true
type: string
next_page_token:
$ref: '#/components/schemas/NextPageToken'
next_page_url:
$ref: '#/components/schemas/NextPageUrl'
required:
- data
parameters:
ConstituentsStartTime:
description: 'Start of the time interval, inclusive. \
Multiple formats of ISO 8601 are supported: `2006-01-20T00:00:00Z`, `2006-01-20T00:00:00.000Z`, `2006-01-20T00:00:00.123456Z`, `2006-01-20T00:00:00.123456789Z`, `2006-01-20`, `20060120`. \
Mutually exclusive with `at_time`.
'
name: start_time
in: query
schema:
type: string
ConstituentId:
description: 'Comma separated list of constituents. By default all constituents are returned.
Different asset metrics may have different constituents.
For example, constituents for `volume_trusted_spot_usd_1d` are exchanges.
'
example: null
name: constituents
in: query
required: false
schema:
type: array
items:
type: string
explode: false
PagingFrom:
description: Where does the first page start, at the start of the interval or at the end.
The value of this parameter is ignored if the endpoint supports the `format` parameter and its value is set to `json_stream`.
in: query
name: paging_from
schema:
default: end
enum:
- start
- end
type: string
format: PagingFrom
Pretty:
description: Human-readable formatting of JSON responses.
in: query
name: pretty
schema:
type: boolean
default: false
PageSize:
description: Number of items per single page of results.
The value of this parameter is ignored if the endpoint supports the `format` parameter and its value is set to `json_stream`.
in: query
name: page_size
schema:
default: 100
type: integer
format: int32
minimum: 1
maximum: 10000
Format:
description: Format of the response.
in: query
name: format
schema:
enum:
- json
- csv
type: string
default: json
ConstituentsMetricName:
description: Target metric name.
name: metric
in: query
required: true
schema:
type: string
NextPageToken:
description: Token for receiving the results from the next page of a query.
Should not be used directly. To iterate through pages just use `next_page_url` response field.
in: query
name: next_page_token
schema:
type: string
ConstituentsEndTime:
description: 'End of the time interval, inclusive. \
Multiple formats of ISO 8601 are supported: `2006-01-20T00:00:00Z`, `2006-01-20T00:00:00.000Z`, `2006-01-20T00:00:00.123456Z`, `2006-01-20T00:00:00.123456789Z`, `2006-01-20`, `20060120`. \
Mutually exclusive with `at_time`.
'
name: end_time
in: query
schema:
type: string
responses:
UriTooLong:
description: Provided URI is too long. It must not be greater than 10000 symbols.
MetricNotFound:
content:
application/json:
example:
error:
type: bad_parameter
message: Bad parameter 'metrics'. Value 'asdgwav' is not supported.
schema:
$ref: '#/components/schemas/ErrorResponse'
description: Metric not found.
Unauthorized:
description: Requested resource requires authorization.
content:
application/json:
examples:
unauthorized:
summary: Unauthorized error response.
value:
error:
type: unauthorized
message: Requested resource requires authorization.
wrong_credentials:
summary: Wrong credentials error response.
value:
error:
type: wrong_credentials
message: Supplied credentials are not valid.
schema:
$ref: '#/components/schemas/ErrorResponse'
AssetMetricsConstituentTimeframes:
description: List of timeframes.
content:
application/json:
example:
data:
- exchange: gemini
start_time: '2023-10-12T00:00:00.000000000Z'
end_time: null
- exchange: kraken
start_time: '2023-10-12T00:00:00.000000000Z'
end_time: null
- exchange: binance
start_time: '2023-04-01T00:00:00.000000000Z'
end_time: '2023-10-12T00:00:00.000000000Z'
- exchange: binance.us
start_time: '2023-04-01T00:00:00.000000000Z'
end_time: '2023-10-12T00:00:00.000000000Z'
- exchange: bitstamp
start_time: '2023-04-01T00:00:00.000000000Z'
end_time: '2023-10-12T00:00:00.000000000Z'
next_page_token: 0.MjAxNy0wNS0yMlQwMDowMDowMFo
next_page_url: https://api.coinmetrics.io/v4/constituent-timeframes/asset-metrics?metric=volume_trusted_spot_usd_1d&pretty=true&page_size=5&api_key=
schema:
$ref: '#/components/schemas/ConstituentTimeframesAssetMetricsResponse'
text/csv:
example: 'exchange,start_time,end_time
gemini,2023-10-12T00:00:00.000000000Z,null
kraken,2023-10-12T00:00:00.000000000Z,null
binance,2023-04-01T00:00:00.000000000Z,2023-10-12T00:00:00.000000000Z
binance.us,2023-04-01T00:00:00.000000000Z,2023-10-12T00:00:00.000000000Z
bitstamp,2023-04-01T00:00:00.000000000Z,2023-10-12T00:00:00.000000000Z'
schema:
$ref: '#/components/schemas/ConstituentTimeframesAssetMetricsResponse'
Forbidden:
content:
application/json:
example:
error:
type: forbidden
message: Requested metric 'SplyBMXNtv' with frequency '1d' for asset 'btc' is not available with supplied credentials.
schema:
$ref: '#/components/schemas/ErrorResponse'
description: Requested resource is not available with supplied credentials.
securitySchemes:
api_key:
description: Coin Metrics API key can be specified as `?api_key=` query parameter.
in: query
name: api_key
type: apiKey
x-tagGroups:
- name: General
tags:
- Rate limits
- name: Reference Data
tags:
- Reference Data
- Profile
- Taxonomy
- Taxonomy Metadata
- name: Catalog
tags:
- Catalog
- Full catalog
- Catalog v2
- Full catalog v2
- name: Timeseries
tags:
- Timeseries
- Timeseries stream
- name: Universal blockchain explorer
tags:
- List of blockchain entities v2
- Full blockchain entities v2
- Blockchain Explorer Job
- Blockchain Explorer Job Results
- name: Tools
tags:
- Chain Monitor tools
- name: Security Master
tags:
- Security Master
- name: Constituents
tags:
- Constituent Snapshots
- Constituent Timeframes
- name: Blockchain Metadata
tags:
- Blockchain Metadata
- name: Jobs
tags:
- Jobs