/
swagger.yml
executable file
·624 lines (624 loc) · 19.4 KB
/
swagger.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
---
swagger: "2.0"
info:
description: Define coinmarketcap's api in swagger 2.0 openapi standard
version: 1.0.0
title: Coinmarketcap API Swagger Implementation
host: pro-api.coinmarketcap.com
basePath: /v1
schemes:
- https
produces:
- application/json
security:
- ApiKeyAuth: []
paths:
/cryptocurrency/map:
get:
summary: Get CoinMarketCap ID map
description: Returns a paginated list of all cryptocurrencies by CoinMarketCap ID. We recommend using this convenience endpoint to lookup and utilize our unique cryptocurrency id across all endpoints as typical identifiers like ticker symbols can match multiple cryptocurrencies and change over time. As a convenience you may pass a comma-separated list of cryptocurrency symbols as symbol to filter this list to only those you require.
parameters:
- name: listing_status
in: query
description: Only active coins are returned by default. Pass 'inactive' to get a list of coins that are no longer active.
required: false
type: string
default: active
- name: start
in: query
description: Optionally offset the start (1-based index) of the paginated list of items to return.
required: false
type: integer
default: 1
minimum: 1
- name: limit
in: query
description: Optionally specify the number of results to return. Use this parameter and the "start" parameter to determine your own pagination size.
required: false
type: integer
maximum: 5000
minimum: 1
- name: symbol
in: query
description: Optionally pass a comma-separated list of cryptocurrency symbols to return CoinMarketCap IDs for. If this option is passed, other options will be ignored.
required: false
type: string
responses:
200:
description: OK
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/definitions/CryptocurrencyMap'
status:
$ref: '#/definitions/Status'
default:
description: Unexpected error
schema:
type: object
properties:
status:
$ref: '#/definitions/Status'
/cryptocurrency/info:
get:
summary: Get metadata
description: Returns all static metadata for one or more cryptocurrencies including name, symbol, logo, and its various registered URLs.
parameters:
- name: id
in: query
description: One or more comma-separated CoinMarketCap cryptocurrency IDs. Example "1,2"
required: false
type: string
- name: symbol
in: query
description: 'Alternatively pass one or more comma-separated cryptocurrency symbols. Example: "BTC,ETH". At least one "id" or "symbol" is required.'
required: false
type: string
responses:
200:
description: OK
schema:
type: object
properties:
data:
type: object
additionalProperties:
$ref: '#/definitions/CryptocurrencyInfo'
status:
$ref: '#/definitions/Status'
default:
description: Unexpected error
schema:
type: object
properties:
status:
$ref: '#/definitions/Status'
/cryptocurrency/listings/historical:
get:
summary: List all cryptocurrencies (historical)
description: Get a paginated list of all cryptocurrencies with market data for a given historical time. Use the "convert" option to return market values in multiple fiat and cryptocurrency conversions in the same call.
parameters:
- name: timestamp
in: query
description: Timestamp (Unix or ISO 8601) to return historical cryptocurrency listings for.
required: false
type: string
- name: start
in: query
description: Optionally offset the start (1-based index) of the paginated list of items to return.
required: false
type: integer
default: 1
minimum: 1
- name: limit
in: query
description: Optionally specify the number of results to return. Use this parameter and the "start" parameter to determine your own pagination size.
required: false
type: integer
default: 100
maximum: 5000
minimum: 1
- name: convert
in: query
description: Optionally calculate market quotes in up to 120 currencies at once by passing a comma-separated list of cryptocurrency or fiat currency symbols. Each additional convert option beyond the first requires an additional call credit. A list of supported fiat options can be found here. Each conversion is returned in its own "quote" object.
required: false
type: string
default: USD
- name: sort
in: query
description: |-
Valid values `name` `symbol` `date_added` `market_cap` `price` `circulating_supply` `total_supply` `max_supply` `num_market_pairs` `volume_24h` `percent_change_1h` `percent_change_24h` `percent_change_7d`
What field to sort the list of cryptocurrencies by.
required: false
type: string
default: market_cap
- name: sort_dir
in: query
description: Valid values `asc` `desc`. The direction in which to order cryptocurrencies against the specified sort.
required: false
type: string
- name: cryptocurrency_type
in: query
description: Valid values `all` `coins` `tokens` The type of cryptocurrency to include.
required: false
type: string
responses:
200:
description: OK
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/definitions/CryptocurrencyListings'
status:
$ref: '#/definitions/Status'
default:
description: Unexpected error
schema:
type: object
properties:
status:
$ref: '#/definitions/Status'
/cryptocurrency/listings/latest:
get:
summary: List all cryptocurrencies (latest)
description: Get a paginated list of all cryptocurrencies with latest market data. You can configure this call to sort by market cap or another market ranking field. Use the "convert" option to return market values in multiple fiat and cryptocurrency conversions in the same call.
parameters:
- name: start
in: query
description: Optionally offset the start (1-based index) of the paginated list of items to return.
required: false
type: integer
default: 1
minimum: 1
- name: limit
in: query
description: Optionally specify the number of results to return. Use this parameter and the "start" parameter to determine your own pagination size.
required: false
type: integer
default: 100
maximum: 5000
minimum: 1
- name: convert
in: query
description: Optionally calculate market quotes in up to 120 currencies at once by passing a comma-separated list of cryptocurrency or fiat currency symbols. Each additional convert option beyond the first requires an additional call credit. A list of supported fiat options can be found here. Each conversion is returned in its own "quote" object.
required: false
type: string
default: USD
- name: sort
in: query
description: |-
Valid values `name` `symbol` `date_added` `market_cap` `price` `circulating_supply` `total_supply` `max_supply` `num_market_pairs` `volume_24h` `percent_change_1h` `percent_change_24h` `percent_change_7d`
What field to sort the list of cryptocurrencies by.
required: false
type: string
default: market_cap
- name: sort_dir
in: query
description: Valid values `asc` `desc`. The direction in which to order cryptocurrencies against the specified sort.
required: false
type: string
- name: cryptocurrency_type
in: query
description: Valid values `all` `coins` `tokens` The type of cryptocurrency to include.
required: false
type: string
responses:
200:
description: OK
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/definitions/CryptocurrencyListings'
status:
$ref: '#/definitions/Status'
default:
description: Unexpected error
schema:
type: object
properties:
status:
$ref: '#/definitions/Status'
/global-metrics/quotes/latest:
get:
summary: Get aggregate market metrics (latest)
description: Get the latest quote of aggregate market metrics. Use the "convert" option to return market values in multiple fiat and cryptocurrency conversions in the same call.
parameters:
- name: convert_id
in: query
description: One or more comma-separated cryptocurrency CoinMarketCap IDs. Example 1,2
required: false
type: string
- name: convert
in: query
description: Optionally calculate market quotes in up to 120 currencies at once by passing a comma-separated list of cryptocurrency or fiat currency symbols. Each additional convert option beyond the first requires an additional call credit. A list of supported fiat options can be found here. Each conversion is returned in its own "quote" object.
required: false
type: string
responses:
200:
description: OK
schema:
type: object
properties:
data:
$ref: '#/definitions/GlobalMetricsQuotesLatest'
status:
$ref: '#/definitions/Status'
default:
description: Unexpected error
schema:
type: object
properties:
status:
$ref: '#/definitions/Status'
/global-metrics/quotes/historical:
get:
summary: List all cryptocurrencies (latest)
description: Get a paginated list of all cryptocurrencies with latest market data. You can configure this call to sort by market cap or another market ranking field. Use the "convert" option to return market values in multiple fiat and cryptocurrency conversions in the same call.
parameters:
- name: time_start
in: query
description: Timestamp (Unix or ISO 8601) to start returning quotes for. Optional, if not passed, we'll return quotes calculated in reverse from "time_end".
required: false
type: string
- name: time_end
in: query
description: Timestamp (Unix or ISO 8601) to stop returning quotes for (inclusive). Optional, if not passed, we'll default to the current time. If no "time_start" is passed, we return quotes in reverse order starting from this time.
required: false
type: string
- name: count
in: query
description: The number of interval periods to return results for. Optional, required if both "time_start" and "time_end" aren't supplied. The default is 10 items. The current query limit is 10000.
required: false
type: integer
default: 10
maximum: 10000
minimum: 1
- name: interval
in: query
description: |-
Valid values "yearly" "monthly" "weekly" "daily" "hourly" "5m" "10m" "15m" "30m" "45m" "1h" "2h" "3h" "6h" "12h" "24h" "1d" "2d" "3d" "7d" "14d" "15d" "30d" "60d" "90d" "365d"
Interval of time to return data points for. See details in endpoint description.
required: false
type: string
default: 1d
- name: convert_id
in: query
description: One or more comma-separated cryptocurrency CoinMarketCap IDs. Example 1,2
required: false
type: string
- name: convert
in: query
description: By default market quotes are returned in USD. Optionally calculate market quotes in up to 3 other fiat currencies or cryptocurrencies.
required: false
type: string
responses:
200:
description: OK
schema:
type: object
properties:
data:
$ref: '#/definitions/inline_response_200_4_data'
status:
$ref: '#/definitions/Status'
default:
description: Unexpected error
schema:
type: object
properties:
status:
$ref: '#/definitions/Status'
securityDefinitions:
ApiKeyAuth:
type: apiKey
name: X-CMC_PRO_API_KEY
in: header
definitions:
CryptocurrencyMap:
type: object
properties:
id:
type: integer
format: int64
name:
type: string
symbol:
type: string
slug:
type: string
is_active:
type: integer
format: int64
first_historical_data:
type: string
format: date-time
last_historical_data:
type: string
format: date-time
platform:
$ref: '#/definitions/Platform'
CryptocurrencyInfo:
type: object
properties:
id:
type: integer
format: int64
name:
type: string
symbol:
type: string
category:
type: string
slug:
type: string
logo:
type: string
tags:
type: array
description: coin tags
items:
type: string
description:
type: string
date_added:
type: string
format: date-time
platform:
$ref: '#/definitions/Platform'
urls:
$ref: '#/definitions/CryptocurrencyInfo_urls'
Platform:
type: object
properties:
id:
type: integer
format: int64
name:
type: string
symbol:
type: string
slug:
type: string
token_address:
type: string
description: Metadata about the parent cryptocurrency platform this cryptocurrency belongs to if it is a token, otherwise null.
CryptocurrencyListings:
type: object
properties:
id:
type: integer
format: int64
name:
type: string
symbol:
type: string
slug:
type: string
cmc_rank:
type: integer
format: int32
num_market_pairs:
type: integer
format: int32
circulating_supply:
type: integer
format: int64
total_supply:
type: integer
format: int64
max_supply:
type: integer
format: int64
last_updated:
type: string
format: date-time
date_added:
type: string
format: date-time
tags:
type: array
items:
type: string
platform:
$ref: '#/definitions/Platform'
quote:
type: object
additionalProperties:
$ref: '#/definitions/Quote'
Quote:
type: object
properties:
price:
type: number
format: float
volume_24h:
type: integer
format: int64
percent_change_1h:
type: number
format: float
percent_change_24h:
type: number
format: float
percent_change_7d:
type: number
format: float
market_cap:
type: number
format: float
last_updated:
type: string
format: date-time
GlobalMetricsQuotesHistorical:
type: object
properties:
timestamp:
type: string
format: date-time
btc_dominance:
type: number
format: float
quote:
type: object
additionalProperties:
$ref: '#/definitions/GlobalMetricsHistoricalQuote'
description: Global metrics historical object
GlobalMetricsHistoricalQuote:
type: object
properties:
total_market_cap:
type: number
format: float
total_volume_24h:
type: number
format: float
timestamp:
type: string
format: date-time
description: Global metrics historical object
GlobalMetricsQuotesLatest:
type: object
properties:
btc_dominance:
type: number
format: float
eth_dominance:
type: number
format: float
active_cryptocurrencies:
type: integer
format: int32
active_market_pairs:
type: integer
format: int32
active_exchanges:
type: integer
format: int32
last_updated:
type: string
format: date-time
quote:
type: object
additionalProperties:
$ref: '#/definitions/GlobalMetricsQuote'
description: Global metrics object
GlobalMetricsQuote:
type: object
properties:
total_market_cap:
type: number
format: float
total_volume_24h:
type: number
format: float
last_updated:
type: string
format: date-time
description: Global market quote object
Status:
type: object
properties:
timestamp:
type: string
format: date-time
error_code:
type: integer
format: int64
error_message:
type: string
elapsed:
type: integer
format: int64
credit_count:
type: integer
format: int64
inline_response_200:
properties:
data:
type: array
items:
$ref: '#/definitions/CryptocurrencyMap'
status:
$ref: '#/definitions/Status'
inline_response_default:
properties:
status:
$ref: '#/definitions/Status'
inline_response_200_1:
properties:
data:
type: object
additionalProperties:
$ref: '#/definitions/CryptocurrencyInfo'
status:
$ref: '#/definitions/Status'
inline_response_200_2:
properties:
data:
type: array
items:
$ref: '#/definitions/CryptocurrencyListings'
status:
$ref: '#/definitions/Status'
inline_response_200_3:
properties:
data:
$ref: '#/definitions/GlobalMetricsQuotesLatest'
status:
$ref: '#/definitions/Status'
inline_response_200_4_data:
properties:
quote:
type: array
items:
$ref: '#/definitions/GlobalMetricsQuotesHistorical'
inline_response_200_4:
properties:
data:
$ref: '#/definitions/inline_response_200_4_data'
status:
$ref: '#/definitions/Status'
CryptocurrencyInfo_urls:
properties:
website:
type: array
items:
type: string
explorer:
type: array
items:
type: string
source_code:
type: array
items:
type: string
message_board:
type: array
items:
type: string
chat:
type: array
items:
type: string
announcement:
type: array
items:
type: string
reddit:
type: array
items:
type: string
twitter:
type: array
items:
type: string
description: Players associated with the