├── .gitignore ├── .idea ├── .name ├── compiler.xml ├── misc.xml ├── modules.xml ├── modules │ ├── cryptocompareapi.iml │ ├── cryptocompareapi_main.iml │ └── cryptocompareapi_test.iml └── vcs.xml ├── LICENSE ├── README.md ├── build.gradle ├── docs ├── allclasses-index.html ├── allclasses.html ├── allpackages-index.html ├── constant-values.html ├── deprecated-list.html ├── element-list ├── help-doc.html ├── index-all.html ├── index.html ├── jquery │ ├── external │ │ └── jquery │ │ │ └── jquery.js │ ├── images │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png │ │ ├── ui-bg_flat_75_ffffff_40x100.png │ │ ├── ui-bg_glass_55_fbf9ee_1x400.png │ │ ├── ui-bg_glass_65_ffffff_1x400.png │ │ ├── ui-bg_glass_75_dadada_1x400.png │ │ ├── ui-bg_glass_75_e6e6e6_1x400.png │ │ ├── ui-bg_glass_95_fef1ec_1x400.png │ │ ├── ui-bg_highlight-soft_75_cccccc_1x100.png │ │ ├── ui-icons_222222_256x240.png │ │ ├── ui-icons_2e83ff_256x240.png │ │ ├── ui-icons_454545_256x240.png │ │ ├── ui-icons_888888_256x240.png │ │ └── ui-icons_cd0a0a_256x240.png │ ├── jquery-3.3.1.js │ ├── jquery-migrate-3.0.1.js │ ├── jquery-ui.css │ ├── jquery-ui.js │ ├── jquery-ui.min.css │ ├── jquery-ui.min.js │ ├── jquery-ui.structure.css │ ├── jquery-ui.structure.min.css │ ├── jszip-utils │ │ └── dist │ │ │ ├── jszip-utils-ie.js │ │ │ ├── jszip-utils-ie.min.js │ │ │ ├── jszip-utils.js │ │ │ └── jszip-utils.min.js │ └── jszip │ │ └── dist │ │ ├── jszip.js │ │ └── jszip.min.js ├── me │ └── joshmcfarlin │ │ └── cryptocompareapi │ │ ├── Coins.CoinList.CoinEntry.html │ │ ├── Coins.CoinList.html │ │ ├── Coins.CoinSnapshot.Data.General.Sponsor.html │ │ ├── Coins.CoinSnapshot.Data.General.html │ │ ├── Coins.CoinSnapshot.Data.ICO.html │ │ ├── Coins.CoinSnapshot.Data.SEO.html │ │ ├── Coins.CoinSnapshot.Data.html │ │ ├── Coins.CoinSnapshot.html │ │ ├── Coins.PairSnapshot.Data.AggregatedData.html │ │ ├── Coins.PairSnapshot.Data.Exchange.html │ │ ├── Coins.PairSnapshot.Data.html │ │ ├── Coins.PairSnapshot.html │ │ ├── Coins.html │ │ ├── CryptoCompareAPI.html │ │ ├── Exceptions │ │ ├── InvalidParameterException.html │ │ ├── OutOfCallsException.html │ │ ├── package-summary.html │ │ └── package-tree.html │ │ ├── Exchanges.Exchange.html │ │ ├── Exchanges.ExchangeList.Coin.html │ │ ├── Exchanges.ExchangeList.Exchange.html │ │ ├── Exchanges.ExchangeList.html │ │ ├── Exchanges.html │ │ ├── Historic.AverageType.html │ │ ├── Historic.CalcType.html │ │ ├── Historic.History.ConversionType.html │ │ ├── Historic.History.Data.html │ │ ├── Historic.History.html │ │ ├── Historic.html │ │ ├── Market.Coin.html │ │ ├── Market.ExchangeAverage.html │ │ ├── Market.Pair.html │ │ ├── Market.html │ │ ├── Market.toSym.html │ │ ├── Mining.Coin.html │ │ ├── Mining.Contracts.Contract.html │ │ ├── Mining.Contracts.html │ │ ├── Mining.Equipment.Equip.html │ │ ├── Mining.Equipment.html │ │ ├── Mining.html │ │ ├── News.NewsProvider.html │ │ ├── News.NewsStory.ShortNewsProvider.html │ │ ├── News.NewsStory.html │ │ ├── News.html │ │ ├── Social.SocialStats.Data.CodeRepository.CodeEntry.Parent.html │ │ ├── Social.SocialStats.Data.CodeRepository.CodeEntry.Source.html │ │ ├── Social.SocialStats.Data.CodeRepository.CodeEntry.html │ │ ├── Social.SocialStats.Data.CodeRepository.html │ │ ├── Social.SocialStats.Data.CryptoCompare.CryptopianFollowers.html │ │ ├── Social.SocialStats.Data.CryptoCompare.PageViewsSplit.html │ │ ├── Social.SocialStats.Data.CryptoCompare.SimilarItem.html │ │ ├── Social.SocialStats.Data.CryptoCompare.html │ │ ├── Social.SocialStats.Data.Facebook.html │ │ ├── Social.SocialStats.Data.General.html │ │ ├── Social.SocialStats.Data.Reddit.html │ │ ├── Social.SocialStats.Data.Twitter.html │ │ ├── Social.SocialStats.Data.html │ │ ├── Social.SocialStats.html │ │ ├── Social.html │ │ ├── package-summary.html │ │ ├── package-tree.html │ │ └── utils │ │ ├── CallTypes.html │ │ ├── Connection.html │ │ ├── IntervalTypes.html │ │ ├── RateLimiting.Rates.Interval.Usage.html │ │ ├── RateLimiting.Rates.Interval.html │ │ ├── RateLimiting.Rates.html │ │ ├── RateLimiting.html │ │ ├── package-summary.html │ │ └── package-tree.html ├── member-search-index.js ├── overview-summary.html ├── overview-tree.html ├── package-search-index.js ├── resources │ ├── glass.png │ └── x.png ├── script.js ├── search.js ├── serialized-form.html ├── stylesheet.css └── type-search-index.js ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle └── src ├── main └── java │ └── me │ └── joshmcfarlin │ └── cryptocompareapi │ ├── Coins.java │ ├── CryptoCompareAPI.java │ ├── Exceptions │ ├── InvalidParameterException.java │ └── OutOfCallsException.java │ ├── Exchanges.java │ ├── Historic.java │ ├── Market.java │ ├── Mining.java │ ├── News.java │ ├── Social.java │ └── utils │ ├── CallTypes.java │ ├── Connection.java │ ├── IntervalTypes.java │ └── RateLimiting.java └── test └── java └── me └── joshmcfarlin └── cryptocompareapi ├── APITest.java └── Example.java /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.gitignore.io/api/git,java,gradle,intellij 2 | 3 | ### Git ### 4 | # Created by git for backups. To disable backups in Git: 5 | # $ git config --global mergetool.keepBackup false 6 | *.orig 7 | 8 | # Created by git when using merge tools for conflicts 9 | *.BACKUP.* 10 | *.BASE.* 11 | *.LOCAL.* 12 | *.REMOTE.* 13 | *_BACKUP_*.txt 14 | *_BASE_*.txt 15 | *_LOCAL_*.txt 16 | *_REMOTE_*.txt 17 | 18 | ### Intellij ### 19 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm 20 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 21 | 22 | # User-specific stuff 23 | .idea/**/workspace.xml 24 | .idea/**/tasks.xml 25 | .idea/**/usage.statistics.xml 26 | .idea/**/dictionaries 27 | .idea/**/shelf 28 | 29 | # Generated files 30 | .idea/**/contentModel.xml 31 | 32 | # Sensitive or high-churn files 33 | .idea/**/dataSources/ 34 | .idea/**/dataSources.ids 35 | .idea/**/dataSources.local.xml 36 | .idea/**/sqlDataSources.xml 37 | .idea/**/dynamic.xml 38 | .idea/**/uiDesigner.xml 39 | .idea/**/dbnavigator.xml 40 | 41 | # Gradle 42 | .idea/**/gradle.xml 43 | .idea/**/libraries 44 | 45 | # Gradle and Maven with auto-import 46 | # When using Gradle or Maven with auto-import, you should exclude module files, 47 | # since they will be recreated, and may cause churn. Uncomment if using 48 | # auto-import. 49 | # .idea/modules.xml 50 | # .idea/*.iml 51 | # .idea/modules 52 | 53 | # CMake 54 | cmake-build-*/ 55 | 56 | # Mongo Explorer plugin 57 | .idea/**/mongoSettings.xml 58 | 59 | # File-based project format 60 | *.iws 61 | 62 | # IntelliJ 63 | out/ 64 | 65 | # mpeltonen/sbt-idea plugin 66 | .idea_modules/ 67 | 68 | # JIRA plugin 69 | atlassian-ide-plugin.xml 70 | 71 | # Cursive Clojure plugin 72 | .idea/replstate.xml 73 | 74 | # Crashlytics plugin (for Android Studio and IntelliJ) 75 | com_crashlytics_export_strings.xml 76 | crashlytics.properties 77 | crashlytics-build.properties 78 | fabric.properties 79 | 80 | # Editor-based Rest Client 81 | .idea/httpRequests 82 | 83 | # Android studio 3.1+ serialized cache file 84 | .idea/caches/build_file_checksums.ser 85 | 86 | ### Intellij Patch ### 87 | # Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 88 | 89 | # *.iml 90 | # modules.xml 91 | # .idea/misc.xml 92 | # *.ipr 93 | 94 | # Sonarlint plugin 95 | .idea/sonarlint 96 | 97 | ### Java ### 98 | # Compiled class file 99 | *.class 100 | 101 | # Log file 102 | *.log 103 | 104 | # BlueJ files 105 | *.ctxt 106 | 107 | # Mobile Tools for Java (J2ME) 108 | .mtj.tmp/ 109 | 110 | # Package Files # 111 | *.jar 112 | *.war 113 | *.nar 114 | *.ear 115 | *.zip 116 | *.tar.gz 117 | *.rar 118 | 119 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 120 | hs_err_pid* 121 | 122 | ### Gradle ### 123 | .gradle 124 | /build/ 125 | 126 | # Ignore Gradle GUI config 127 | gradle-app.setting 128 | 129 | # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) 130 | !gradle-wrapper.jar 131 | 132 | # Cache of project 133 | .gradletasknamecache 134 | 135 | # # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 136 | # gradle/wrapper/gradle-wrapper.properties 137 | 138 | 139 | # End of https://www.gitignore.io/api/git,java,gradle,intellij 140 | 141 | /target/ 142 | /venv/ 143 | -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | cryptocompareapi -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/modules/cryptocompareapi.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /.idea/modules/cryptocompareapi_main.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/modules/cryptocompareapi_test.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Josh McFarlin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CryptoCompareAPI 2 | A Java implementation of the [CryptoCompare API service.](https://min-api.cryptocompare.com/) 3 | 4 | ## Download 5 | 6 | [![Release](https://jitpack.io/v/me.joshmcfarlin/CryptoCompareAPI.svg)](https://jitpack.io/#me.joshmcfarlin/CryptoCompareAPI) 7 | 8 | #### Gradle 9 | ``` 10 | repositories { 11 | maven { url 'https://jitpack.io' } 12 | } 13 | 14 | dependencies { 15 | implementation 'me.joshmcfarlin:CryptoCompareAPI:master-SNAPSHOT' 16 | } 17 | ``` 18 | 19 | #### Maven 20 | ```xml 21 | 22 | 23 | jitpack.io 24 | https://jitpack.io 25 | 26 | 27 | ``` 28 | ```xml 29 | 30 | me.joshmcfarlin 31 | CryptoCompareAPI 32 | master-SNAPSHOT 33 | 34 | ``` 35 | 36 | ## Usage 37 | ```java 38 | public class Test { 39 | private CryptoCompareAPI api = new CryptoCompareAPI(); 40 | 41 | public static void main(String[] args) { 42 | double dayAverage = api.historic.getDayAverage("BTC", "USD"); 43 | System.out.println("Bitcoin day average:"); 44 | System.out.println(dayAverage); 45 | 46 | Market.ExchangeAverage exchangeAverage = api.market.getExchangeAverage("BTC", "USD", "Coinbase,Kraken,Bitstamp"); 47 | System.out.println("Bitcoin average from Coinbase, Kraken, and Bitstamp:"); 48 | System.out.println(exchangeAverage.getHigh24Hour()); 49 | 50 | Map btcPrice = api.market.getPrice("BTC", "USD,EUR"); 51 | System.out.println("Bitcoin price in USD and EUR:"); 52 | System.out.println(btcPrice); 53 | } 54 | } 55 | ``` 56 | 57 | An example is provided in the test sources. 58 | 59 | ## Documentation 60 | 61 | Documentation is provided at [https://joshmcfarlin.me/CryptoCompareAPI/](https://joshmcfarlin.me/CryptoCompareAPI/) 62 | 63 | ## License 64 | This project is developed under the MIT license. This can be found at [LICENSE](LICENSE). 65 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | group = 'me.joshmcfarlin' 4 | version = '1.1' 5 | 6 | description = """A Java implementation of the CryptoCompare API service.""" 7 | 8 | sourceCompatibility = 1.8 9 | targetCompatibility = 1.8 10 | tasks.withType(JavaCompile) { 11 | options.encoding = 'UTF-8' 12 | } 13 | 14 | configurations.all { 15 | } 16 | 17 | repositories { 18 | mavenCentral() 19 | } 20 | 21 | dependencies { 22 | implementation 'com.google.code.gson:gson:2.8.5' 23 | testImplementation 'org.junit.jupiter:junit-jupiter-api:5.1.0' 24 | testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.1.0' 25 | } 26 | 27 | test { 28 | useJUnit() 29 | maxHeapSize = '1G' 30 | } 31 | 32 | javadoc { 33 | destinationDir = file("${projectDir}/docs") 34 | } -------------------------------------------------------------------------------- /docs/allclasses.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | All Classes (cryptocompareapi 1.1 API) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 22 |

All Classes

23 |
24 | 42 |
43 | 44 | 45 | -------------------------------------------------------------------------------- /docs/allpackages-index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | All Packages (cryptocompareapi 1.1 API) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 22 | 34 | 37 |
38 | 94 |
95 |
96 |
97 |

All Packages

98 |
99 |
100 | 125 |
126 |
127 | 172 | 173 | 174 | -------------------------------------------------------------------------------- /docs/constant-values.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Constant Field Values (cryptocompareapi 1.1 API) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 22 | 34 | 37 |
38 | 94 |
95 |
96 |
97 |

Constant Field Values

98 |
99 |

Contents

100 |
101 |
102 |
103 | 148 | 149 | 150 | -------------------------------------------------------------------------------- /docs/deprecated-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Deprecated List (cryptocompareapi 1.1 API) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 22 | 34 | 37 |
38 | 94 |
95 |
96 |
97 |

Deprecated API

98 |

Contents

99 |
100 |
101 | 146 | 147 | 148 | -------------------------------------------------------------------------------- /docs/element-list: -------------------------------------------------------------------------------- 1 | me.joshmcfarlin.cryptocompareapi 2 | me.joshmcfarlin.cryptocompareapi.Exceptions 3 | me.joshmcfarlin.cryptocompareapi.utils 4 | -------------------------------------------------------------------------------- /docs/help-doc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | API Help (cryptocompareapi 1.1 API) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 22 | 34 | 37 |
38 | 94 |
95 |
96 |
97 |

How This API Document Is Organized

98 |
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
99 |
100 |
101 |
    102 |
  • 103 |
    104 |

    Overview

    105 |

    The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.

    106 |
    107 |
  • 108 |
  • 109 |
    110 |

    Package

    111 |

    Each package has a page that contains a list of its classes and interfaces, with a summary for each. These pages may contain six categories:

    112 |
      113 |
    • Interfaces
    • 114 |
    • Classes
    • 115 |
    • Enums
    • 116 |
    • Exceptions
    • 117 |
    • Errors
    • 118 |
    • Annotation Types
    • 119 |
    120 |
    121 |
  • 122 |
  • 123 |
    124 |

    Class or Interface

    125 |

    Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

    126 |
      127 |
    • Class Inheritance Diagram
    • 128 |
    • Direct Subclasses
    • 129 |
    • All Known Subinterfaces
    • 130 |
    • All Known Implementing Classes
    • 131 |
    • Class or Interface Declaration
    • 132 |
    • Class or Interface Description
    • 133 |
    134 |
    135 |
      136 |
    • Nested Class Summary
    • 137 |
    • Field Summary
    • 138 |
    • Property Summary
    • 139 |
    • Constructor Summary
    • 140 |
    • Method Summary
    • 141 |
    142 |
    143 |
      144 |
    • Field Detail
    • 145 |
    • Property Detail
    • 146 |
    • Constructor Detail
    • 147 |
    • Method Detail
    • 148 |
    149 |

    Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.

    150 |
    151 |
  • 152 |
  • 153 |
    154 |

    Annotation Type

    155 |

    Each annotation type has its own separate page with the following sections:

    156 |
      157 |
    • Annotation Type Declaration
    • 158 |
    • Annotation Type Description
    • 159 |
    • Required Element Summary
    • 160 |
    • Optional Element Summary
    • 161 |
    • Element Detail
    • 162 |
    163 |
    164 |
  • 165 |
  • 166 |
    167 |

    Enum

    168 |

    Each enum has its own separate page with the following sections:

    169 |
      170 |
    • Enum Declaration
    • 171 |
    • Enum Description
    • 172 |
    • Enum Constant Summary
    • 173 |
    • Enum Constant Detail
    • 174 |
    175 |
    176 |
  • 177 |
  • 178 |
    179 |

    Tree (Class Hierarchy)

    180 |

    There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. Classes are organized by inheritance structure starting with java.lang.Object. Interfaces do not inherit from java.lang.Object.

    181 |
      182 |
    • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
    • 183 |
    • When viewing a particular package, class or interface page, clicking on "Tree" displays the hierarchy for only that package.
    • 184 |
    185 |
    186 |
  • 187 |
  • 188 |
    189 |

    Deprecated API

    190 |

    The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.

    191 |
    192 |
  • 193 |
  • 194 |
    195 |

    Index

    196 |

    The Index contains an alphabetic index of all classes, interfaces, constructors, methods, and fields, as well as lists of all packages and all classes.

    197 |
    198 |
  • 199 |
  • 200 |
    201 |

    All Classes

    202 |

    The All Classes link shows all classes and interfaces except non-static nested types.

    203 |
    204 |
  • 205 |
  • 206 |
    207 |

    Serialized Form

    208 |

    Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.

    209 |
    210 |
  • 211 |
  • 212 |
    213 |

    Constant Field Values

    214 |

    The Constant Field Values page lists the static final fields and their values.

    215 |
    216 |
  • 217 |
  • 218 |
    219 |

    Search

    220 |

    You can search for definitions of modules, packages, types, fields, methods and other terms defined in the API, using some or all of the name. "Camel-case" abbreviations are supported: for example, "InpStr" will find "InputStream" and "InputStreamReader".

    221 |
    222 |
  • 223 |
224 |
225 | This help file applies to API documentation generated by the standard doclet.
226 |
227 | 272 | 273 | 274 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Overview (cryptocompareapi 1.1 API) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 22 | 34 | 37 |
38 | 94 |
95 |
96 |

cryptocompareapi 1.1 API

