aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: b88376b401a4e6a9dbf3f881c879060f5c1bd5cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Market Watch

A console-based application to watch stock prices and currency exchange rates.

## Setup

```
pip install -r requirements.txt
```

### API Endpoints

The application queries the following APIs. You need to register an account on
Rapid API and subscribe to them. The application is written to try to stay under
the request limit of the free tiers, although that will also depend on how many
stocks and currencies you decide to query. For a small set, the free tier of the
APIs should be sufficient. Otherwise, consider subscribing to the paid tiers.

- Stock: [https://rapidapi.com/amansharma2910/api/realstonks](https://rapidapi.com/amansharma2910/api/realstonks)
- Currency: [https://rapidapi.com/juhestudio-juhestudio-default/api/exchange-rate-api1](https://rapidapi.com/juhestudio-juhestudio-default/api/exchange-rate-api1)

Once you have created an account and subscribed, define the environment variable
`RAPIDAPI_KEY` with your API key prior to running the application. The
application queries this variable to determine your API key.

### Stocks and Currency

The application state is persisted in the file `state.txt`. To define which
stocks to query, add/remove the necessary lines to this file.

The syntax of a stock line is:

```
sticker price change change%
```

The syntax of a currency exchange is:

```
from/to rate
```

For stocks, you can leave all fields but the sticker to 0. For exchange rates,
you can leave the rate to 0.

See examples in the provided state file.