An open API service indexing awesome lists of open source software.

https://github.com/murf-y/lbp-dollarrate-api

Free to use API for the current unofficial dollar rate to LBP from the black market in Lebanon.
https://github.com/murf-y/lbp-dollarrate-api

api fastapi python3

Last synced: about 1 year ago
JSON representation

Free to use API for the current unofficial dollar rate to LBP from the black market in Lebanon.

Awesome Lists containing this project

README

          

# Dollar Rate API 📈
A FASTAPI that returns the current ```unofficial``` dollar rate from the black market.
It uses [FASTAPI](https://fastapi.tiangolo.com/) server hosted on [render](https://render.com).








# How to use 🔍️
Send a ```GET``` request to the following URL to get the current dollar rate:


https://rate.onrender.com/api/v1/dollarRate



The format of the response is JSON, as follows:

```
{
"buy_rate":"number",
"sell_rate":"number"
}
```

Currently their is only one endpoint ```/api/v1/dollarRate```, but there will be more in the future, for sayrfa rate and other currencies.








# How it works ✨
The API uses a web scraper ```BeautifulSoup``` to get the current dollar rate from the black market. The scrapper runs on every request, it scrapes the data from: ```https://lbprate.com/``` and returns the data, then the API returns the scraped data.








# How to run 🚀

For the Packages:
```
pip install -r requirements.txt
```
To run the server:
```
uvicorn main:app
```








# Contributing 💡
For any issues or suggestions, please open an issue on this Github repository. Contributors are welcome!
# License 📄
This project is licensed under the MIT license. See the LICENSE file for more information.