--- title: AndesOps AI Backend emoji: ๐Ÿค– colorFrom: purple colorTo: blue sdk: docker app_port: 7860 startup_duration_timeout: 30m python_version: 3.11 --- # AndesOps AI - Backend API Real-time Chilean public procurement market intelligence with AI-powered analysis. ## ๐Ÿš€ Features - **Real-time Market Data**: Access Mercado Pรบblico (Chile's public procurement) API - **Purchase Orders (OC)**: Monitor purchase orders across Chilean government agencies - **Tender Analysis**: AI-powered tender matching and recommendation - **LLM Integration**: Powered by Google Gemini, Groq, and Featherless AI - **REST API**: Full-featured FastAPI backend ## ๐Ÿ“‹ Environment Variables Required Add these in **Settings โ†’ Secrets** on Hugging Face: ``` MERCADO_PUBLICO_TICKET=99B4CA8C-C1DF-4E3F-B5CF-C1672D432A91 GEMINI_API_KEY=your_gemini_api_key GROQ_API_KEY=your_groq_api_key FEATHERLESS_API_KEY=your_featherless_key DATABASE_URL=sqlite:///./andesops.db GEMINI_MODEL=gemini-2.5-flash ``` ## ๐Ÿ”— API Endpoints - `GET /api/health` - Health check - `GET /api/tenders?keyword=...` - Search tenders - `GET /api/tenders/scrape?keyword=...` - Scrape Compra รgil - `GET /api/purchase-orders?date=ddmmaaaa` - Get purchase orders - `POST /api/analyze` - Analyze tender with AI - `POST /api/company-profile` - Save company profile ## ๐Ÿ”Œ CORS Configuration Automatically enabled for frontend at: `https://{user}-andesai-frontend.hf.space` ## ๐Ÿ“ฆ Backend Stack - **Framework**: FastAPI 0.109.0 - **Database**: SQLite (local) / MySQL (production) - **AI Models**: Google Gemini, Groq, Featherless - **Web Scraping**: httpx, BeautifulSoup4 - **Validation**: Pydantic v2 ## ๐Ÿšฆ Status - โœ… Mercado Pรบblico API integration - โœ… Real-time purchase order monitoring - โœ… Tender scraping (Compra รgil) - โœ… AI-powered analysis - โœ… CORS configured for frontend integration ## ๐Ÿ“ž Support Part of **AndesOps AI** - a complete platform for Chilean public procurement intelligence. Connect with the frontend space for the full application experience.