A tool to periodically scrape your crypto currency rates.
You have to configure some environment variables before deploying this project.
In a .env
file put these variables:
COINLAYER_ENDPOINT= coinlayer api link
COINLAYER_ACCESS_KEY= your secret access key
SCRAP_DELAY= delay in minute
You can deploy this project on AWS with the serverless framework
serverless deploy --stage anyStageName
If you are using AWS vault:
aws-vault exec account -- serverless deploy --stage anyStageName
There are 4 different routes in the API:
Takes token names in body
Example of body:
{
"tokens": ["BTC", "LTC", "ETH"]
}
On success
{
"message": "Tokens successfully added"
}
Get all tokens and their last values
Example of response
{
"tokens": [
{
"evolutionRate": -0.05086613401331756,
"tokenId": "LTC",
"exchangeRate": 55.3014,
"timestamp": "1664923686"
},
{
"evolutionRate": 0.049762546777313656,
"tokenId": "ETH",
"exchangeRate": 1357.34,
"timestamp": "1664923686"
},
{
"evolutionRate": 0.026646140005250903,
"tokenId": "BTC",
"exchangeRate": 20209.067784,
"timestamp": "1664923686"
}
]
}
Get a specific token and get all its value history
limit
can be set as an optional query parameter to limit history size
Example of response
{
"tokenHistory": [
{
"evolutionRate": 0.026646140005250903,
"tokenId": "BTC",
"exchangeRate": 20209.067784,
"timestamp": "1664923686"
},
{
"evolutionRate": 1,
"tokenId": "BTC",
"exchangeRate": 20203.684282,
"timestamp": "1664923162016"
}
]
}
Delete a specific token
On success
{
"message": "Token successfully deleted"
}