Skip to content

About

Crypto-email-notification-API

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

📡 Crypto Notification API

AWS Node.js License Status

A serverless API that sends crypto price notifications via email and stores search history using AWS Lambda, API Gateway, DynamoDB, and SES.

📚 Table of Contents

🔍 Overview

This API allows users to:

  • Request the price of a cryptocurrency (via CoinGecko API)
  • Trigger an email notification with formatted price details
  • Store and retrieve search history in DynamoDB with pagination support

The project uses AWS SAM for local development and deployment.

📧 Email Verification

To receive email notifications, your recipientEmail must be verified in my AWS SES account.

Verification steps: 1. Send me the email address you'd like to use. 2. I'll initiate the verification. 3. AWS will send you a confirmation email. 4. Click the confirmation link to verify.

Once verified, you'll be able to receive crypto alerts.

🛠 Run Locally

1. Install Dependencies

cd src/pricenotification && npm install
cd ../searchhistory && npm install

2. Start the Local API

SenderEmail="your-verified-ses-email@example.com" COINGECKO_API_KEY="your-api-key" SEARCH_HISTORY_TABLE="SearchHistory" npm run local

This runs:

sam local start-api

🌐 Using the Deployed API

Send Price Notification

curl -X POST "https://8crw78kyql.execute-api.us-east-1.amazonaws.com/prod/crypto/price"   -H "Content-Type: application/json"   -d '{
    "cryptoId": "bitcoin",
    "recipientEmail": "your-verified-email@example.com",
    "vsCurrencies": ["aud"]
  }'

Sample Email

Crypto Price Notification

Fetch Search History

curl "https://8crw78kyql.execute-api.us-east-1.amazonaws.com/prod/crypto/history?limit=25"

Example with pagination:

curl "https://8crw78kyql.execute-api.us-east-1.amazonaws.com/prod/crypto/history?limit=25&lastEvaluatedKey=eyJzZWFyY2hJZCI6IjEyMyIsInRpbWVzdGFtcCI6MTczMzIxMjM0NTZ9"

🔑 Environment Variables

Variable Description


SenderEmail SES-verified sender identity COINGECKO_API_KEY CoinGecko API key SEARCH_HISTORY_TABLE DynamoDB table name

🧰 Tech Stack

  • AWS Lambda
  • AWS API Gateway
  • AWS DynamoDB
  • AWS SES
  • AWS SAM
  • Node.js 18+

About

Crypto-email-notification-API

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages