coinmarketcap_free 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +16 -16
- data/Gemfile.lock +30 -30
- data/LICENSE.txt +21 -21
- data/README.md +216 -227
- data/Rakefile +12 -12
- data/lib/coinmarketcap_free/coin_history.rb +109 -0
- data/lib/coinmarketcap_free/coins.rb +176 -0
- data/lib/coinmarketcap_free/helper.rb +22 -6
- data/lib/coinmarketcap_free/icons.rb +28 -0
- data/lib/coinmarketcap_free/version.rb +5 -5
- data/lib/coinmarketcap_free.rb +10 -303
- metadata +5 -9
- data/.idea/.gitignore +0 -8
- data/.idea/coinmarketcap_free.iml +0 -27
- data/.idea/modules.xml +0 -8
- data/.idea/vcs.xml +0 -6
- data/lib/coinmarketcap_free/base.rb +0 -42
- data/lib/coinmarketcap_free/coin.rb +0 -64
- data/lib/coinmarketcap_free/cryptocurrencies.rb +0 -192
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 669d745040747a98dbe9ffc2842a39b4b7bb7da5c31229c445a3e5d8d7c2a18a
|
4
|
+
data.tar.gz: 954e9acd92f61f5aa4974660bd76d360e8e329d1c1c59a1e6589eda8f2fdb3ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d9c32b8e9e77b00cd8a4b50bbd74716115b9c5661c9483fba51d40855394b1e63091827b5e66e7660881bc019c81534ea7ee0602d05091bdf721c7d9a7b6206
|
7
|
+
data.tar.gz: 2b9bce59829077e729b8e4da1c915ae08cd82f6c7fe5a4853767e664a39232da34917d3f0a9b9c879df4e218fed5a54b5d0f435113d41142cec58512abc8da95
|
data/Gemfile
CHANGED
@@ -1,16 +1,16 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
source "https://rubygems.org"
|
4
|
-
|
5
|
-
# Specify your gem's dependencies in coinmarketcap_free.gemspec
|
6
|
-
gemspec
|
7
|
-
|
8
|
-
gem 'uri', "~> 0.12.0"
|
9
|
-
gem "net-http", "~> 0.3.0"
|
10
|
-
gem "openssl", "~> 3.0"
|
11
|
-
gem "json", "~> 2.6"
|
12
|
-
|
13
|
-
group :test do
|
14
|
-
gem "rake", "~> 13.0"
|
15
|
-
gem "minitest", "~> 5.0"
|
16
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
# Specify your gem's dependencies in coinmarketcap_free.gemspec
|
6
|
+
gemspec
|
7
|
+
|
8
|
+
gem 'uri', "~> 0.12.0"
|
9
|
+
gem "net-http", "~> 0.3.0"
|
10
|
+
gem "openssl", "~> 3.0"
|
11
|
+
gem "json", "~> 2.6"
|
12
|
+
|
13
|
+
group :test do
|
14
|
+
gem "rake", "~> 13.0"
|
15
|
+
gem "minitest", "~> 5.0"
|
16
|
+
end
|
data/Gemfile.lock
CHANGED
@@ -1,30 +1,30 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
coinmarketcap_free (0.1.
|
5
|
-
|
6
|
-
GEM
|
7
|
-
remote: https://rubygems.org/
|
8
|
-
specs:
|
9
|
-
json (2.6.2)
|
10
|
-
minitest (5.16.3)
|
11
|
-
net-http (0.3.0)
|
12
|
-
uri
|
13
|
-
openssl (3.0.1)
|
14
|
-
rake (13.0.6)
|
15
|
-
uri (0.12.0)
|
16
|
-
|
17
|
-
PLATFORMS
|
18
|
-
x86_64-linux
|
19
|
-
|
20
|
-
DEPENDENCIES
|
21
|
-
coinmarketcap_free!
|
22
|
-
json (~> 2.6)
|
23
|
-
minitest (~> 5.0)
|
24
|
-
net-http (~> 0.3.0)
|
25
|
-
openssl (~> 3.0)
|
26
|
-
rake (~> 13.0)
|
27
|
-
uri (~> 0.12.0)
|
28
|
-
|
29
|
-
BUNDLED WITH
|
30
|
-
2.3.26
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
coinmarketcap_free (0.1.5)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
json (2.6.2)
|
10
|
+
minitest (5.16.3)
|
11
|
+
net-http (0.3.0)
|
12
|
+
uri
|
13
|
+
openssl (3.0.1)
|
14
|
+
rake (13.0.6)
|
15
|
+
uri (0.12.0)
|
16
|
+
|
17
|
+
PLATFORMS
|
18
|
+
x86_64-linux
|
19
|
+
|
20
|
+
DEPENDENCIES
|
21
|
+
coinmarketcap_free!
|
22
|
+
json (~> 2.6)
|
23
|
+
minitest (~> 5.0)
|
24
|
+
net-http (~> 0.3.0)
|
25
|
+
openssl (~> 3.0)
|
26
|
+
rake (~> 13.0)
|
27
|
+
uri (~> 0.12.0)
|
28
|
+
|
29
|
+
BUNDLED WITH
|
30
|
+
2.3.26
|
data/LICENSE.txt
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2022 cosmic-1
|
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
|
13
|
-
all 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
|
21
|
-
THE SOFTWARE.
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2022 cosmic-1
|
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
|
13
|
+
all 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
|
21
|
+
THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,227 +1,216 @@
|
|
1
|
-
# CoinmarketcapFree
|
2
|
-
|
3
|
-
Cryptocurrency information from the Coinmarketcap site without a key.
|
4
|
-
|
5
|
-
## Installation
|
6
|
-
|
7
|
-
Install the gem and add to the application's Gemfile by executing:
|
8
|
-
|
9
|
-
$ bundle add coinmarketcap_free
|
10
|
-
|
11
|
-
If bundler is not being used to manage dependencies, install the gem by executing:
|
12
|
-
|
13
|
-
$ gem install coinmarketcap_free
|
14
|
-
|
15
|
-
##
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
```
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
"
|
42
|
-
"
|
43
|
-
"
|
44
|
-
"
|
45
|
-
"
|
46
|
-
"
|
47
|
-
"
|
48
|
-
"
|
49
|
-
"
|
50
|
-
"
|
51
|
-
"
|
52
|
-
"
|
53
|
-
"
|
54
|
-
"
|
55
|
-
"
|
56
|
-
"
|
57
|
-
"
|
58
|
-
"
|
59
|
-
"
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
"
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
"
|
82
|
-
"
|
83
|
-
"
|
84
|
-
"
|
85
|
-
"
|
86
|
-
"
|
87
|
-
"
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
```
|
135
|
-
|
136
|
-
```
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
|
142
|
-
|
143
|
-
| ```
|
144
|
-
| ```
|
145
|
-
| ```
|
146
|
-
| ```
|
147
|
-
| ```
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
218
|
-
|
219
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
220
|
-
|
221
|
-
## Contributing
|
222
|
-
|
223
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/cosmic-1/coinmarketcap_free.
|
224
|
-
|
225
|
-
## License
|
226
|
-
|
227
|
-
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
1
|
+
# CoinmarketcapFree
|
2
|
+
|
3
|
+
Cryptocurrency information from the Coinmarketcap site without a key.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Install the gem and add to the application's Gemfile by executing:
|
8
|
+
|
9
|
+
$ bundle add coinmarketcap_free
|
10
|
+
|
11
|
+
If bundler is not being used to manage dependencies, install the gem by executing:
|
12
|
+
|
13
|
+
$ gem install coinmarketcap_free
|
14
|
+
|
15
|
+
## How to use?
|
16
|
+
|
17
|
+
``` Ruby
|
18
|
+
list = CoinmarketcapFree::Coins.get_list()
|
19
|
+
```
|
20
|
+
|
21
|
+
Result:
|
22
|
+
``` JSON
|
23
|
+
{
|
24
|
+
"data": {
|
25
|
+
"cryptoCurrencyList": [
|
26
|
+
{
|
27
|
+
"id": 1,
|
28
|
+
"name": "Bitcoin",
|
29
|
+
"symbol": "BTC",
|
30
|
+
"slug": "bitcoin",
|
31
|
+
"tags": [
|
32
|
+
"mineable",
|
33
|
+
"pow",
|
34
|
+
"sha-256",
|
35
|
+
"store-of-value",
|
36
|
+
"state-channel",
|
37
|
+
"coinbase-ventures-portfolio",
|
38
|
+
"three-arrows-capital-portfolio",
|
39
|
+
"polychain-capital-portfolio",
|
40
|
+
"binance-labs-portfolio",
|
41
|
+
"blockchain-capital-portfolio",
|
42
|
+
"boostvc-portfolio",
|
43
|
+
"cms-holdings-portfolio",
|
44
|
+
"dcg-portfolio",
|
45
|
+
"dragonfly-capital-portfolio",
|
46
|
+
"electric-capital-portfolio",
|
47
|
+
"fabric-ventures-portfolio",
|
48
|
+
"framework-ventures-portfolio",
|
49
|
+
"galaxy-digital-portfolio",
|
50
|
+
"huobi-capital-portfolio",
|
51
|
+
"alameda-research-portfolio",
|
52
|
+
"a16z-portfolio",
|
53
|
+
"1confirmation-portfolio",
|
54
|
+
"winklevoss-capital-portfolio",
|
55
|
+
"usv-portfolio",
|
56
|
+
"placeholder-ventures-portfolio",
|
57
|
+
"pantera-capital-portfolio",
|
58
|
+
"multicoin-capital-portfolio",
|
59
|
+
"paradigm-portfolio"
|
60
|
+
],
|
61
|
+
"cmcRank": 1,
|
62
|
+
"marketPairCount": 9922,
|
63
|
+
"circulatingSupply": 19256812.0,
|
64
|
+
"selfReportedCirculatingSupply": 0,
|
65
|
+
"totalSupply": 19256812.0,
|
66
|
+
"maxSupply": 21000000.0,
|
67
|
+
"isActive": 1,
|
68
|
+
"lastUpdated": "2023-01-09T08:25:00.000Z",
|
69
|
+
"dateAdded": "2013-04-28T00:00:00.000Z",
|
70
|
+
"quotes": [
|
71
|
+
{
|
72
|
+
"name": "USD",
|
73
|
+
"price": 17209.447088639048,
|
74
|
+
"volume24h": 13652714044.770432,
|
75
|
+
"marketCap": 331399087209.8695,
|
76
|
+
"percentChange1h": -0.00692023,
|
77
|
+
"percentChange24h": 1.50954046,
|
78
|
+
"percentChange7d": 2.78181713,
|
79
|
+
"lastUpdated": "2023-01-09T08:25:00.000Z",
|
80
|
+
"percentChange30d": 0.30441134,
|
81
|
+
"percentChange60d": 3.89490715,
|
82
|
+
"percentChange90d": -9.99714982,
|
83
|
+
"fullyDilluttedMarketCap": 361398388861.42,
|
84
|
+
"marketCapByTotalSupply": 331399087209.8695,
|
85
|
+
"dominance": 39.0828,
|
86
|
+
"turnover": 0.0411972,
|
87
|
+
"ytdPriceChangePercentage": 3.515
|
88
|
+
}
|
89
|
+
],
|
90
|
+
"isAudited": false
|
91
|
+
}
|
92
|
+
...
|
93
|
+
],
|
94
|
+
"totalCount": "8857"
|
95
|
+
},
|
96
|
+
"status": {
|
97
|
+
"timestamp": "2023-01-08T15:33:30.271Z",
|
98
|
+
"error_code": "0",
|
99
|
+
"error_message": "SUCCESS",
|
100
|
+
"elapsed": "2",
|
101
|
+
"credit_count": 0
|
102
|
+
}
|
103
|
+
}
|
104
|
+
```
|
105
|
+
|
106
|
+
If you want to sort in ascending, just write parameter:
|
107
|
+
|
108
|
+
``` Ruby
|
109
|
+
list = CoinmarketcapFree::Coins.get_list(limit: 100, start: 1, sort_type:'asc')
|
110
|
+
```
|
111
|
+
|
112
|
+
You can also adding sort by:
|
113
|
+
|
114
|
+
``` Ruby
|
115
|
+
list = CoinmarketcapFree::Coins.get_list(limit: 100, start: 1, sort_type:'asc', sort_by: 'name')
|
116
|
+
```
|
117
|
+
|
118
|
+
Convert all cryptocurrencies to USD,BTC,ETH:
|
119
|
+
|
120
|
+
``` Ruby
|
121
|
+
list = CoinmarketcapFree::Coins.get_list(limit: 100,
|
122
|
+
start: 1,
|
123
|
+
sort_type:'asc',
|
124
|
+
sort_by: 'name',
|
125
|
+
convert: 'USD,BTC,ETH')
|
126
|
+
```
|
127
|
+
|
128
|
+
|
129
|
+
Parameters for CoinmarketcapFree::Coins.get_list:
|
130
|
+
|
131
|
+
| Name | Type | Description | Examples |
|
132
|
+
|:------------------------------|:---------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------|
|
133
|
+
| ```limit:``` | Integer. | Optionally specify the number of results to return. Use this parameter and the "start" parameter to determine your own pagination size. ||
|
134
|
+
| ```start:``` | Integer. | Optionally offset the start (1-based index) of the paginated list of items to return. ||
|
135
|
+
| ```sort_by:``` | String. | Default: ```market_cap```. (```rank```, ```name```, ```symbol```, ```date_added```, ```market_cap```, ```market_cap_strict```, ```price```, ```circulating_supply```, ```total_supply```, ```max_supply```, ```num_market_pairs```, ```volume_24h```, ```percent_change_1h```, ```percent_change_24h```, ```percent_change_7d```, ```market_cap_by_total_supply_strict```, ```volume_7d```, ```volume_30d```). What field to sort the list of cryptocurrencies by. ||
|
136
|
+
| ```sort_type:``` | String. | Default: ```desc```. (```asc``` or ```desc```). The direction in which to order cryptocurrencies against the specified sort. ||
|
137
|
+
| ```convert:``` | String. | Default: ```USD,BTC,ETH``` . Select cryptocurrencies to exchange (```AUD```, ```BRL```, ```CAD```, ```CHF```, ```CLP```, ```CNY```, ```CZK```, ```DKK```, ```EUR```, ```GBP```, ```HKD```, ```HUF```, ```IDR```, ```ILS```, ```INR```, ```JPY```, ```KRW```, ```MXN```, ```MYR```, ```NOK```, ```NZD```, ```PHP```, ```PKR```, ```PLN```, ```RUB```, ```SEK```, ```SGD```, ```THB```, ```TRY```, ```TWD```, ```ZAR```). | ```USD``` or ```USD,BTC,ETH``` |
|
138
|
+
| ```crypto_type:``` | String. | Default: ```all```. (```all```, ```coins```, ```tokens```). The type of cryptocurrency to include. ||
|
139
|
+
| ```tag_type:``` | String. | Default: ```all```. (```all```, ```defi```, ```filesharing```). The tag of cryptocurrency to include. ||
|
140
|
+
| ```audited:``` | Boolean. | Show audited (true) or not (false) ||
|
141
|
+
| ```aux:``` | String. | Optionally specify a comma-separated list of supplemental data fields to return. Pass ```ath, atl, high24h, low24h, num_market_pairs, cmc_rank, date_added, max_supply, circulating_supply, total_supply, volume_7d, volume_30d, self_reported_circulating_supply, self_reported_market_cap``` to include all auxiliary fields. | ```ath``` or ```ath, atl, high24h, low24h``` |
|
142
|
+
| ```tags:``` | string. | If you want to see cryptocurrencies that can be mined, just type ```mineable```. ||
|
143
|
+
| ```volume24h_range:``` | String. | Optionally specify a threshold 24 hour USD volume to filter results by. | ```0~100000000000000000``` |
|
144
|
+
| ```percent_change24h_range:``` | String. | Optionally specify a threshold 24 hour percent change to filter results by. | ```0~100``` or ```-10~100``` |
|
145
|
+
| ```circulating_supply_range:``` | String. | Optionally specify a threshold circulating supply to filter results by. | ```0~100000000000000000``` |
|
146
|
+
| ```price_range:``` | String. | Optionally specify a threshold USD price to filter results by. | ```0~100000000000000000``` |
|
147
|
+
| ```market_cap_range:``` | String. | Optionally specify a threshold market cap to filter results by. | ```0~100000000000000000``` |
|
148
|
+
|
149
|
+
### Returns an interval of historic market quotes:
|
150
|
+
|
151
|
+
``` Ruby
|
152
|
+
coin = CoinmarketcapFree::CoinHistory.custom_time(1, '1D')
|
153
|
+
coin = CoinmarketcapFree::CoinHistory.custom_time(1, '1668981600~1671659999')
|
154
|
+
```
|
155
|
+
|
156
|
+
or
|
157
|
+
|
158
|
+
``` Ruby
|
159
|
+
coin = CoinmarketcapFree::CoinHistory.interval_day(1)
|
160
|
+
coin = CoinmarketcapFree::CoinHistory.interval_seven_days(1)
|
161
|
+
coin = CoinmarketcapFree::CoinHistory.interval_all_time(1)
|
162
|
+
```
|
163
|
+
|
164
|
+
Result:
|
165
|
+
``` JSON
|
166
|
+
{
|
167
|
+
"data": {
|
168
|
+
"points": {
|
169
|
+
"1673192010": {
|
170
|
+
"v": [
|
171
|
+
16953.771282696678,
|
172
|
+
7609543976.45,
|
173
|
+
326457581376.786557398500,
|
174
|
+
1,
|
175
|
+
19255750.00000000000000000000
|
176
|
+
],
|
177
|
+
"c": [
|
178
|
+
16953.771282696678,
|
179
|
+
7609543976.45,
|
180
|
+
326457581376.786557398500
|
181
|
+
]
|
182
|
+
},
|
183
|
+
...
|
184
|
+
}
|
185
|
+
},
|
186
|
+
"status": {
|
187
|
+
"timestamp": "2023-01-08T15:33:30.271Z",
|
188
|
+
"error_code": "0",
|
189
|
+
"error_message": "SUCCESS",
|
190
|
+
"elapsed": "2",
|
191
|
+
"credit_count": 0
|
192
|
+
}
|
193
|
+
}
|
194
|
+
|
195
|
+
```
|
196
|
+
|
197
|
+
Parameters for CoinmarketcapFree::CoinHistory.custom_time:
|
198
|
+
|
199
|
+
| Name | Type | Description | Examples |
|
200
|
+
|:-----------------|:---------|:----------------------------------------------|:-------------------------------------------------------------------------------------------------------------------|
|
201
|
+
| ```id``` | Integer. | Cryptocurrency identifier from coinmarketcap. | Bitcoin has the number 1 |
|
202
|
+
| ```range_time``` | String. | Range time. | ```1D```, ```7D```, ```1M```, ```3M```, ```1Y```, ```YTD```, ```ALL``` or custom range ```1668981600~1671659999``` |
|
203
|
+
|
204
|
+
## Development
|
205
|
+
|
206
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
207
|
+
|
208
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
209
|
+
|
210
|
+
## Contributing
|
211
|
+
|
212
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/cosmic-1/coinmarketcap_free.
|
213
|
+
|
214
|
+
## License
|
215
|
+
|
216
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|