97 |
98 |
99 |
100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 |
Packages 
PackageDescription
me.joshmcfarlin.cryptocompareapi 
me.joshmcfarlin.cryptocompareapi.Exceptions 
me.joshmcfarlin.cryptocompareapi.utils 
121 |
122 |
123 | 168 | 169 | 170 | -------------------------------------------------------------------------------- /docs/jquery/images/ui-bg_flat_0_aaaaaa_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Josh-McFarlin/CryptoCompareAPI/7326a5dc2dbc9e5b2127e52bfe2901336d69cae6/docs/jquery/images/ui-bg_flat_0_aaaaaa_40x100.png -------------------------------------------------------------------------------- /docs/jquery/images/ui-bg_flat_75_ffffff_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Josh-McFarlin/CryptoCompareAPI/7326a5dc2dbc9e5b2127e52bfe2901336d69cae6/docs/jquery/images/ui-bg_flat_75_ffffff_40x100.png -------------------------------------------------------------------------------- /docs/jquery/images/ui-bg_glass_55_fbf9ee_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Josh-McFarlin/CryptoCompareAPI/7326a5dc2dbc9e5b2127e52bfe2901336d69cae6/docs/jquery/images/ui-bg_glass_55_fbf9ee_1x400.png -------------------------------------------------------------------------------- /docs/jquery/images/ui-bg_glass_65_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Josh-McFarlin/CryptoCompareAPI/7326a5dc2dbc9e5b2127e52bfe2901336d69cae6/docs/jquery/images/ui-bg_glass_65_ffffff_1x400.png -------------------------------------------------------------------------------- /docs/jquery/images/ui-bg_glass_75_dadada_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Josh-McFarlin/CryptoCompareAPI/7326a5dc2dbc9e5b2127e52bfe2901336d69cae6/docs/jquery/images/ui-bg_glass_75_dadada_1x400.png -------------------------------------------------------------------------------- /docs/jquery/images/ui-bg_glass_75_e6e6e6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Josh-McFarlin/CryptoCompareAPI/7326a5dc2dbc9e5b2127e52bfe2901336d69cae6/docs/jquery/images/ui-bg_glass_75_e6e6e6_1x400.png -------------------------------------------------------------------------------- /docs/jquery/images/ui-bg_glass_95_fef1ec_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Josh-McFarlin/CryptoCompareAPI/7326a5dc2dbc9e5b2127e52bfe2901336d69cae6/docs/jquery/images/ui-bg_glass_95_fef1ec_1x400.png -------------------------------------------------------------------------------- /docs/jquery/images/ui-bg_highlight-soft_75_cccccc_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Josh-McFarlin/CryptoCompareAPI/7326a5dc2dbc9e5b2127e52bfe2901336d69cae6/docs/jquery/images/ui-bg_highlight-soft_75_cccccc_1x100.png -------------------------------------------------------------------------------- /docs/jquery/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Josh-McFarlin/CryptoCompareAPI/7326a5dc2dbc9e5b2127e52bfe2901336d69cae6/docs/jquery/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /docs/jquery/images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Josh-McFarlin/CryptoCompareAPI/7326a5dc2dbc9e5b2127e52bfe2901336d69cae6/docs/jquery/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /docs/jquery/images/ui-icons_454545_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Josh-McFarlin/CryptoCompareAPI/7326a5dc2dbc9e5b2127e52bfe2901336d69cae6/docs/jquery/images/ui-icons_454545_256x240.png -------------------------------------------------------------------------------- /docs/jquery/images/ui-icons_888888_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Josh-McFarlin/CryptoCompareAPI/7326a5dc2dbc9e5b2127e52bfe2901336d69cae6/docs/jquery/images/ui-icons_888888_256x240.png -------------------------------------------------------------------------------- /docs/jquery/images/ui-icons_cd0a0a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Josh-McFarlin/CryptoCompareAPI/7326a5dc2dbc9e5b2127e52bfe2901336d69cae6/docs/jquery/images/ui-icons_cd0a0a_256x240.png -------------------------------------------------------------------------------- /docs/jquery/jquery-ui.structure.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery UI CSS Framework 1.11.4 3 | * http://jqueryui.com 4 | * 5 | * Copyright jQuery Foundation and other contributors 6 | * Released under the MIT license. 7 | * http://jquery.org/license 8 | * 9 | * http://api.jqueryui.com/category/theming/ 10 | */ 11 | 12 | /* Layout helpers 13 | ----------------------------------*/ 14 | .ui-helper-hidden { 15 | display: none; 16 | } 17 | .ui-helper-hidden-accessible { 18 | border: 0; 19 | clip: rect(0 0 0 0); 20 | height: 1px; 21 | margin: -1px; 22 | overflow: hidden; 23 | padding: 0; 24 | position: absolute; 25 | width: 1px; 26 | } 27 | .ui-helper-reset { 28 | margin: 0; 29 | padding: 0; 30 | border: 0; 31 | outline: 0; 32 | line-height: 1.3; 33 | text-decoration: none; 34 | font-size: 100%; 35 | list-style: none; 36 | } 37 | .ui-helper-clearfix:before, 38 | .ui-helper-clearfix:after { 39 | content: ""; 40 | display: table; 41 | border-collapse: collapse; 42 | } 43 | .ui-helper-clearfix:after { 44 | clear: both; 45 | } 46 | .ui-helper-clearfix { 47 | min-height: 0; /* support: IE7 */ 48 | } 49 | .ui-helper-zfix { 50 | width: 100%; 51 | height: 100%; 52 | top: 0; 53 | left: 0; 54 | position: absolute; 55 | opacity: 0; 56 | filter:Alpha(Opacity=0); /* support: IE8 */ 57 | } 58 | 59 | .ui-front { 60 | z-index: 100; 61 | } 62 | 63 | 64 | /* Interaction Cues 65 | ----------------------------------*/ 66 | .ui-state-disabled { 67 | cursor: default !important; 68 | } 69 | 70 | 71 | /* Icons 72 | ----------------------------------*/ 73 | 74 | /* states and images */ 75 | .ui-icon { 76 | display: block; 77 | text-indent: -99999px; 78 | overflow: hidden; 79 | background-repeat: no-repeat; 80 | } 81 | 82 | 83 | /* Misc visuals 84 | ----------------------------------*/ 85 | 86 | /* Overlays */ 87 | .ui-widget-overlay { 88 | position: fixed; 89 | top: 0; 90 | left: 0; 91 | width: 100%; 92 | height: 100%; 93 | } 94 | .ui-autocomplete { 95 | position: absolute; 96 | top: 0; 97 | left: 0; 98 | cursor: default; 99 | } 100 | .ui-menu { 101 | list-style: none; 102 | padding: 0; 103 | margin: 0; 104 | display: block; 105 | outline: none; 106 | } 107 | .ui-menu .ui-menu { 108 | position: absolute; 109 | } 110 | .ui-menu .ui-menu-item { 111 | position: relative; 112 | margin: 0; 113 | padding: 3px 1em 3px .4em; 114 | cursor: pointer; 115 | min-height: 0; /* support: IE7 */ 116 | /* support: IE10, see #8844 */ 117 | list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"); 118 | } 119 | .ui-menu .ui-menu-divider { 120 | margin: 5px 0; 121 | height: 0; 122 | font-size: 0; 123 | line-height: 0; 124 | border-width: 1px 0 0 0; 125 | } 126 | .ui-menu .ui-state-focus, 127 | .ui-menu .ui-state-active { 128 | margin: -1px; 129 | } 130 | 131 | /* icon support */ 132 | .ui-menu-icons { 133 | position: relative; 134 | } 135 | .ui-menu-icons .ui-menu-item { 136 | padding-left: 2em; 137 | } 138 | 139 | /* left-aligned */ 140 | .ui-menu .ui-icon { 141 | position: absolute; 142 | top: 0; 143 | bottom: 0; 144 | left: .2em; 145 | margin: auto 0; 146 | } 147 | 148 | /* right-aligned */ 149 | .ui-menu .ui-menu-icon { 150 | left: auto; 151 | right: 0; 152 | } 153 | -------------------------------------------------------------------------------- /docs/jquery/jquery-ui.structure.min.css: -------------------------------------------------------------------------------- 1 | /*! jQuery UI - v1.11.4 - 2015-05-20 2 | * http://jqueryui.com 3 | * Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */ 4 | 5 | .ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:none}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{position:relative;margin:0;padding:3px 1em 3px .4em;cursor:pointer;min-height:0;list-style-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-state-focus,.ui-menu .ui-state-active{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0} 6 | -------------------------------------------------------------------------------- /docs/jquery/jszip-utils/dist/jszip-utils-ie.js: -------------------------------------------------------------------------------- 1 | /*! 2 | 3 | JSZipUtils - A collection of cross-browser utilities to go along with JSZip. 4 | 5 | 6 | (c) 2014 Stuart Knightley, David Duponchel 7 | Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip-utils/master/LICENSE.markdown. 8 | 9 | */ 10 | ;(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o\r\n"+ 18 | "\r\n"; 32 | 33 | // inject VBScript 34 | document.write(IEBinaryToArray_ByteStr_Script); 35 | 36 | global.JSZipUtils._getBinaryFromXHR = function (xhr) { 37 | var binary = xhr.responseBody; 38 | var byteMapping = {}; 39 | for ( var i = 0; i < 256; i++ ) { 40 | for ( var j = 0; j < 256; j++ ) { 41 | byteMapping[ String.fromCharCode( i + (j << 8) ) ] = 42 | String.fromCharCode(i) + String.fromCharCode(j); 43 | } 44 | } 45 | var rawBytes = IEBinaryToArray_ByteStr(binary); 46 | var lastChr = IEBinaryToArray_ByteStr_Last(binary); 47 | return rawBytes.replace(/[\s\S]/g, function( match ) { 48 | return byteMapping[match]; 49 | }) + lastChr; 50 | }; 51 | 52 | // enforcing Stuk's coding style 53 | // vim: set shiftwidth=4 softtabstop=4: 54 | 55 | },{}]},{},[1]) 56 | ; 57 | -------------------------------------------------------------------------------- /docs/jquery/jszip-utils/dist/jszip-utils-ie.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | 3 | JSZipUtils - A collection of cross-browser utilities to go along with JSZip. 4 | 5 | 6 | (c) 2014 Stuart Knightley, David Duponchel 7 | Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip-utils/master/LICENSE.markdown. 8 | 9 | */ 10 | !function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g\r\n";document.write(b),a.JSZipUtils._getBinaryFromXHR=function(a){for(var b=a.responseBody,c={},d=0;256>d;d++)for(var e=0;256>e;e++)c[String.fromCharCode(d+(e<<8))]=String.fromCharCode(d)+String.fromCharCode(e);var f=IEBinaryToArray_ByteStr(b),g=IEBinaryToArray_ByteStr_Last(b);return f.replace(/[\s\S]/g,function(a){return c[a]})+g}},{}]},{},[1]); 11 | -------------------------------------------------------------------------------- /docs/jquery/jszip-utils/dist/jszip-utils.js: -------------------------------------------------------------------------------- 1 | /*! 2 | 3 | JSZipUtils - A collection of cross-browser utilities to go along with JSZip. 4 | 5 | 6 | (c) 2014 Stuart Knightley, David Duponchel 7 | Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip-utils/master/LICENSE.markdown. 8 | 9 | */ 10 | !function(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.JSZipUtils=e():"undefined"!=typeof global?global.JSZipUtils=e():"undefined"!=typeof self&&(self.JSZipUtils=e())}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 5 | 6 | (c) 2014 Stuart Knightley, David Duponchel 7 | Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip-utils/master/LICENSE.markdown. 8 | 9 | */ 10 | !function(a){"object"==typeof exports?module.exports=a():"function"==typeof define&&define.amd?define(a):"undefined"!=typeof window?window.JSZipUtils=a():"undefined"!=typeof global?global.JSZipUtils=a():"undefined"!=typeof self&&(self.JSZipUtils=a())}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g 2 | 3 | 4 | 5 | 6 | InvalidParameterException (cryptocompareapi 1.1 API) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 22 | 34 | 37 |
38 | 109 |
110 | 111 |
112 |
113 | 114 |

Class InvalidParameterException

115 |
116 |
117 |
    118 |
  • java.lang.Object
  • 119 |
  • 120 |
      121 |
    • java.lang.Throwable
    • 122 |
    • 123 |
        124 |
      • java.lang.Exception
      • 125 |
      • 126 |
          127 |
        • me.joshmcfarlin.cryptocompareapi.Exceptions.InvalidParameterException
        • 128 |
        129 |
      • 130 |
      131 |
    • 132 |
    133 |
  • 134 |
135 |
136 |
    137 |
  • 138 |
    139 |
    All Implemented Interfaces:
    140 |
    java.io.Serializable
    141 |
    142 |
    143 |
    public class InvalidParameterException
    144 | extends java.lang.Exception
    145 |
    Represents an error when a provided parameter does not meet the guidelines of the API
    146 |
    147 |
    See Also:
    148 |
    Serialized Form
    149 |
    150 |
  • 151 |
152 |
153 |
154 |
    155 |
  • 156 | 157 |
    158 |
      159 |
    • 160 | 161 | 162 |

      Constructor Summary

      163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 174 | 175 |
      Constructors 
      ConstructorDescription
      InvalidParameterException​(java.lang.String message) 172 |
      Creates an exception to be called when a parameter is incorrect
      173 |
      176 |
    • 177 |
    178 |
    179 | 180 |
    181 |
      182 |
    • 183 | 184 | 185 |

      Method Summary

      186 |
        187 |
      • 188 | 189 | 190 |

        Methods inherited from class java.lang.Throwable

        191 | addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • 192 |
      193 |
        194 |
      • 195 | 196 | 197 |

        Methods inherited from class java.lang.Object

        198 | clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • 199 |
      200 |
    • 201 |
    202 |
    203 |
  • 204 |
205 |
206 |
207 |
    208 |
  • 209 | 210 |
    211 |
      212 |
    • 213 | 214 | 215 |

      Constructor Detail

      216 | 217 | 218 | 219 |
        220 |
      • 221 |

        InvalidParameterException

        222 |
        public InvalidParameterException​(java.lang.String message)
        223 |
        Creates an exception to be called when a parameter is incorrect
        224 |
        225 |
        Parameters:
        226 |
        message - The error message to be displayed
        227 |
        228 |
      • 229 |
      230 |
    • 231 |
    232 |
    233 |
  • 234 |
235 |
236 |
237 |
238 | 239 |
240 | 298 |
299 | 300 | 301 | -------------------------------------------------------------------------------- /docs/me/joshmcfarlin/cryptocompareapi/Exceptions/OutOfCallsException.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | OutOfCallsException (cryptocompareapi 1.1 API) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 22 | 34 | 37 |
38 | 109 |
110 | 111 |
112 |
113 | 114 |

Class OutOfCallsException

115 |
116 |
117 |
    118 |
  • java.lang.Object
  • 119 |
  • 120 |
      121 |
    • java.lang.Throwable
    • 122 |
    • 123 |
        124 |
      • java.lang.Exception
      • 125 |
      • 126 |
          127 |
        • me.joshmcfarlin.cryptocompareapi.Exceptions.OutOfCallsException
        • 128 |
        129 |
      • 130 |
      131 |
    • 132 |
    133 |
  • 134 |
135 |
136 |
    137 |
  • 138 |
    139 |
    All Implemented Interfaces:
    140 |
    java.io.Serializable
    141 |
    142 |
    143 |
    public class OutOfCallsException
    144 | extends java.lang.Exception
    145 |
    Represents an error when no more API calls remain
    146 |
    147 |
    See Also:
    148 |
    Serialized Form
    149 |
    150 |
  • 151 |
152 |
153 |
154 |
    155 |
  • 156 | 157 |
    158 |
      159 |
    • 160 | 161 | 162 |

      Constructor Summary

      163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 174 | 175 |
      Constructors 
      ConstructorDescription
      OutOfCallsException​(java.lang.String message) 172 |
      Creates an exception to be called when no more API calls are left in the current interval
      173 |
      176 |
    • 177 |
    178 |
    179 | 180 |
    181 |
      182 |
    • 183 | 184 | 185 |

      Method Summary

      186 |
        187 |
      • 188 | 189 | 190 |

        Methods inherited from class java.lang.Throwable

        191 | addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • 192 |
      193 |
        194 |
      • 195 | 196 | 197 |

        Methods inherited from class java.lang.Object

        198 | clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • 199 |
      200 |
    • 201 |
    202 |
    203 |
  • 204 |
205 |
206 |
207 |
    208 |
  • 209 | 210 |
    211 |
      212 |
    • 213 | 214 | 215 |

      Constructor Detail

      216 | 217 | 218 | 219 |
        220 |
      • 221 |

        OutOfCallsException

        222 |
        public OutOfCallsException​(java.lang.String message)
        223 |
        Creates an exception to be called when no more API calls are left in the current interval
        224 |
        225 |
        Parameters:
        226 |
        message - The error message to be displayed
        227 |
        228 |
      • 229 |
      230 |
    • 231 |
    232 |
    233 |
  • 234 |
235 |
236 |
237 |
238 | 239 |
240 | 298 |
299 | 300 | 301 | -------------------------------------------------------------------------------- /docs/me/joshmcfarlin/cryptocompareapi/Exceptions/package-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | me.joshmcfarlin.cryptocompareapi.Exceptions (cryptocompareapi 1.1 API) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 22 | 34 | 37 |
38 | 94 |
95 |
96 |
97 |

Package me.joshmcfarlin.cryptocompareapi.Exceptions

98 |
99 |
100 |
    101 |
  • 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 114 | 115 | 116 | 117 | 120 | 121 | 122 |
    Exception Summary 
    ExceptionDescription
    InvalidParameterException 112 |
    Represents an error when a provided parameter does not meet the guidelines of the API
    113 |
    OutOfCallsException 118 |
    Represents an error when no more API calls remain
    119 |
    123 |
  • 124 |
125 |
126 |
127 |
128 | 171 |
172 | 173 | 174 | -------------------------------------------------------------------------------- /docs/me/joshmcfarlin/cryptocompareapi/Exceptions/package-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | me.joshmcfarlin.cryptocompareapi.Exceptions Class Hierarchy (cryptocompareapi 1.1 API) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 22 | 34 | 37 |
38 | 94 |
95 |
96 |
97 |

Hierarchy For Package me.joshmcfarlin.cryptocompareapi.Exceptions

98 | Package Hierarchies: 99 | 102 |
103 |
104 |
105 |

Class Hierarchy

106 |
    107 |
  • java.lang.Object 108 |
      109 |
    • java.lang.Throwable (implements java.io.Serializable) 110 | 118 |
    • 119 |
    120 |
  • 121 |
122 |
123 |
124 |
125 |
126 | 169 |
170 | 171 | 172 | -------------------------------------------------------------------------------- /docs/me/joshmcfarlin/cryptocompareapi/Exchanges.ExchangeList.Coin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exchanges.ExchangeList.Coin (cryptocompareapi 1.1 API) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 22 | 40 | 43 |
44 | 115 |
116 | 117 |
118 |
119 | 120 |

Class Exchanges.ExchangeList.Coin

121 |
122 |
123 |
    124 |
  • java.lang.Object
  • 125 |
  • 126 |
      127 |
    • me.joshmcfarlin.cryptocompareapi.Exchanges.ExchangeList.Coin
    • 128 |
    129 |
  • 130 |
131 |
132 |
    133 |
  • 134 |
    135 |
    Enclosing class:
    136 |
    Exchanges.ExchangeList
    137 |
    138 |
    139 |
    public class Exchanges.ExchangeList.Coin
    140 | extends java.lang.Object
    141 |
    Represents a cryptocurrency
    142 |
  • 143 |
144 |
145 |
146 |
    147 |
  • 148 | 149 |
    150 |
      151 |
    • 152 | 153 | 154 |

      Method Summary

      155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 168 | 169 |
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      java.util.List<java.lang.String>getTradingPairs() 166 | 167 |
      170 |
        171 |
      • 172 | 173 | 174 |

        Methods inherited from class java.lang.Object

        175 | clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • 176 |
      177 |
    • 178 |
    179 |
    180 |
  • 181 |
182 |
183 |
184 |
    185 |
  • 186 | 187 |
    188 |
      189 |
    • 190 | 191 | 192 |

      Method Detail

      193 | 194 | 195 | 196 |
        197 |
      • 198 |

        getTradingPairs

        199 |
        public java.util.List<java.lang.String> getTradingPairs()
        200 | 201 |
      • 202 |
      203 |
    • 204 |
    205 |
    206 |
  • 207 |
208 |
209 |
210 |
211 | 212 |
213 | 271 |
272 | 273 | 274 | -------------------------------------------------------------------------------- /docs/me/joshmcfarlin/cryptocompareapi/Exchanges.ExchangeList.Exchange.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exchanges.ExchangeList.Exchange (cryptocompareapi 1.1 API) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 22 | 40 | 43 |
44 | 115 |
116 | 117 |
118 |
119 | 120 |

Class Exchanges.ExchangeList.Exchange

121 |
122 |
123 |
    124 |
  • java.lang.Object
  • 125 |
  • 126 |
      127 |
    • me.joshmcfarlin.cryptocompareapi.Exchanges.ExchangeList.Exchange
    • 128 |
    129 |
  • 130 |
131 |
132 |
    133 |
  • 134 |
    135 |
    Enclosing class:
    136 |
    Exchanges.ExchangeList
    137 |
    138 |
    139 |
    public class Exchanges.ExchangeList.Exchange
    140 | extends java.lang.Object
    141 |
    Represents a cryptocurrency exchange
    142 |
  • 143 |
144 |
145 |
146 |
    147 |
  • 148 | 149 |
    150 | 179 |
    180 |
  • 181 |
182 |
183 |
184 | 208 |
209 |
210 |
211 | 212 |
213 | 271 |
272 | 273 | 274 | -------------------------------------------------------------------------------- /docs/me/joshmcfarlin/cryptocompareapi/package-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | me.joshmcfarlin.cryptocompareapi (cryptocompareapi 1.1 API) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 22 | 34 | 37 |
38 | 94 |
95 |
96 |
97 |

Package me.joshmcfarlin.cryptocompareapi

98 |
99 |
100 |
    101 |
  • 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 114 | 115 | 116 | 117 | 120 | 121 | 122 | 123 | 126 | 127 | 128 | 129 | 132 | 133 | 134 | 135 | 138 | 139 | 140 | 141 | 144 | 145 | 146 | 147 | 150 | 151 | 152 | 153 | 156 | 157 | 158 |
    Class Summary 
    ClassDescription
    Coins 112 |
    Contains methods for requesting information about coins listed by CryptoCompare
    113 |
    CryptoCompareAPI 118 |
    The class's default class to access all the methods
    119 |
    Exchanges 124 |
    Contains methods for requesting information about Exchanges listed by CryptoCompare
    125 |
    Historic 130 |
    Contains methods for requesting information about historic cryptocurrency prices
    131 |
    Market 136 |
    Contains methods for requesting information about the cryptocurrency market on multiple exchanges
    137 |
    Mining 142 |
    Contains methods for requesting information about cryptocurrency mining
    143 |
    News 148 |
    Contains methods for requesting information about news listed on CryptoCompare
    149 |
    Social 154 |
    Contains methods for requesting information about social media accounts for cryptocurrencies and exchanges
    155 |
    159 |
  • 160 |
  • 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 173 | 174 | 175 | 176 | 179 | 180 | 181 |
    Enum Summary 
    EnumDescription
    Historic.AverageType 171 |
    Represents Average Type used by the API
    172 |
    Historic.CalcType 177 |
    Represents Calculation Type used by the API
    178 |
    182 |
  • 183 |
184 |
185 |
186 |
187 | 230 |
231 | 232 | 233 | -------------------------------------------------------------------------------- /docs/me/joshmcfarlin/cryptocompareapi/utils/package-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | me.joshmcfarlin.cryptocompareapi.utils (cryptocompareapi 1.1 API) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 22 | 34 | 37 |
38 | 94 |
95 |
96 |
97 |

Package me.joshmcfarlin.cryptocompareapi.utils

98 |
99 |
100 |
    101 |
  • 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 114 | 115 | 116 | 117 | 120 | 121 | 122 |
    Class Summary 
    ClassDescription
    Connection 112 |
    Contains methods for creating JSON GET requests
    113 |
    RateLimiting 118 |
    Contains methods for limiting API calls to provided limits
    119 |
    123 |
  • 124 |
  • 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 137 | 138 | 139 | 140 | 143 | 144 | 145 |
    Enum Summary 
    EnumDescription
    CallTypes 135 |
    Represents all available API call types
    136 |
    IntervalTypes 141 |
    Represents all available API call intervals
    142 |
    146 |
  • 147 |
148 |
149 |
150 |
151 | 194 |
195 | 196 | 197 | -------------------------------------------------------------------------------- /docs/me/joshmcfarlin/cryptocompareapi/utils/package-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | me.joshmcfarlin.cryptocompareapi.utils Class Hierarchy (cryptocompareapi 1.1 API) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 22 | 34 | 37 |
38 | 94 |
95 |
96 |
97 |

Hierarchy For Package me.joshmcfarlin.cryptocompareapi.utils

98 | Package Hierarchies: 99 | 102 |
103 |
104 |
105 |

Class Hierarchy

106 | 117 |
118 |
119 |

Enum Hierarchy

120 |
    121 |
  • java.lang.Object 122 |
      123 |
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable) 124 |
        125 |
      • me.joshmcfarlin.cryptocompareapi.utils.CallTypes
      • 126 |
      • me.joshmcfarlin.cryptocompareapi.utils.IntervalTypes
      • 127 |
      128 |
    • 129 |
    130 |
  • 131 |
132 |
133 |
134 |
135 |
136 | 179 |
180 | 181 | 182 | -------------------------------------------------------------------------------- /docs/overview-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | cryptocompareapi 1.1 API 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 |
17 | 20 |

index.html

21 |
22 | 23 | 24 | -------------------------------------------------------------------------------- /docs/package-search-index.js: -------------------------------------------------------------------------------- 1 | packageSearchIndex = [{"l":"All Packages","url":"allpackages-index.html"},{"l":"me.joshmcfarlin.cryptocompareapi"},{"l":"me.joshmcfarlin.cryptocompareapi.Exceptions"},{"l":"me.joshmcfarlin.cryptocompareapi.utils"}] -------------------------------------------------------------------------------- /docs/resources/glass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Josh-McFarlin/CryptoCompareAPI/7326a5dc2dbc9e5b2127e52bfe2901336d69cae6/docs/resources/glass.png -------------------------------------------------------------------------------- /docs/resources/x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Josh-McFarlin/CryptoCompareAPI/7326a5dc2dbc9e5b2127e52bfe2901336d69cae6/docs/resources/x.png -------------------------------------------------------------------------------- /docs/script.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | 26 | var moduleSearchIndex; 27 | var packageSearchIndex; 28 | var typeSearchIndex; 29 | var memberSearchIndex; 30 | var tagSearchIndex; 31 | function loadScripts(doc, tag) { 32 | createElem(doc, tag, 'jquery/jszip/dist/jszip.js'); 33 | createElem(doc, tag, 'jquery/jszip-utils/dist/jszip-utils.js'); 34 | if (window.navigator.userAgent.indexOf('MSIE ') > 0 || window.navigator.userAgent.indexOf('Trident/') > 0 || 35 | window.navigator.userAgent.indexOf('Edge/') > 0) { 36 | createElem(doc, tag, 'jquery/jszip-utils/dist/jszip-utils-ie.js'); 37 | } 38 | createElem(doc, tag, 'search.js'); 39 | 40 | $.get(pathtoroot + "module-search-index.zip") 41 | .done(function() { 42 | JSZipUtils.getBinaryContent(pathtoroot + "module-search-index.zip", function(e, data) { 43 | var zip = new JSZip(data); 44 | zip.load(data); 45 | moduleSearchIndex = JSON.parse(zip.file("module-search-index.json").asText()); 46 | }); 47 | }); 48 | $.get(pathtoroot + "package-search-index.zip") 49 | .done(function() { 50 | JSZipUtils.getBinaryContent(pathtoroot + "package-search-index.zip", function(e, data) { 51 | var zip = new JSZip(data); 52 | zip.load(data); 53 | packageSearchIndex = JSON.parse(zip.file("package-search-index.json").asText()); 54 | }); 55 | }); 56 | $.get(pathtoroot + "type-search-index.zip") 57 | .done(function() { 58 | JSZipUtils.getBinaryContent(pathtoroot + "type-search-index.zip", function(e, data) { 59 | var zip = new JSZip(data); 60 | zip.load(data); 61 | typeSearchIndex = JSON.parse(zip.file("type-search-index.json").asText()); 62 | }); 63 | }); 64 | $.get(pathtoroot + "member-search-index.zip") 65 | .done(function() { 66 | JSZipUtils.getBinaryContent(pathtoroot + "member-search-index.zip", function(e, data) { 67 | var zip = new JSZip(data); 68 | zip.load(data); 69 | memberSearchIndex = JSON.parse(zip.file("member-search-index.json").asText()); 70 | }); 71 | }); 72 | $.get(pathtoroot + "tag-search-index.zip") 73 | .done(function() { 74 | JSZipUtils.getBinaryContent(pathtoroot + "tag-search-index.zip", function(e, data) { 75 | var zip = new JSZip(data); 76 | zip.load(data); 77 | tagSearchIndex = JSON.parse(zip.file("tag-search-index.json").asText()); 78 | }); 79 | }); 80 | if (!moduleSearchIndex) { 81 | createElem(doc, tag, 'module-search-index.js'); 82 | } 83 | if (!packageSearchIndex) { 84 | createElem(doc, tag, 'package-search-index.js'); 85 | } 86 | if (!typeSearchIndex) { 87 | createElem(doc, tag, 'type-search-index.js'); 88 | } 89 | if (!memberSearchIndex) { 90 | createElem(doc, tag, 'member-search-index.js'); 91 | } 92 | if (!tagSearchIndex) { 93 | createElem(doc, tag, 'tag-search-index.js'); 94 | } 95 | $(window).resize(function() { 96 | $('.navPadding').css('padding-top', $('.fixedNav').css("height")); 97 | }); 98 | } 99 | 100 | function createElem(doc, tag, path) { 101 | var script = doc.createElement(tag); 102 | var scriptElement = doc.getElementsByTagName(tag)[0]; 103 | script.src = pathtoroot + path; 104 | scriptElement.parentNode.insertBefore(script, scriptElement); 105 | } 106 | 107 | function show(type) { 108 | count = 0; 109 | for (var key in data) { 110 | var row = document.getElementById(key); 111 | if ((data[key] & type) !== 0) { 112 | row.style.display = ''; 113 | row.className = (count++ % 2) ? rowColor : altColor; 114 | } 115 | else 116 | row.style.display = 'none'; 117 | } 118 | updateTabs(type); 119 | } 120 | 121 | function updateTabs(type) { 122 | for (var value in tabs) { 123 | var sNode = document.getElementById(tabs[value][0]); 124 | var spanNode = sNode.firstChild; 125 | if (value == type) { 126 | sNode.className = activeTableTab; 127 | spanNode.innerHTML = tabs[value][1]; 128 | } 129 | else { 130 | sNode.className = tableTab; 131 | spanNode.innerHTML = "" + tabs[value][1] + ""; 132 | } 133 | } 134 | } 135 | 136 | function updateModuleFrame(pFrame, cFrame) { 137 | top.packageFrame.location = pFrame; 138 | top.classFrame.location = cFrame; 139 | } 140 | -------------------------------------------------------------------------------- /docs/serialized-form.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Serialized Form (cryptocompareapi 1.1 API) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 22 | 34 | 37 |
38 | 94 |
95 |
96 |
97 |

