Last active
April 4, 2020 00:12
-
-
Save YasunoriMATSUOKA/2062d528fa1cfaa3a80403544789f839 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const axios = require("axios") | |
const baseUrl = "https://api.zaif.jp/api/1/" | |
const fetchTicker = async (method, cc, lc) => { | |
const url = `${baseUrl}${method}/${cc}_${lc}` | |
console.log(url) | |
const ticker = await axios.get(url) | |
.then(res => res.data) | |
.catch(error => { | |
console.error(error) | |
return undefined | |
}) | |
return ticker | |
} | |
(async () => { | |
const ticker = await fetchTicker("ticker", "xem", "jpy") | |
console.log(ticker) | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment