https://github.com/sohamjoshi25/punefarmersmarket-api
A API which exposes a quantity and prices of all local farmer's market products daily by scraping a Government Website. Database is daily updated using github actions' cron job scheduler.
https://github.com/sohamjoshi25/punefarmersmarket-api
cronjob fastapi postgresql webscraper
Last synced: 2 months ago
JSON representation
A API which exposes a quantity and prices of all local farmer's market products daily by scraping a Government Website. Database is daily updated using github actions' cron job scheduler.
- Host: GitHub
- URL: https://github.com/sohamjoshi25/punefarmersmarket-api
- Owner: SohamJoshi25
- Created: 2025-04-07T14:10:53.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-08-11T09:46:46.000Z (11 months ago)
- Last Synced: 2025-08-11T11:37:10.351Z (11 months ago)
- Topics: cronjob, fastapi, postgresql, webscraper
- Language: Python
- Homepage: https://localfarmermarket.onrender.com
- Size: 1.19 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# FarmersMarket WebScraper
A simple, daily-updated API that scrapes local farmer market product prices and quantities from a government website and exposes the data via a REST API using FastAPI.
---
## 🌾 Project Overview
- **Automated Scraping**: Collects prices and quantities of products from local pune farmer markets every day.
- **Live Data Exposure**: Makes fresh data available through a RESTful FastAPI backend.
- **Open API**: Easily integrate real-time market data into your own applications or dashboards.
- **Product Translation**: Translated Product Names from local language marathi to english.
- **Hosted Demo**: [Live API on Render](https://localfarmermarket.onrender.com/)
---
## 🚀 How to Use the API
### Base URL
https://localfarmermarket.onrender.com/
### Example Endpoints
| Endpoint | Description |
|-----------------------|------------------------------------------------------------------|
| `/docs` | Interactive API docs (FasiAPI selfmade) |
| `/rates ` | Get all market products with price & quantity |
| `/refresh` | Manually trigger a data refresh (Used for Cron Job) |
### Sample Usage
**GET https://localfarmermarket.onrender.com/rates/?order_by=code&order=ASC&limit=10&offset=10**
```
[
{
"code": 1001,
"quantity": 11970,
"unit": "Quintal",
"date": "2025-04-27",
"minimum": 500,
"maximum": 1500,
"item_name": "Onion"
},
{
"code": 1001,
"quantity": 9607,
"unit": "Quintal",
"date": "2025-04-29",
"minimum": 500,
"maximum": 1500,
"item_name": "Onion"
},
{
"code": 1001,
"quantity": 6368,
"unit": "Quintal",
"date": "2025-04-23",
"minimum": 700,
"maximum": 1500,
"item_name": "Onion"
},
{
"code": 1001,
"quantity": 7969,
"unit": "Quintal",
"date": "2025-04-28",
"minimum": 400,
"maximum": 1400,
"item_name": "Onion"
},
{
"code": 1001,
"quantity": 10534,
"unit": "Quintal",
"date": "2025-04-18",
"minimum": 700,
"maximum": 1500,
"item_name": "Onion"
}
]
```