A lightweight Python tool for fetching the latest currency and gold rates from Navasan.net.
The project uses Selenium and HTTP requests to securely retrieve data and keeps it automatically updated via GitHub Actions.
Data is refreshed every 10 minutes using GitHub Actions, without requiring any paid service.
Live JSON data:
- Fiat currencies:
data/fiat.json - Gold and coin rates:
data/gold.json
- Headless Chrome automation with Selenium
- Secure session handling via
PHPSESSID - Dynamic CSRF token generation
- Fetches:
- Fiat currency rates
- Gold and coin prices
- Stores results as structured JSON
- Fully automated updates via GitHub Actions
.
├── .github/
│ └── workflows/
│ └── update-data.yml
├── data/
│ ├── fiat.json
│ └── gold.json
├── src/
│ └── app.py
├── requirements.txt
Clone the repository:
git clone https://github.com/HosseinOdd/Navasan-API.git
cd Navasan-API- Python 3.7+
- Google Chrome
- ChromeDriver (compatible with installed Chrome)
Install dependencies:
pip install -r requirements.txtRun the script:
python src/app.pyThe script will:
- Start a headless browser session
- Generate required authentication tokens
- Fetch and store the latest data in the
data/directory
fiat.json: Fiat currency exchange ratesgold.json: Gold and coin prices (Iran market)
Made with ❤️ for automation and data collection Please review and respect the terms of service of the data source.