Skip to content

anandritishaa07/Crypto-Tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cryptocurrency Data Fetcher and Analytics API

Overview

This project is a Node.js application that fetches cryptocurrency data for Bitcoin, Matic, and Ethereum, stores it in MongoDB, and provides APIs to retrieve the latest data and calculate price deviations.

Technologies

  • Node.js: JavaScript runtime.
  • Express.js: Web framework.
  • MongoDB: Database.
  • CoinGecko API: To fetch cryptocurrency data.

Setup Instructions

Prerequisites

  • Node.js (version 14.x or higher).
  • MongoDB (local or MongoDB Atlas).
  • CoinGecko API key (optional).

Steps to Set Up

  1. Clone the repository:
    git clone https://github.com/yourusername/crypto-data-fetcher.git
    cd crypto-data-fetcher
  2. Install Dependencies:
    npm install
  3. Set up MongoDB connection:
    MONGODB_URI=mongodb://localhost:27017/crypto_data
  4. Set up CoinGecko API key: COINGECKO_API_KEY=
  5. Start the server: npm start

API Endpoints

  1. Fetch Cryptocurrency Data The background job runs every 2 hours, fetching data from the CoinGecko API and saving it to MongoDB.
  2. Get Latest Data
    GET /stats?coin=<coin_name>
  3. Calculate Standard Deviation
    GET /stats?coin=bitcoin
    

API Endpoints

Background Job Runs every 2 hours using node-cron to fetch data for Bitcoin, Matic, and Ethereum from the CoinGecko API.

const cron = require('node-cron');

cron.schedule('0 */2 * * *', () => {
  fetchData();
});





   
   

  

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published