PyToPrice (Python Crypto Price)
PytoPrice is an automation program to fetch the latest price of a cryptocurrency of your choice at a user-customizable update interval. It also comes with the ability to send you an alert when the price goes below your price threshold.
This is not a full service. This repository merely gives you the automation code for you to intergrate using third-party service.
It is recommended to use IFTTT for this project, as this project relies heavily on IFTTT.
The price updates may or may not get delivered exactly in X (where X is the price update interval of your choice) seconds sharp. This is happening because it takes time to fetch the price data from CoinMarketCap API and to send it to the IFTTT Telegram Bot. If this does not suit your use case, please refrain from using this repository.
This is the requirements that's needed to be fulfilled in order to use this project.
- An IFTTT account (to make IFTTT applet).
- IFTTT app installed on your phone
- A Telegram account (to intergrate with IFTTT bot).
- An API Key to access CoinMarketCap API (The free tier will do). (NOTE: For free tier, 5 minutes (300 seconds) update interval is highly recommended.)
- Intergration with smartphone notification system (through IFTTT application).
- Intergration with Telegram Bot (through IFTTT telegram bot).
- User-customizable price update interval.
Do a git clone of this repository using
git clone https://github.com/PeterAjaaa/PyToPrice.
Make an account at CoinMarketCap API.
Copy the API key and store it somewhere safe.
Make an account at IFTTT (If This Then That).
Create a new applet on IFTTT.
- Choose the 'If this' and click on 'Add'. - Search for 'Webhooks' and click on 'Receive A Web Request'. - Put a name on it, and store it somewhere safe, as it is needed later. - Choose the 'If that' and click on 'Add'. - Search for notification and click on 'Send a notification from the IFTTT app'. - Change the message to whatever you like. - Do this twice, one for the Telegram Price Update and the other for the Emergency Alert System. (Note that the Telegram intergration will make use of authentication from your account).
Go to the IFTT Webhook Maker Documentation.
Click the 'Documentation' button.
Copy the URL Key a.k.a. /key/copy-this and store it somewhere safe.
Run 'python pytoprice.py' for MacOS and Linux, and 'python3 pytoprice.py' for Windows.
Fill in the credential needed (no data is sent over to me and is stored on a config file locally).
Keep it running and it's done.