Serialized Form

98 |
99 |
100 | 119 |
120 |
121 |
122 | 165 |
166 | 167 | 168 | -------------------------------------------------------------------------------- /docs/type-search-index.js: -------------------------------------------------------------------------------- 1 | typeSearchIndex = [{"p":"me.joshmcfarlin.cryptocompareapi","l":"Coins.PairSnapshot.Data.AggregatedData"},{"l":"All Classes","url":"allclasses-index.html"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Historic.AverageType"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Historic.CalcType"},{"p":"me.joshmcfarlin.cryptocompareapi.utils","l":"CallTypes"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Social.SocialStats.Data.CodeRepository.CodeEntry"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Social.SocialStats.Data.CodeRepository"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Exchanges.ExchangeList.Coin"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Market.Coin"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Mining.Coin"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Coins.CoinList.CoinEntry"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Coins.CoinList"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Coins"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Coins.CoinSnapshot"},{"p":"me.joshmcfarlin.cryptocompareapi.utils","l":"Connection"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Mining.Contracts.Contract"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Mining.Contracts"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Historic.History.ConversionType"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Social.SocialStats.Data.CryptoCompare"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"CryptoCompareAPI"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Social.SocialStats.Data.CryptoCompare.CryptopianFollowers"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Coins.CoinSnapshot.Data"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Coins.PairSnapshot.Data"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Historic.History.Data"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Social.SocialStats.Data"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Mining.Equipment.Equip"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Mining.Equipment"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Coins.PairSnapshot.Data.Exchange"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Exchanges.Exchange"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Exchanges.ExchangeList.Exchange"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Market.ExchangeAverage"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Exchanges.ExchangeList"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Exchanges"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Social.SocialStats.Data.Facebook"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Coins.CoinSnapshot.Data.General"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Social.SocialStats.Data.General"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Historic"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Historic.History"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Coins.CoinSnapshot.Data.ICO"},{"p":"me.joshmcfarlin.cryptocompareapi.utils","l":"RateLimiting.Rates.Interval"},{"p":"me.joshmcfarlin.cryptocompareapi.utils","l":"IntervalTypes"},{"p":"me.joshmcfarlin.cryptocompareapi.Exceptions","l":"InvalidParameterException"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Market"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Mining"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"News"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"News.NewsProvider"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"News.NewsStory"},{"p":"me.joshmcfarlin.cryptocompareapi.Exceptions","l":"OutOfCallsException"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Social.SocialStats.Data.CryptoCompare.PageViewsSplit"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Market.Pair"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Coins.PairSnapshot"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Social.SocialStats.Data.CodeRepository.CodeEntry.Parent"},{"p":"me.joshmcfarlin.cryptocompareapi.utils","l":"RateLimiting"},{"p":"me.joshmcfarlin.cryptocompareapi.utils","l":"RateLimiting.Rates"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Social.SocialStats.Data.Reddit"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Coins.CoinSnapshot.Data.SEO"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"News.NewsStory.ShortNewsProvider"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Social.SocialStats.Data.CryptoCompare.SimilarItem"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Social"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Social.SocialStats"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Social.SocialStats.Data.CodeRepository.CodeEntry.Source"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Coins.CoinSnapshot.Data.General.Sponsor"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Market.toSym"},{"p":"me.joshmcfarlin.cryptocompareapi","l":"Social.SocialStats.Data.Twitter"},{"p":"me.joshmcfarlin.cryptocompareapi.utils","l":"RateLimiting.Rates.Interval.Usage"}] -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Josh-McFarlin/CryptoCompareAPI/7326a5dc2dbc9e5b2127e52bfe2901336d69cae6/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Oct 11 16:41:17 EDT 2018 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn () { 37 | echo "$*" 38 | } 39 | 40 | die () { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save () { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'cryptocompareapi' 2 | -------------------------------------------------------------------------------- /src/main/java/me/joshmcfarlin/cryptocompareapi/CryptoCompareAPI.java: -------------------------------------------------------------------------------- 1 | package me.joshmcfarlin.cryptocompareapi; 2 | 3 | /** 4 | * The class's default class to access all the methods 5 | */ 6 | public class CryptoCompareAPI { 7 | public Coins coins; 8 | public Exchanges exchanges; 9 | public Historic historic; 10 | public Market market; 11 | public Mining mining; 12 | public News news; 13 | public Social social; 14 | 15 | private String extraParams; 16 | private Boolean sign; 17 | 18 | /** 19 | * Sets extraParams and sign to null 20 | * @see #CryptoCompareAPI(String, Boolean) 21 | */ 22 | public CryptoCompareAPI() { 23 | this(null, null); 24 | } 25 | 26 | /** 27 | * Only instantiates the object with extraParams, sign is set to null 28 | * @see #CryptoCompareAPI(String, Boolean) 29 | */ 30 | public CryptoCompareAPI(String extraParams) { 31 | this(extraParams, null); 32 | } 33 | 34 | /** 35 | * Only instantiates the object with sign, extraParams is set to null 36 | * @see #CryptoCompareAPI(String, Boolean) 37 | */ 38 | public CryptoCompareAPI(Boolean sign) { 39 | this(null, sign); 40 | } 41 | 42 | /** 43 | * Creates an object to access all the API methods 44 | * @param extraParams The name of your application (we recommend you send it) [Max character length: 2000] 45 | * @param sign If set to true, the server will sign the requests (by default we don't sign them), this is useful for usage in smart contracts 46 | */ 47 | public CryptoCompareAPI(String extraParams, Boolean sign) { 48 | this.extraParams = extraParams; 49 | this.sign = sign; 50 | 51 | coins = new Coins(); 52 | exchanges = new Exchanges(); 53 | historic = new Historic(); 54 | market = new Market(); 55 | mining = new Mining(); 56 | news = new News(); 57 | social = new Social(); 58 | } 59 | 60 | /** 61 | * {@link CryptoCompareAPI#extraParams} 62 | */ 63 | public String getExtraParams() { 64 | return extraParams; 65 | } 66 | 67 | public void setExtraParams(String extraParams) { 68 | this.extraParams = extraParams; 69 | } 70 | 71 | /** 72 | * {@link CryptoCompareAPI#sign} 73 | */ 74 | public Boolean getSign() { 75 | return sign; 76 | } 77 | 78 | public void setSign(Boolean sign) { 79 | this.sign = sign; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /src/main/java/me/joshmcfarlin/cryptocompareapi/Exceptions/InvalidParameterException.java: -------------------------------------------------------------------------------- 1 | package me.joshmcfarlin.cryptocompareapi.Exceptions; 2 | 3 | /** 4 | * Represents an error when a provided parameter does not meet the guidelines of the API 5 | * @author Josh McFarlin 6 | */ 7 | public class InvalidParameterException extends Exception { 8 | /** 9 | * Creates an exception to be called when a parameter is incorrect 10 | * @param message The error message to be displayed 11 | */ 12 | public InvalidParameterException(String message) { 13 | super(message); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/me/joshmcfarlin/cryptocompareapi/Exceptions/OutOfCallsException.java: -------------------------------------------------------------------------------- 1 | package me.joshmcfarlin.cryptocompareapi.Exceptions; 2 | 3 | /** 4 | * Represents an error when no more API calls remain 5 | * @author Josh McFarlin 6 | */ 7 | public class OutOfCallsException extends Exception { 8 | /** 9 | * Creates an exception to be called when no more API calls are left in the current interval 10 | * @param message The error message to be displayed 11 | */ 12 | public OutOfCallsException(String message) { 13 | super(message); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/me/joshmcfarlin/cryptocompareapi/Exchanges.java: -------------------------------------------------------------------------------- 1 | package me.joshmcfarlin.cryptocompareapi; 2 | 3 | import com.google.gson.Gson; 4 | import com.google.gson.JsonObject; 5 | import com.google.gson.reflect.TypeToken; 6 | import me.joshmcfarlin.cryptocompareapi.Exceptions.InvalidParameterException; 7 | import me.joshmcfarlin.cryptocompareapi.utils.CallTypes; 8 | import me.joshmcfarlin.cryptocompareapi.utils.Connection; 9 | import me.joshmcfarlin.cryptocompareapi.Exceptions.OutOfCallsException; 10 | 11 | import java.io.*; 12 | import java.lang.reflect.Type; 13 | import java.util.HashMap; 14 | import java.util.List; 15 | import java.util.Map; 16 | 17 | /** 18 | * Contains methods for requesting information about Exchanges listed by CryptoCompare 19 | * @author Josh McFarlin 20 | */ 21 | public class Exchanges { 22 | /** 23 | * Gets all available trading pairs for each cryptocurrency on all exchanges available from the API 24 | * @return ExchangeList a object containing different API data 25 | * @throws IOException when a connection cannot be made 26 | * @throws OutOfCallsException when no more API calls are available 27 | */ 28 | public ExchangeList getAllExchanges() throws IOException, OutOfCallsException { 29 | Reader r = Connection.getJSON("https://min-api.cryptocompare.com/data/all/exchanges", CallTypes.PRICE); 30 | 31 | Type type = new TypeToken>>>() {}.getType(); 32 | Map>> exchangeMap = new Gson().fromJson(r, type); 33 | return new ExchangeList(exchangeMap); 34 | } 35 | 36 | /** 37 | * Finds the top exchanges for a provided pair 38 | * @param fSym The cryptocurrency symbol of interest [Max character length: 10] 39 | * @param tSym The currency symbol to convert into [Max character length: 10] 40 | * @param limit The number of data points to return 41 | * @param extraParams The name of your application (we recommend you send it) [Max character length: 2000] 42 | * @param sign If set to true, the server will sign the requests (by default we don't sign them), this is useful for usage in smart contracts 43 | * @return TopExchanges a object containing different API data 44 | * @throws IOException when a connection cannot be made 45 | * @throws OutOfCallsException when no more API calls are available 46 | * @throws InvalidParameterException when a given parameter does not meet the API guidelines 47 | */ 48 | public List getTopExchanges(String fSym, String tSym, Integer limit, String extraParams, Boolean sign) throws IOException, OutOfCallsException, InvalidParameterException { 49 | if (fSym.length() > 10) { 50 | throw new InvalidParameterException("The max character length of fromSym is 10!"); 51 | } 52 | 53 | if (tSym.length() > 10) { 54 | throw new InvalidParameterException("The max character length of fromSym is 10!"); 55 | } 56 | 57 | String formattedUrl = String.format("https://min-api.cryptocompare.com/data/top/exchanges?fsym=%s&tsym=%s", 58 | fSym.toUpperCase(), tSym.toUpperCase()); 59 | 60 | if (limit != null) { 61 | formattedUrl += "&limit=" + limit; 62 | } 63 | 64 | if (extraParams != null) { 65 | if (extraParams.length() > 2000) throw new InvalidParameterException("The max character length of extraParams is 2000!"); 66 | formattedUrl += "&extraParams=" + extraParams; 67 | } 68 | 69 | if (sign != null) { 70 | formattedUrl += "&sign=" + sign.toString(); 71 | } 72 | 73 | Reader r = Connection.getJSON(formattedUrl, CallTypes.PRICE); 74 | 75 | JsonObject jsonObject = new Gson().fromJson(r, JsonObject.class); 76 | Type type = new TypeToken>() {}.getType(); 77 | return new Gson().fromJson(jsonObject.get("Data"), type); 78 | } 79 | 80 | /** 81 | * @see Exchanges#getTopExchanges(String, String, Integer, String, Boolean) 82 | */ 83 | public List getTopExchanges(String fSym, String tSym) throws IOException, OutOfCallsException, InvalidParameterException { 84 | return getTopExchanges(fSym, tSym, null, null, null); 85 | } 86 | 87 | /** 88 | * @see Exchanges#getTopExchanges(String, String, Integer, String, Boolean) 89 | */ 90 | public List getTopExchanges(String fSym, String tSym, Integer limit) throws IOException, OutOfCallsException, InvalidParameterException { 91 | return getTopExchanges(fSym, tSym, limit, null, null); 92 | } 93 | 94 | /** 95 | * Represents a cryptocurrency exchange 96 | */ 97 | public class Exchange { 98 | /** 99 | * The name of the exchange 100 | */ 101 | private String exchange; 102 | 103 | /** 104 | * The symbol being traded from 105 | */ 106 | private String fromSymbol; 107 | 108 | /** 109 | * The symbol being traded to 110 | */ 111 | private String toSymbol; 112 | 113 | /** 114 | * 24 hour volume of the trading pair 115 | */ 116 | private double volume24h; 117 | 118 | /** 119 | * 24 hour volume of the trading pair to 120 | */ 121 | private double volume24hTo; 122 | 123 | /** 124 | * {@link Exchange#exchange} 125 | */ 126 | public String getExchange() { 127 | return exchange; 128 | } 129 | 130 | /** 131 | * {@link Exchange#fromSymbol} 132 | */ 133 | public String getFromSymbol() { 134 | return fromSymbol; 135 | } 136 | 137 | /** 138 | * {@link Exchange#toSymbol} 139 | */ 140 | public String getToSymbol() { 141 | return toSymbol; 142 | } 143 | 144 | /** 145 | * {@link Exchange#volume24h} 146 | */ 147 | public double getVolume24h() { 148 | return volume24h; 149 | } 150 | 151 | /** 152 | * {@link Exchange#volume24hTo} 153 | */ 154 | public double getVolume24hTo() { 155 | return volume24hTo; 156 | } 157 | } 158 | 159 | /** 160 | * Represents a map of exchanges 161 | */ 162 | public class ExchangeList { 163 | /** 164 | * A map of all exchanges 165 | */ 166 | private Map exchanges = new HashMap<>(); 167 | 168 | /** 169 | * Creates an ExchangeList from a map of exchanges 170 | * @param map A map of exchanges 171 | */ 172 | ExchangeList(Map>> map) { 173 | map.forEach((key, val) -> { 174 | Exchange e = new Exchange(val); 175 | this.exchanges.put(key, e); 176 | }); 177 | } 178 | 179 | /** 180 | * {@link ExchangeList#exchanges} 181 | */ 182 | public Map getExchanges() { 183 | return exchanges; 184 | } 185 | 186 | /** 187 | * Represents a cryptocurrency exchange 188 | */ 189 | public class Exchange { 190 | /** 191 | * A map of coins listed by the exchange 192 | */ 193 | private Map coins = new HashMap<>(); 194 | 195 | /** 196 | * Creates an exchange from a list of coins 197 | * @param coins A List of coins traded on the exchange 198 | */ 199 | Exchange(Map> coins) { 200 | coins.forEach((coin, pair) -> { 201 | if (pair != null && !pair.isEmpty()) { 202 | Coin c = new Coin(pair); 203 | this.coins.put(coin, c); 204 | } 205 | }); 206 | } 207 | 208 | /** 209 | * {@link Exchange#coins} 210 | */ 211 | public Map getCoins() { 212 | return coins; 213 | } 214 | } 215 | 216 | /** 217 | * Represents a cryptocurrency 218 | */ 219 | public class Coin { 220 | /** 221 | * A list of trading pairs 222 | */ 223 | private List tradingPairs; 224 | 225 | /** 226 | * Creates a coin from a list of trading pairs 227 | * @param tradingPairs The trading pairs to set 228 | */ 229 | Coin(List tradingPairs) { 230 | if (tradingPairs != null && !tradingPairs.isEmpty()) { 231 | this.tradingPairs = tradingPairs; 232 | } 233 | } 234 | 235 | /** 236 | * {@link Coin#tradingPairs} 237 | */ 238 | public List getTradingPairs() { 239 | return tradingPairs; 240 | } 241 | } 242 | } 243 | } 244 | -------------------------------------------------------------------------------- /src/main/java/me/joshmcfarlin/cryptocompareapi/News.java: -------------------------------------------------------------------------------- 1 | package me.joshmcfarlin.cryptocompareapi; 2 | 3 | import com.google.gson.Gson; 4 | import com.google.gson.annotations.SerializedName; 5 | import com.google.gson.reflect.TypeToken; 6 | import me.joshmcfarlin.cryptocompareapi.utils.CallTypes; 7 | import me.joshmcfarlin.cryptocompareapi.utils.Connection; 8 | import me.joshmcfarlin.cryptocompareapi.Exceptions.OutOfCallsException; 9 | 10 | import java.io.*; 11 | import java.lang.reflect.Type; 12 | import java.util.List; 13 | 14 | /** 15 | * Contains methods for requesting information about news listed on CryptoCompare 16 | * @author Josh McFarlin 17 | */ 18 | public class News { 19 | /** 20 | * Gets a list of news providers on the CryptoCompare website 21 | * @return List containing different news providers 22 | * @throws IOException when a connection cannot be made 23 | * @throws OutOfCallsException when no more API calls are available 24 | */ 25 | public List newsProviderList() throws IOException, OutOfCallsException { 26 | Reader r = Connection.getJSON("https://min-api.cryptocompare.com/data/news/providers", CallTypes.NEWS); 27 | 28 | Type newsListType = new TypeToken>() {}.getType(); 29 | return new Gson().fromJson(r, newsListType); 30 | } 31 | 32 | /** 33 | * Gets a list of news stories on the CryptoCompare website 34 | * @return List containing different news stories 35 | * @throws IOException when a connection cannot be made 36 | * @throws OutOfCallsException when no more API calls are available 37 | */ 38 | public List newsList() throws IOException, OutOfCallsException { 39 | Reader r = Connection.getJSON("https://min-api.cryptocompare.com/data/news/", CallTypes.NEWS); 40 | 41 | Type newsListType = new TypeToken>() {}.getType(); 42 | return new Gson().fromJson(r, newsListType); 43 | } 44 | 45 | /** 46 | * Represents a news provider on CryptoCompare's website 47 | */ 48 | public class NewsProvider { 49 | /** 50 | * Key name used by CryptoCompare 51 | */ 52 | private String key; 53 | 54 | /** 55 | * Name provided on CryptoCompare's website 56 | */ 57 | private String name; 58 | 59 | /** 60 | * Language used by news provided 61 | */ 62 | private String lang; 63 | 64 | /** 65 | * Url to image representing news provider 66 | */ 67 | private String img; 68 | 69 | @Override 70 | public String toString() { 71 | return String.format("Key: %s, Name: %s, Lang: %s", key, name, lang); 72 | } 73 | 74 | /** 75 | * {@link NewsProvider#key} 76 | */ 77 | public String getKey() { 78 | return key; 79 | } 80 | 81 | /** 82 | * {@link NewsProvider#name} 83 | */ 84 | public String getName() { 85 | return name; 86 | } 87 | 88 | /** 89 | * {@link NewsProvider#lang} 90 | */ 91 | public String getLang() { 92 | return lang; 93 | } 94 | 95 | /** 96 | * {@link NewsProvider#img} 97 | */ 98 | public String getImg() { 99 | return img; 100 | } 101 | } 102 | 103 | /** 104 | * Represents a news story on CryptoCompare's website 105 | */ 106 | public class NewsStory { 107 | /** 108 | * News story ID on CryptoCompare's website 109 | */ 110 | private int id; 111 | 112 | /** 113 | * Url to news story on provider's website 114 | */ 115 | private String guid; 116 | 117 | /** 118 | * Unix time the story was published 119 | */ 120 | @SerializedName("published_on") 121 | private int publishedOn; 122 | 123 | /** 124 | * Image url 125 | */ 126 | @SerializedName("imageurl") 127 | private String imageUrl; 128 | 129 | /** 130 | * Title of the news story 131 | */ 132 | private String title; 133 | 134 | /** 135 | * News story url on CryptoCompare's website 136 | */ 137 | private String url; 138 | 139 | /** 140 | * Source of the news story 141 | */ 142 | private String source; 143 | 144 | /** 145 | * Body of the news story 146 | */ 147 | private String body; 148 | 149 | /** 150 | * Tags provided with the news story 151 | */ 152 | private String tags; 153 | 154 | /** 155 | * The language the news story is written in 156 | */ 157 | private String lang; 158 | 159 | /** 160 | * The provider of the news article 161 | */ 162 | @SerializedName("source_info") 163 | private ShortNewsProvider provider; 164 | 165 | @Override 166 | public String toString() { 167 | return String.format("%s: %s", id, title); 168 | } 169 | 170 | /** 171 | * {@link NewsStory#id} 172 | */ 173 | public int getId() { 174 | return id; 175 | } 176 | 177 | /** 178 | * {@link NewsStory#guid} 179 | */ 180 | public String getGuid() { 181 | return guid; 182 | } 183 | 184 | /** 185 | * {@link NewsStory#publishedOn} 186 | */ 187 | public int getPublishedOn() { 188 | return publishedOn; 189 | } 190 | 191 | /** 192 | * {@link NewsStory#imageUrl} 193 | */ 194 | public String getImageUrl() { 195 | return imageUrl; 196 | } 197 | 198 | /** 199 | * {@link NewsStory#title} 200 | */ 201 | public String getTitle() { 202 | return title; 203 | } 204 | 205 | /** 206 | * {@link NewsStory#url} 207 | */ 208 | public String getUrl() { 209 | return url; 210 | } 211 | 212 | /** 213 | * {@link NewsStory#source} 214 | */ 215 | public String getSource() { 216 | return source; 217 | } 218 | 219 | /** 220 | * {@link NewsStory#body} 221 | */ 222 | public String getBody() { 223 | return body; 224 | } 225 | 226 | /** 227 | * {@link NewsStory#tags} 228 | */ 229 | public String getTags() { 230 | return tags; 231 | } 232 | 233 | /** 234 | * {@link NewsStory#lang} 235 | */ 236 | public String getLang() { 237 | return lang; 238 | } 239 | 240 | /** 241 | * {@link NewsStory#provider} 242 | */ 243 | public ShortNewsProvider getProvider() { 244 | return provider; 245 | } 246 | 247 | /** 248 | * Represents information about a news provider 249 | */ 250 | public class ShortNewsProvider { 251 | /** 252 | * Name provided on CryptoCompare's website 253 | */ 254 | private String name; 255 | 256 | /** 257 | * Language used by news provided 258 | */ 259 | private String lang; 260 | 261 | /** 262 | * Url to image representing news provider 263 | */ 264 | private String img; 265 | 266 | @Override 267 | public String toString() { 268 | return String.format("Name: %s, Lang: %s", name, lang); 269 | } 270 | 271 | /** 272 | * {@link ShortNewsProvider#name} 273 | */ 274 | public String getName() { 275 | return name; 276 | } 277 | 278 | /** 279 | * {@link ShortNewsProvider#lang} 280 | */ 281 | public String getLang() { 282 | return lang; 283 | } 284 | 285 | /** 286 | * {@link ShortNewsProvider#img} 287 | */ 288 | public String getImg() { 289 | return img; 290 | } 291 | } 292 | } 293 | } 294 | -------------------------------------------------------------------------------- /src/main/java/me/joshmcfarlin/cryptocompareapi/utils/CallTypes.java: -------------------------------------------------------------------------------- 1 | package me.joshmcfarlin.cryptocompareapi.utils; 2 | 3 | /** 4 | * Represents all available API call types 5 | * @author Josh McFarlin 6 | */ 7 | public enum CallTypes { 8 | HISTO, PRICE, NEWS, STRICT, OTHER; 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/me/joshmcfarlin/cryptocompareapi/utils/Connection.java: -------------------------------------------------------------------------------- 1 | package me.joshmcfarlin.cryptocompareapi.utils; 2 | 3 | import me.joshmcfarlin.cryptocompareapi.Exceptions.OutOfCallsException; 4 | 5 | import java.io.*; 6 | import java.net.HttpURLConnection; 7 | import java.net.URL; 8 | 9 | /** 10 | * Contains methods for creating JSON GET requests 11 | * @author Josh McFarlin 12 | */ 13 | public class Connection { 14 | /** 15 | * Gets JSON data from a provided URL without checking call availability 16 | * @param urlString The URL to get JSON information from 17 | * @return Reader containing Json information 18 | * @throws IOException when a connection cannot be made 19 | */ 20 | public static Reader getJSON(String urlString) throws IOException { 21 | URL url = new URL(urlString); 22 | 23 | HttpURLConnection response = (HttpURLConnection) url.openConnection(); 24 | response.setDoOutput(true); 25 | response.setRequestMethod("GET"); 26 | response.connect(); 27 | 28 | return new InputStreamReader(new BufferedInputStream(response.getInputStream())); 29 | } 30 | 31 | /** 32 | * Gets JSON data from a provided URL after checking call availability 33 | * @param urlString The URL to get JSON information from 34 | * @param type The type of API call being made 35 | * @return Reader containing Json information 36 | * @throws IOException when a connection cannot be made 37 | * @throws OutOfCallsException when no more API calls are available 38 | */ 39 | public static Reader getJSON(String urlString, CallTypes type) throws IOException, OutOfCallsException { 40 | if (RateLimiting.callable(type)) { 41 | return getJSON(urlString); 42 | } else { 43 | throw new OutOfCallsException(String.format("No more %s calls are left, please try later.", type)); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/me/joshmcfarlin/cryptocompareapi/utils/IntervalTypes.java: -------------------------------------------------------------------------------- 1 | package me.joshmcfarlin.cryptocompareapi.utils; 2 | 3 | /** 4 | * Represents all available API call intervals 5 | * @author Josh McFarlin 6 | */ 7 | public enum IntervalTypes { 8 | SECOND("Second"), 9 | MINUTE("Minute"), 10 | HOUR("Hour"); 11 | 12 | String apiName; 13 | 14 | IntervalTypes(String apiName) { 15 | this.apiName = apiName; 16 | } 17 | } -------------------------------------------------------------------------------- /src/main/java/me/joshmcfarlin/cryptocompareapi/utils/RateLimiting.java: -------------------------------------------------------------------------------- 1 | package me.joshmcfarlin.cryptocompareapi.utils; 2 | 3 | import com.google.gson.Gson; 4 | import com.google.gson.annotations.SerializedName; 5 | 6 | import java.io.*; 7 | 8 | /** 9 | * Contains methods for limiting API calls to provided limits 10 | * @author Josh McFarlin 11 | */ 12 | public class RateLimiting { 13 | /** 14 | * Gets the number of API calls used and available in the current interval 15 | * @return Rates A class containing different API rates 16 | * @throws IOException When the connection fails 17 | */ 18 | public static Rates getRates() throws IOException { 19 | Reader r = Connection.getJSON("https://min-api.cryptocompare.com/stats/rate/limit"); 20 | 21 | return new Gson().fromJson(r, Rates.class); 22 | } 23 | 24 | /** 25 | * Checks if the provided call type has calls left in the provided intervals 26 | * @param type The API call type to be checked 27 | * @param intervals A number of IntervalTypes which will each be checked 28 | * @return boolean True if calls of the provided type are left for all of the provided intervals 29 | * @throws IOException When the connection fails 30 | */ 31 | public static boolean checkInterval(CallTypes type, IntervalTypes... intervals) throws IOException { 32 | for (IntervalTypes interval: intervals) { 33 | Rates rates = getRates(); 34 | Rates.Interval.Usage callsLeft = rates.getInterval(interval).callsLeft; 35 | 36 | if (type == CallTypes.HISTO && callsLeft.histo <= 0) { 37 | return false; 38 | } else if (type == CallTypes.PRICE && callsLeft.price <= 0) { 39 | return false; 40 | } else if (type == CallTypes.NEWS && callsLeft.news <= 0) { 41 | return false; 42 | } else if (type == CallTypes.STRICT && callsLeft.strict <= 0) { 43 | return false; 44 | } 45 | } 46 | return true; 47 | } 48 | 49 | /** 50 | * Checks if an API call is available 51 | * @param type The API call type to be checked 52 | * @return true if a call can be made, false if no more calls are available 53 | * @throws IOException When a connection fails 54 | */ 55 | public static boolean callable(CallTypes type) throws IOException { 56 | return checkInterval(type, IntervalTypes.HOUR, IntervalTypes.MINUTE, IntervalTypes.SECOND); 57 | } 58 | 59 | public class Rates { 60 | /** 61 | * The message returned by the CryptoCompare API 62 | */ 63 | @SerializedName("Message") 64 | private String message; 65 | 66 | /** 67 | * The number of api calls used and left in the current hour 68 | */ 69 | @SerializedName("Hour") 70 | private Interval hour; 71 | 72 | /** 73 | * The number of api calls used and left in the current minute 74 | */ 75 | @SerializedName("Minute") 76 | private Interval minute; 77 | 78 | /** 79 | * The number of api calls used and left in the current second 80 | */ 81 | @SerializedName("Second") 82 | private Interval second; 83 | 84 | /** 85 | * {@link Rates#message} 86 | */ 87 | public String getMessage() { 88 | return message; 89 | } 90 | 91 | /** 92 | * {@link Rates#hour} 93 | */ 94 | public Interval getHour() { 95 | return hour; 96 | } 97 | 98 | /** 99 | * {@link Rates#minute} 100 | */ 101 | public Interval getMinute() { 102 | return minute; 103 | } 104 | 105 | /** 106 | * {@link Rates#second} 107 | */ 108 | public Interval getSecond() { 109 | return second; 110 | } 111 | 112 | /** 113 | * Gets a interval from a provided IntervalTypes object 114 | * @param interval The provided IntervalTypes object 115 | * @return Interval A class containing data about the number of api calls used in the time period 116 | */ 117 | public Interval getInterval(IntervalTypes interval) { 118 | if (interval == IntervalTypes.HOUR) { 119 | return hour; 120 | } else if (interval == IntervalTypes.MINUTE) { 121 | return minute; 122 | } else { 123 | return second; 124 | } 125 | } 126 | 127 | public class Interval { 128 | /** 129 | * Contains data about the number of api calls used in the time period 130 | */ 131 | @SerializedName("CallsMade") 132 | private Usage callsMade; 133 | 134 | /** 135 | * Contains data about the number of api calls remaining in the time period 136 | */ 137 | @SerializedName("CallsLeft") 138 | private Usage callsLeft; 139 | 140 | /** 141 | * {@link Interval#callsMade} 142 | */ 143 | public Usage getCallsMade() { 144 | return callsMade; 145 | } 146 | 147 | /** 148 | * {@link Interval#callsLeft} 149 | */ 150 | public Usage getCallsLeft() { 151 | return callsLeft; 152 | } 153 | 154 | /** 155 | * Represents the number of api calls for a time period 156 | */ 157 | public class Usage { 158 | /** 159 | * The number of Histo calls 160 | */ 161 | @SerializedName("Histo") 162 | private Integer histo; 163 | 164 | /** 165 | * The number of Price calls 166 | */ 167 | @SerializedName("Price") 168 | private Integer price; 169 | 170 | /** 171 | * The number of News calls 172 | */ 173 | @SerializedName("News") 174 | private Integer news; 175 | 176 | /** 177 | * The number of Strict calls 178 | */ 179 | @SerializedName("Strict") 180 | private Integer strict; 181 | 182 | @Override 183 | public String toString() { 184 | return String.format("API calls: Histo: %d, Market: %d, News: %d, Strict: %d", histo, price, news, strict); 185 | } 186 | 187 | /** 188 | * {@link Usage#histo} 189 | */ 190 | public Integer getHisto() { 191 | return histo; 192 | } 193 | 194 | /** 195 | * {@link Usage#price} 196 | */ 197 | public Integer getPrice() { 198 | return price; 199 | } 200 | 201 | /** 202 | * {@link Usage#news} 203 | */ 204 | public Integer getNews() { 205 | return news; 206 | } 207 | 208 | /** 209 | * {@link Usage#strict} 210 | */ 211 | public Integer getStrict() { 212 | return strict; 213 | } 214 | } 215 | } 216 | } 217 | } 218 | -------------------------------------------------------------------------------- /src/test/java/me/joshmcfarlin/cryptocompareapi/APITest.java: -------------------------------------------------------------------------------- 1 | package me.joshmcfarlin.cryptocompareapi; 2 | 3 | import me.joshmcfarlin.cryptocompareapi.Exceptions.InvalidParameterException; 4 | import me.joshmcfarlin.cryptocompareapi.Exceptions.OutOfCallsException; 5 | import me.joshmcfarlin.cryptocompareapi.utils.RateLimiting; 6 | import org.junit.jupiter.api.Test; 7 | 8 | import java.io.IOException; 9 | import java.util.List; 10 | import java.util.Map; 11 | 12 | import static org.junit.jupiter.api.Assertions.*; 13 | 14 | class APITest { 15 | private CryptoCompareAPI api = new CryptoCompareAPI(); 16 | 17 | @Test 18 | void shouldReturnValidAPIUsage() throws IOException { 19 | RateLimiting.Rates rates = RateLimiting.getRates(); 20 | assertNotNull(rates); 21 | } 22 | 23 | @Test 24 | void shouldReturnCoinListWithCoins() throws IOException, OutOfCallsException { 25 | Coins.CoinList coinList = api.coins.getCoinList(); 26 | assertNotNull(coinList); 27 | assertFalse(coinList.getCoins().isEmpty()); 28 | assertEquals("BTC", coinList.getCoins().get("BTC").getName()); 29 | } 30 | 31 | @Test 32 | void shouldReturnExchangeListWithExchanges() throws IOException, OutOfCallsException { 33 | Exchanges.ExchangeList exchangeList = api.exchanges.getAllExchanges(); 34 | assertNotNull(exchangeList); 35 | assertFalse(exchangeList.getExchanges().isEmpty()); 36 | assertNotNull(exchangeList.getExchanges().get("Cryptsy").getCoins().get("BTC")); 37 | } 38 | 39 | @Test 40 | void shouldNotReturnNullEmptyNewsList() throws IOException, OutOfCallsException { 41 | List newsProviders = api.news.newsProviderList(); 42 | assertNotNull(newsProviders); 43 | assertFalse(newsProviders.isEmpty()); 44 | 45 | List newsList = api.news.newsList(); 46 | assertNotNull(newsList); 47 | assertFalse(newsList.isEmpty()); 48 | } 49 | 50 | @Test 51 | void shouldReturnNewsListWithNews() throws IOException, OutOfCallsException { 52 | List newsProviders = api.news.newsProviderList(); 53 | assertFalse(newsProviders.isEmpty()); 54 | assertNotNull(newsProviders.get(0).getKey()); 55 | 56 | List newsList = api.news.newsList(); 57 | assertFalse(newsList.isEmpty()); 58 | assertNotNull(newsList.get(0).getTitle()); 59 | } 60 | 61 | @Test 62 | void shouldNotReturnNullSocialStats() throws IOException, OutOfCallsException { 63 | Social.SocialStats socialStats = api.social.getStats(1182); 64 | assertNotNull(socialStats); 65 | assertNotNull(socialStats.getData()); 66 | } 67 | 68 | @Test 69 | void shouldNotReturnNullEmptyHistoricData() throws IOException, OutOfCallsException, InvalidParameterException { 70 | Historic.History history = api.historic.getDay("BTC", "USD", 30); 71 | assertNotNull(history); 72 | assertFalse(history.getData().isEmpty()); 73 | } 74 | 75 | @Test 76 | void shouldNotReturnNullEmptyHistoricPriceMap() throws IOException, OutOfCallsException, InvalidParameterException { 77 | Map bitcoinPriceAt = api.historic.getPriceAtTime("BTC", "USD,EUR,ETH", 1515190000); 78 | assertNotNull(bitcoinPriceAt); 79 | assertFalse(bitcoinPriceAt.isEmpty()); 80 | } 81 | 82 | @Test 83 | void shouldNotReturnNullAverage() throws IOException, OutOfCallsException, InvalidParameterException { 84 | double dayAverage = api.historic.getDayAverage("BTC", "USD"); 85 | assertTrue(dayAverage > 0); 86 | } 87 | 88 | @Test 89 | void shouldNotReturnNullEmptyExchangeAverage() throws IOException, OutOfCallsException, InvalidParameterException { 90 | Market.ExchangeAverage exchangeAverage = api.market.getExchangeAverage("BTC", "USD", "Coinbase,Kraken,Bitstamp"); 91 | assertNotNull(exchangeAverage); 92 | } 93 | 94 | @Test 95 | void shouldNotReturnNullEmptyMarketAverage() throws IOException, OutOfCallsException, InvalidParameterException { 96 | Map btcPrice = api.market.getPrice("BTC", "USD,EUR"); 97 | assertNotNull(btcPrice); 98 | assertFalse(btcPrice.isEmpty()); 99 | } 100 | 101 | @Test 102 | void shouldNotReturnNullEmptyMultiPrice() throws IOException, OutOfCallsException, InvalidParameterException { 103 | Map> btcETHPrice = api.market.getMultiPrice("BTC,ETH", "USD,EUR"); 104 | assertNotNull(btcETHPrice); 105 | assertFalse(btcETHPrice.isEmpty()); 106 | } 107 | 108 | @Test 109 | void shouldNotReturnNullEmptyMultiFull() throws IOException, OutOfCallsException, InvalidParameterException { 110 | Map> multiFull = api.market.getMultiFull("BTC,ETH", "USD,EUR"); 111 | assertNotNull(multiFull); 112 | assertFalse(multiFull.isEmpty()); 113 | } 114 | 115 | @Test 116 | void shouldNotReturnNullEmptyTopVolumes() throws IOException, OutOfCallsException, InvalidParameterException { 117 | List usdTopVol = api.market.getTopVolumes("USD"); 118 | assertNotNull(usdTopVol); 119 | assertFalse(usdTopVol.isEmpty()); 120 | } 121 | 122 | @Test 123 | void shouldNotReturnNullEmptyTopPairs() throws IOException, OutOfCallsException, InvalidParameterException { 124 | List topPairs = api.market.getTopPairs("BTC"); 125 | assertNotNull(topPairs); 126 | assertFalse(topPairs.isEmpty()); 127 | } 128 | 129 | @Test 130 | void shouldNotReturnNullEmptyMiningContracts() throws IOException, OutOfCallsException { 131 | Mining.Contracts contracts = api.mining.getContracts(); 132 | assertNotNull(contracts); 133 | assertFalse(contracts.getContracts().isEmpty()); 134 | } 135 | 136 | @Test 137 | void shouldNotReturnNullEmptyMiningHardware() throws IOException, OutOfCallsException { 138 | Mining.Equipment equipment = api.mining.getEquipment(); 139 | assertNotNull(equipment); 140 | assertFalse(equipment.getEquipment().isEmpty()); 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /src/test/java/me/joshmcfarlin/cryptocompareapi/Example.java: -------------------------------------------------------------------------------- 1 | package me.joshmcfarlin.cryptocompareapi; 2 | 3 | import me.joshmcfarlin.cryptocompareapi.Exceptions.InvalidParameterException; 4 | import me.joshmcfarlin.cryptocompareapi.utils.CallTypes; 5 | import me.joshmcfarlin.cryptocompareapi.Exceptions.OutOfCallsException; 6 | import me.joshmcfarlin.cryptocompareapi.utils.RateLimiting; 7 | import java.io.IOException; 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | public class Example { 12 | private static CryptoCompareAPI api = new CryptoCompareAPI(); 13 | 14 | private static void rateLimitingTest() throws IOException { 15 | System.out.println("\nRate Limiting APITest:"); 16 | RateLimiting.Rates r = RateLimiting.getRates(); 17 | System.out.println(r.getHour().getCallsMade()); 18 | 19 | System.out.println("Are any price calls left?"); 20 | System.out.println(RateLimiting.callable(CallTypes.PRICE)); 21 | } 22 | 23 | private static void coinsTest() throws IOException, OutOfCallsException { 24 | System.out.println("\nCoins APITest:"); 25 | //Coins.CoinList coinList = Coins.getCoinList(); 26 | 27 | System.out.println("Bitcoin ID:"); 28 | //System.out.println(coinList.getCoins().get("BTC").getId()); 29 | 30 | Coins.PairSnapshot ethBTCSnapshot = api.coins.getPairSnapshot("ETH", "BTC"); 31 | System.out.println("Ethereum Block Number:"); 32 | System.out.println(ethBTCSnapshot.getData().getBlockNumber()); 33 | 34 | Coins.CoinSnapshot btcSnapshot = api.coins.getCoinSnapshot(1182); 35 | System.out.println("Bitcoin Start Date:"); 36 | System.out.println(btcSnapshot.getData().getGeneral().getStartDate()); 37 | } 38 | 39 | private static void exchangesTest() throws IOException, OutOfCallsException, InvalidParameterException { 40 | System.out.println("\nExchanges APITest:"); 41 | Exchanges.ExchangeList exchangeList = api.exchanges.getAllExchanges(); 42 | 43 | System.out.println("Cryptsy Bitcoin info:"); 44 | System.out.println(exchangeList.getExchanges().get("Cryptsy").getCoins().get("BTC").getTradingPairs()); 45 | 46 | System.out.println("Top BTC-USD Exchange:"); 47 | List topExchanges = api.exchanges.getTopExchanges("BTC", "USD"); 48 | System.out.println(topExchanges.get(0).getExchange()); 49 | } 50 | 51 | private static void newsTest() throws IOException, OutOfCallsException { 52 | System.out.println("\nNews APITest:"); 53 | List newsProviders = api.news.newsProviderList(); 54 | System.out.println("First news provider:"); 55 | System.out.println(newsProviders.get(0)); 56 | 57 | System.out.println("News List:"); 58 | List newsList = api.news.newsList(); 59 | 60 | System.out.println("First news story:"); 61 | System.out.println(newsList.get(0)); 62 | } 63 | 64 | private static void socialTest() throws IOException, OutOfCallsException { 65 | System.out.println("\nSocial APITest:"); 66 | Social.SocialStats socialStats = api.social.getStats(1182); 67 | System.out.println("Facebook likes:"); 68 | System.out.println(socialStats.getData().getFacebook().getLikes()); 69 | } 70 | 71 | private static void historicTest() throws IOException, OutOfCallsException, InvalidParameterException { 72 | System.out.println("\nHistoric APITest:"); 73 | Historic.History history = api.historic.getDay("BTC", "USD", 30); 74 | System.out.println("First high price for BTC-USD:"); 75 | System.out.println(history.getData().get(0).getHigh()); 76 | 77 | System.out.println("Bitcoin price at 1515190000 in USD, EUR, and ETH:"); 78 | Map bitcoinPriceAt = api.historic.getPriceAtTime("BTC", "USD,EUR,ETH", 1515190000); 79 | System.out.println(bitcoinPriceAt); 80 | } 81 | 82 | private static void marketTest() throws IOException, OutOfCallsException, InvalidParameterException { 83 | System.out.println("\nMarket APITest:"); 84 | double dayAverage = api.historic.getDayAverage("BTC", "USD"); 85 | System.out.println("Bitcoin day average:"); 86 | System.out.println(dayAverage); 87 | 88 | Market.ExchangeAverage exchangeAverage = api.market.getExchangeAverage("BTC", "USD", "Coinbase,Kraken,Bitstamp"); 89 | System.out.println("Bitcoin average from Coinbase, Kraken, and Bitstamp:"); 90 | System.out.println(exchangeAverage.getHigh24Hour()); 91 | 92 | Map btcPrice = api.market.getPrice("BTC", "USD,EUR"); 93 | System.out.println("Bitcoin price in USD and EUR:"); 94 | System.out.println(btcPrice); 95 | 96 | Map> btcETHPrice = api.market.getMultiPrice("BTC,ETH", "USD,EUR"); 97 | System.out.println("Bitcoin and Ethereum price in USD and EUR:"); 98 | System.out.println(btcETHPrice); 99 | 100 | Map> multiFull = api.market.getMultiFull("BTC,ETH", "USD,EUR"); 101 | System.out.println("Bitcoin to USD 24 Hour Volume:"); 102 | System.out.println(multiFull.get("BTC").get("USD").getVolume24Hour()); 103 | System.out.println("Ethereum to EUR 24 Hour High:"); 104 | System.out.println(multiFull.get("ETH").get("EUR").getHigh24Hour()); 105 | 106 | List usdTopVol = api.market.getTopVolumes("USD"); 107 | System.out.println("Top coins by volume trading to USD:"); 108 | System.out.println(usdTopVol); 109 | 110 | List topPairs = api.market.getTopPairs("BTC"); 111 | System.out.println("Top pairs by volume for Bitcoin:"); 112 | System.out.println(topPairs); 113 | } 114 | 115 | private static void miningTest() throws IOException, OutOfCallsException { 116 | System.out.println("\nMining APITest:"); 117 | Mining.Contracts contracts = api.mining.getContracts(); 118 | System.out.println("Current mining contracts:"); 119 | System.out.println(contracts.getContracts()); 120 | 121 | System.out.println("Current coins mined:"); 122 | System.out.println(contracts.getCoins()); 123 | 124 | Mining.Equipment equipment = api.mining.getEquipment(); 125 | System.out.println("Current mining equipment:"); 126 | System.out.println(equipment.getEquipment()); 127 | } 128 | 129 | public static void main(String[] args) { 130 | try { 131 | rateLimitingTest(); 132 | coinsTest(); 133 | exchangesTest(); 134 | newsTest(); 135 | socialTest(); 136 | historicTest(); 137 | marketTest(); 138 | miningTest(); 139 | } catch (Exception e) { 140 | System.out.println("Something went wrong!"); 141 | e.printStackTrace(); 142 | } 143 | } 144 | } 145 | --------------------------------------------------------------------------------