-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathopenapi.yaml
More file actions
2273 lines (2205 loc) · 65.5 KB
/
openapi.yaml
File metadata and controls
2273 lines (2205 loc) · 65.5 KB
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
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.1.0
info:
title: Crypto Vision API
description: >
The complete cryptocurrency intelligence API. Aggregates data from CoinGecko,
DeFiLlama, DexScreener, RSS feeds, and LLM providers into a single,
high-performance endpoint.
version: 0.1.0
contact:
name: Crypto Vision
url: https://cryptocurrency.cv
license:
name: MIT
url: https://opensource.org/licenses/MIT
servers:
- url: http://localhost:8080
description: Local development
- url: https://cryptocurrency.cv
description: Production
tags:
- name: Meta
description: Health checks and API metadata
- name: Market
description: Market data — coins, prices, charts, exchanges, and sentiment indices
- name: DeFi
description: DeFi analytics — protocols, yields, stablecoins, DEX volumes, fees, bridges, and raises
- name: News
description: Crypto news aggregation from RSS feeds
- name: On-Chain
description: On-chain data — gas prices, Bitcoin network stats, and token lookups
- name: AI
description: AI-powered crypto analysis — sentiment, digests, signals, and Q&A (requires LLM API key)
- name: Search
description: Unified semantic search — natural language queries, autocomplete, and AI-powered answers
paths:
# ──────────────────────────────────────────────────────────────
# Meta
# ──────────────────────────────────────────────────────────────
/:
get:
operationId: getRoot
summary: API info
description: Returns basic API metadata and links.
tags: [Meta]
responses:
"200":
description: API metadata
content:
application/json:
schema:
type: object
properties:
name:
type: string
example: Crypto Vision
description:
type: string
example: The complete cryptocurrency intelligence API
version:
type: string
example: 0.1.0
docs:
type: string
example: /api
health:
type: string
example: /health
website:
type: string
example: https://cryptocurrency.cv
/health:
get:
operationId: getHealth
summary: Health check
description: Returns server health status, uptime, cache stats, and environment.
tags: [Meta]
responses:
"200":
description: Health status
content:
application/json:
schema:
type: object
properties:
status:
type: string
example: ok
uptime:
type: number
description: Server uptime in seconds
timestamp:
type: string
format: date-time
cache:
type: object
description: Cache hit/miss statistics
env:
type: string
example: development
/api:
get:
operationId: getApiIndex
summary: API endpoint directory
description: Lists all available API endpoints grouped by area.
tags: [Meta]
responses:
"200":
description: Endpoint directory
content:
application/json:
schema:
type: object
properties:
name:
type: string
version:
type: string
endpoints:
type: object
description: Endpoints grouped by area (market, defi, news, onchain, ai)
# ──────────────────────────────────────────────────────────────
# Market Data
# ──────────────────────────────────────────────────────────────
/api/coins:
get:
operationId: getCoins
summary: Top coins by market cap
description: Returns a paginated list of coins sorted by market capitalisation with price, volume, and supply data.
tags: [Market]
parameters:
- name: page
in: query
schema:
type: integer
default: 1
description: Page number
- name: per_page
in: query
schema:
type: integer
default: 100
maximum: 250
description: Results per page (max 250)
- name: order
in: query
schema:
type: string
default: market_cap_desc
description: Sort order (e.g. market_cap_desc, volume_desc)
- name: sparkline
in: query
schema:
type: string
enum: ["true", "false"]
default: "false"
description: Include 7-day sparkline price array
- name: ids
in: query
schema:
type: string
description: Comma-separated CoinGecko coin IDs to filter
- name: category
in: query
schema:
type: string
description: Filter by category
responses:
"200":
description: Paginated list of coins
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: "#/components/schemas/CoinSummary"
page:
type: integer
perPage:
type: integer
timestamp:
type: string
format: date-time
/api/coin/{id}:
get:
operationId: getCoinDetail
summary: Coin detail
description: Returns full detail for a single coin including description, links, categories, and market data.
tags: [Market]
parameters:
- name: id
in: path
required: true
schema:
type: string
description: CoinGecko coin ID (e.g. bitcoin, ethereum)
responses:
"200":
description: Coin detail
content:
application/json:
schema:
type: object
properties:
data:
$ref: "#/components/schemas/CoinDetail"
timestamp:
type: string
format: date-time
/api/price:
get:
operationId: getPrice
summary: Simple price lookup
description: Returns current prices for one or more coins in the requested fiat currencies.
tags: [Market]
parameters:
- name: ids
in: query
required: true
schema:
type: string
description: Comma-separated CoinGecko coin IDs (e.g. bitcoin,ethereum)
- name: vs_currencies
in: query
schema:
type: string
default: usd
description: Comma-separated target currencies (e.g. usd,eur)
responses:
"200":
description: Price map
content:
application/json:
schema:
type: object
properties:
data:
type: object
additionalProperties:
type: object
additionalProperties:
type: number
timestamp:
type: string
format: date-time
"400":
description: Missing ids parameter
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/api/trending:
get:
operationId: getTrending
summary: Trending coins
description: Returns the current trending coins on CoinGecko.
tags: [Market]
responses:
"200":
description: Trending coins list
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: "#/components/schemas/TrendingCoin"
timestamp:
type: string
format: date-time
/api/global:
get:
operationId: getGlobal
summary: Global market stats
description: Returns aggregate cryptocurrency market statistics including total market cap, volume, and dominance.
tags: [Market]
responses:
"200":
description: Global market statistics
content:
application/json:
schema:
type: object
properties:
data:
$ref: "#/components/schemas/GlobalMarket"
timestamp:
type: string
format: date-time
/api/search:
get:
operationId: searchCoins
summary: Search coins
description: Search for coins by name or symbol.
tags: [Market]
parameters:
- name: q
in: query
required: true
schema:
type: string
description: Search query
responses:
"200":
description: Search results
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
type: object
properties:
id:
type: string
name:
type: string
symbol:
type: string
rank:
type: integer
nullable: true
timestamp:
type: string
format: date-time
"400":
description: Missing q parameter
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
# ──────────────────────────────────────────────────────────────
# Semantic Search
# ──────────────────────────────────────────────────────────────
/api/search/smart:
get:
operationId: smartSearch
summary: Semantic search across all data
description: >
Natural language search across coins, protocols, news, pools, and agents.
Automatically detects query intent (price lookup, yield search, comparison, etc.)
and routes to the most relevant data sources in parallel.
tags: [Search]
parameters:
- name: q
in: query
required: true
description: Search query (2–500 characters)
schema:
type: string
minLength: 2
maxLength: 500
- name: types
in: query
description: Comma-separated result type filter (coin, protocol, news, pool, agent, chain, concept)
schema:
type: string
example: "coin,protocol,news"
- name: limit
in: query
description: Maximum number of results
schema:
type: integer
default: 20
minimum: 1
maximum: 100
- name: timeRange
in: query
description: Time range filter for news
schema:
type: string
enum: ["1h", "24h", "7d", "30d", "all"]
- name: chain
in: query
description: Filter by blockchain
schema:
type: string
example: "Ethereum"
- name: minRelevance
in: query
description: Minimum relevance score (0–1)
schema:
type: number
default: 0.1
minimum: 0
maximum: 1
responses:
"200":
description: Search results with metadata
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: "#/components/schemas/SearchResult"
meta:
type: object
properties:
query:
type: string
intent:
type: string
enum:
- price_lookup
- comparison
- event_query
- yield_search
- protocol_search
- news_search
- concept_explain
- risk_assessment
- chain_comparison
- general
totalResults:
type: integer
searchTimeMs:
type: integer
suggestions:
type: array
items:
type: string
timestamp:
type: string
format: date-time
"400":
description: Invalid query
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/api/search/nlq:
get:
operationId: naturalLanguageQuery
summary: AI-powered natural language query
description: >
Ask any crypto question and get an AI-generated answer with sources.
Combines semantic search with RAG (Retrieval-Augmented Generation)
for grounded, data-backed responses.
tags: [Search, AI]
parameters:
- name: q
in: query
required: true
description: Natural language question (5–1000 characters)
schema:
type: string
minLength: 5
maxLength: 1000
responses:
"200":
description: AI answer with sources and search results
content:
application/json:
schema:
type: object
properties:
data:
type: object
properties:
answer:
type: string
description: AI-generated answer
sources:
type: array
items:
type: object
properties:
id:
type: string
content:
type: string
score:
type: number
searchResults:
type: array
items:
$ref: "#/components/schemas/SearchResult"
intent:
type: string
model:
type: string
ragUsed:
type: boolean
suggestions:
type: array
items:
type: string
searchTimeMs:
type: integer
timestamp:
type: string
format: date-time
"400":
description: Invalid query
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/api/search/suggest:
get:
operationId: searchSuggest
summary: Search autocomplete suggestions
description: >
Fast autocomplete endpoint for search UIs. Returns coin names
and common query completions within ~200ms.
tags: [Search]
parameters:
- name: q
in: query
required: true
description: Partial search query
schema:
type: string
responses:
"200":
description: Autocomplete suggestions
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
type: object
properties:
text:
type: string
type:
type: string
id:
type: string
/api/chart/{id}:
get:
operationId: getChart
summary: Price chart data
description: Returns historical price, market cap, and volume arrays for charting.
tags: [Market]
parameters:
- name: id
in: path
required: true
schema:
type: string
description: CoinGecko coin ID
- name: days
in: query
schema:
type: string
default: "7"
description: Number of days of data (1, 7, 14, 30, 90, 180, 365, max)
- name: interval
in: query
schema:
type: string
description: Data interval (e.g. daily)
responses:
"200":
description: Chart data
content:
application/json:
schema:
type: object
properties:
data:
type: object
properties:
prices:
type: array
items:
type: array
items:
type: number
minItems: 2
maxItems: 2
description: "[timestamp_ms, price] pairs"
marketCaps:
type: array
items:
type: array
items:
type: number
minItems: 2
maxItems: 2
description: "[timestamp_ms, market_cap] pairs"
volumes:
type: array
items:
type: array
items:
type: number
minItems: 2
maxItems: 2
description: "[timestamp_ms, volume] pairs"
timestamp:
type: string
format: date-time
/api/ohlc/{id}:
get:
operationId: getOHLC
summary: OHLC candles
description: Returns OHLC (Open, High, Low, Close) candlestick data for a coin.
tags: [Market]
parameters:
- name: id
in: path
required: true
schema:
type: string
description: CoinGecko coin ID
- name: days
in: query
schema:
type: integer
default: 7
description: Number of days (1, 7, 14, 30, 90, 180, 365)
responses:
"200":
description: OHLC candle data
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: "#/components/schemas/OHLCCandle"
timestamp:
type: string
format: date-time
/api/exchanges:
get:
operationId: getExchanges
summary: Exchange rankings
description: Returns a paginated list of cryptocurrency exchanges ranked by trust score.
tags: [Market]
parameters:
- name: page
in: query
schema:
type: integer
default: 1
description: Page number
- name: per_page
in: query
schema:
type: integer
default: 100
maximum: 250
description: Results per page (max 250)
responses:
"200":
description: Exchange list
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: "#/components/schemas/Exchange"
page:
type: integer
perPage:
type: integer
timestamp:
type: string
format: date-time
/api/categories:
get:
operationId: getCategories
summary: Market categories
description: Returns all coin categories with market cap, volume, and top coins.
tags: [Market]
responses:
"200":
description: Category list
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: "#/components/schemas/Category"
timestamp:
type: string
format: date-time
/api/fear-greed:
get:
operationId: getFearGreed
summary: Fear & Greed Index
description: Returns the Crypto Fear & Greed Index (0 = extreme fear, 100 = extreme greed).
tags: [Market]
parameters:
- name: limit
in: query
schema:
type: integer
default: 1
maximum: 30
description: Number of historical data points (max 30)
responses:
"200":
description: Fear & Greed data
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: "#/components/schemas/FearGreed"
timestamp:
type: string
format: date-time
/api/dex/search:
get:
operationId: dexSearch
summary: DEX token search
description: Search for DEX trading pairs via DexScreener.
tags: [Market]
parameters:
- name: q
in: query
required: true
schema:
type: string
description: Search query (token name, symbol, or address)
responses:
"200":
description: DEX pair search results
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: "#/components/schemas/DexPair"
timestamp:
type: string
format: date-time
"400":
description: Missing q parameter
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
# ──────────────────────────────────────────────────────────────
# DeFi
# ──────────────────────────────────────────────────────────────
/api/defi/protocols:
get:
operationId: getDefiProtocols
summary: Top DeFi protocols by TVL
description: Returns DeFi protocols sorted by Total Value Locked, with optional chain and category filters.
tags: [DeFi]
parameters:
- name: limit
in: query
schema:
type: integer
default: 100
maximum: 500
description: Max results (max 500)
- name: chain
in: query
schema:
type: string
description: Filter by chain name (e.g. Ethereum, Arbitrum)
- name: category
in: query
schema:
type: string
description: Filter by category (e.g. DEXes, Lending)
responses:
"200":
description: Protocol list
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: "#/components/schemas/DefiProtocol"
count:
type: integer
timestamp:
type: string
format: date-time
/api/defi/protocol/{slug}:
get:
operationId: getDefiProtocolDetail
summary: Protocol detail with TVL history
description: Returns detailed info for a single DeFi protocol including per-chain TVL breakdown and 90-day TVL history.
tags: [DeFi]
parameters:
- name: slug
in: path
required: true
schema:
type: string
description: DeFiLlama protocol slug (e.g. aave, uniswap)
responses:
"200":
description: Protocol detail
content:
application/json:
schema:
type: object
properties:
data:
type: object
properties:
name:
type: string
symbol:
type: string
category:
type: string
chains:
type: array
items:
type: string
chainTvls:
type: object
additionalProperties:
type: number
description: TVL per chain
tvlHistory:
type: array
items:
type: object
properties:
date:
type: integer
totalLiquidityUSD:
type: number
description: Last 90 data points
timestamp:
type: string
format: date-time
/api/defi/chains:
get:
operationId: getDefiChains
summary: Chain TVL rankings
description: Returns all chains ranked by Total Value Locked.
tags: [DeFi]
responses:
"200":
description: Chain TVL list
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: "#/components/schemas/ChainTVL"
timestamp:
type: string
format: date-time
/api/defi/chain/{name}:
get:
operationId: getDefiChainHistory
summary: Chain TVL history
description: Returns up to 365 days of TVL history for a specific chain.
tags: [DeFi]
parameters:
- name: name
in: path
required: true
schema:
type: string
description: Chain name (e.g. Ethereum, Arbitrum)
responses:
"200":
description: Chain TVL history (last 365 data points)
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
type: object
properties:
date:
type: integer
totalLiquidityUSD:
type: number
timestamp:
type: string
format: date-time
/api/defi/yields:
get:
operationId: getDefiYields
summary: Top yield opportunities
description: Returns DeFi yield pools sorted by APY with extensive filtering options.
tags: [DeFi]
parameters:
- name: limit
in: query
schema:
type: integer
default: 100
maximum: 500
description: Max results (max 500)
- name: chain
in: query
schema:
type: string
description: Filter by chain
- name: project
in: query
schema:
type: string
description: Filter by project name
- name: stablecoin
in: query
schema:
type: string
enum: ["true", "false"]
description: Show only stablecoin pools
- name: min_tvl
in: query
schema:
type: number
default: 0
description: Minimum TVL in USD
- name: min_apy
in: query
schema:
type: number
default: 0
description: Minimum APY percentage
responses:
"200":
description: Yield pool list
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: "#/components/schemas/YieldPool"
count:
type: integer
timestamp:
type: string
format: date-time
/api/defi/stablecoins: