Created
December 31, 2025 01:41
-
-
Save apsknight/313b2a688df01c7c63fedf02bc69bcf5 to your computer and use it in GitHub Desktop.
USD -> INR Exchange Rate Pushover Script
This file contains hidden or 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
| #!/usr/bin/env python3 | |
| import requests | |
| import os | |
| def send_pushover(message): | |
| requests.post("https://api.pushover.net/1/messages.json", data={ | |
| "token": os.getenv("PUSHOVER_TOKEN"), | |
| "user": os.getenv("PUSHOVER_USER"), | |
| "message": message | |
| }) | |
| def get_best_rates(): | |
| # Lunar API | |
| lunar_data = requests.post( | |
| "https://lunar.getbitmoneyapp.com/transaction/v3/exchange?userId=", | |
| headers={'content-type': 'application/json', 'origin': 'https://www.crobo.money'}, | |
| json={"source_currency":"USD","destination_currency":"INR","client_id":"APIGetBitRemitWeb"} | |
| ).json() | |
| # Remitly API | |
| remitly_data = requests.get( | |
| "https://api.remitly.io/v3/calculator/estimate?conduit=USA%3AUSD-IND%3AINR&anchor=SEND&amount=1" | |
| ).json() | |
| lunar_rate = lunar_data['exchange_rate'] | |
| remitly_rate = float(remitly_data['estimate']['receive_amount']) | |
| best = 'Lunar' if lunar_rate > remitly_rate else 'Remitly' | |
| best_rate = max(lunar_rate, remitly_rate) | |
| message = f"USD→INR Rates\nLunar: ₹{lunar_rate}\nRemitly: ₹{remitly_rate}\nBest: {best} - ₹{best_rate}" | |
| print(message) | |
| send_pushover(message) | |
| if __name__ == "__main__": | |
| get_best_rates() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment