Toggle navigation
Toggle navigation
This project
Loading...
Sign in
정홍주
/
Coin-trade-assistant
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
전현진
2021-06-07 22:50:59 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
267c277fc4b801317e3701c92949639aeff740a4
267c277f
1 parent
19ddf797
Delete test6.js
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
31 deletions
test6.js
test6.js
deleted
100644 → 0
View file @
19ddf79
const
fetch
=
require
(
'node-fetch'
);
const
url
=
'https://api.binance.com/api/v3/ticker/price?symbol=BTCUSDT'
;
const
options
=
{
method
:
'GET'
,
headers
:
{
Accept
:
'application/json'
}};
const
rp
=
require
(
'request-promise'
);
const
requestOptions
=
{
method
:
'GET'
,
uri
:
'https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest'
,
qs
:
{
'start'
:
'1'
,
'limit'
:
'10'
,
'convert'
:
'KRW'
},
headers
:
{
'X-CMC_PRO_API_KEY'
:
'c2f8e0b0-a253-4de3-a63f-9f564c8cdd1f'
},
json
:
true
,
gzip
:
true
};
fetch
(
url
,
options
)
.
then
(
res
=>
res
.
json
())
.
then
(
json
=>
rp
(
requestOptions
).
then
(
response
=>
{
var
i
=
0
;
while
(
response
.
data
[
i
].
id
!==
825
){
i
=
i
+
1
;
}
console
.
log
(
'API call response:'
,
json
.
price
*
response
.
data
[
i
].
quote
.
KRW
.
price
);
})
)
.
catch
(
err
=>
console
.
error
(
'error:'
+
err
));
Please
register
or
login
to post a comment