Usagi-org/ai-goofish-monitor
Summary
An open-source intelligent monitoring system for Xianyu, built on Playwright and multimodal AI models to support real-time monitoring of multiple tasks, with a web management interface, AI-powered task creation using natural language, multichannel notifications, and one-click Docker deployment.
View Cached Full Text
Cached at: 11/03/26, 03:24 PM
Usagi-org/ai-goofish-monitor Source: https://github.com/Usagi-org/ai-goofish-monitor # Xianyu Intelligent Monitoring System [Chinese] | English A Playwright- and AI-based real-time monitoring system for multiple Xianyu tasks, with a complete web management interface. ## Core Features - Visual Web Management: Task management, account management, AI criteria editing, runtime logs, and result browsing - AI-Powered: Create tasks using natural language and analyze products in depth with multimodal models - Concurrent Tasks: Independently configure keywords, prices, filters, and AI prompts - Advanced Filtering: Free shipping, newly listed time ranges, and three-level province/city/district filtering - Instant Notifications: Supports multiple channels, including ntfy.sh, WeCom, Bark, Telegram, and Webhook - Scheduled Execution: Supports recurring tasks with Cron configuration - Account and Proxy Rotation: Multiple account management, task-to-account binding, proxy pool rotation, and retries on failure - Docker Deployment: One-click containerized deployment ## Screenshots Monitoring Overview Task Management Result Viewing Push Notifications ## 🐳 Docker Deployment (Recommended) bash git clone https://github.com/Usagi-org/ai-goofish-monitor && cd ai-goofish-monitor cp .env.example .env vim .env # Fill in the relevant configuration settings docker compose up -d docker compose logs -f app docker compose down If the image is inaccessible or downloads slowly, try using a mirror: bash docker pull ghcr.nju.edu.cn/usagi-org/ai-goofish:latest docker tag ghcr.nju.edu.cn/usagi-org/ai-goofish:latest ghcr.io/usagi-org/ai-goofish:latest docker compose up -d - Default Web UI address: http://127.0.0.1:8000 - The Docker image includes Chromium, so no additional browser installation is required on the host. - Official image address: ghcr.io/usagi-org/ai-goofish:latest - Update the image: docker compose pull && docker compose up -d - If you change SERVER_PORT in .env, update the port mapping in docker-compose.yaml accordingly. - By default, docker-compose.yaml mounts the main SQLite database directory using ./data:/app/data; the database file defaults to data/app.sqlite3 - The following directories are currently persisted by default: - data/ Main SQLite storage (tasks, results, price history) - state/ Login state cookie files - prompts/ Task prompts - logs/ Runtime logs - images/ Product images and temporary task image directory - config.json, jsonl/, price_history/ Legacy data sources used for compatibility imports when first upgrading to SQLite ### Data Storage and Migration - The current primary storage is SQLite, with the default path data/app.sqlite3 - Customize the database path using the APP_DATABASE_FILE environment variable; Docker sets it to /app/data/app.sqlite3 by default - On startup, the application automatically creates the database and tables and attempts a one-time import of historical data from the legacy config.json, jsonl/, and price_history/ - state/, prompts/, logs/, and images/ remain filesystem directories and are not stored in SQLite - Product images are temporarily saved to images/task_images_/ and are cleaned up by default after the task finishes - After completing the first upgrade and confirming that the data in data/app.sqlite3 is correct, decide whether to retain the legacy config.json, jsonl/, and price_history/ mounts based on your deployment method ### Minimum Configuration | Variable | Description | Required | |——|——|——| | OPENAI_API_KEY | AI model API key | Yes | | OPENAI_BASE_URL | OpenAI-compatible API endpoint | Yes | | OPENAI_MODEL_NAME | Name of a model that supports image input | Yes | | WEB_USERNAME / WEB_PASSWORD | Web UI login username and password; defaults to admin/admin123 | No | See “Configuration Details” below for other settings. ### First-Time Use 1. Open the default Web UI at http://127.0.0.1:8000 and log in. 2. Go to “Xianyu Account Management” and use the Chrome extension (https://chromewebstore.google.com/detail/xianyu-login-state-extrac/eidlpfjiodpigmfcahkmlenhppfklcoa) to export and paste your Xianyu login state JSON. 3. The login state file will be saved in the state/ directory, for example, state/acc_1.json. 4. Return to “Task Management,” create a task, and bind an account to run it. ### Creating Your First Task - AI Evaluation: Fill in “Detailed Requirements.” After submission, a separate progress dialog will appear while analysis criteria are generated asynchronously in the background. - Keyword Evaluation: Fill in keyword rules. The task will be created directly without going through AI generation. - Region Filter: Now uses a three-level province / city / district selector, with built-in data based on scraped snapshots of Xianyu pages. ## User Guide Click to expand Web UI feature descriptions ### Task Management - Supports AI-based creation, keyword rules, price ranges, newly listed time ranges, region filters, account binding, and scheduling rules. - AI task creation runs as a background job, with a separate progress dialog opening after submission. - Region filtering significantly narrows the result set and is left blank by default. ### Account Management - Supports importing, updating, and deleting Xianyu account login states. - Each task can specify an account or remain unbound so the system can choose automatically. ### Results and Runtime Logs - The results page and export feature now query SQLite instead of directly scanning jsonl files. - The logs page displays execution details by task to help troubleshoot expired login states, risk controls, and AI API call issues. ### System Settings - View system status, edit prompts, and adjust proxy and rotation settings. ## Developer Guide ### Requirements - Python 3.10+ - Node.js + npm (frontend builds have been verified locally with Node v20.18.3) - Playwright CLI and Chromium; before the first run, it is recommended to execute python3 -m pip install playwright && python3 -m playwright install chromium - Chrome / Edge browser (Chromium can also be used on Linux; start.sh first checks whether a browser is available) bash git clone https://github.com/Usagi-org/ai-goofish-monitor cd ai-goofish-monitor cp .env.example .env ### One-Click Startup bash chmod +x start.sh ./start.sh start.sh first checks the Playwright CLI and browser prerequisites. Once they are met, it automatically installs project dependencies, builds the frontend, copies the build artifacts, and starts the backend. ### Manual Startup bash # Backend python -m src.app # Or uvicorn src.app:app --host 0.0.0.0 --port 8000 --reload # Frontend cd web-ui npm install npm run dev - FastAPI automatically initializes SQLite on startup and attempts to import the legacy config.json/jsonl/price_history on the first startup - spider_v2.py reads tasks from SQLite by default; JSON configuration compatibility mode is used only when --config is explicitly provided - The default database path is data/app.sqlite3 - The Vite development server proxies /api, /auth, and /ws to http://127.0.0.1:8000. - npm run build first generates web-ui/dist/, and start.sh then copies it to dist/ in the repository root. - FastAPI serves dist/index.html and dist/assets/ from the root directory. - By default, ./start.sh displays the access address http://localhost:8000 and API documentation at http://localhost:8000/docs. ### Testing and Validation bash PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 pytest cd web-ui && npm run build ### Task Creation API Click to expand API behavior details - POST /api/tasks/generate - decision_mode=ai: Returns 202 and job; continued progress polling is required. - decision_mode=keyword: Returns the created task directly. - GET /api/tasks/generate-jobs/{job_id}: Queries AI task generation progress. - POST /auth/status: Validates Web UI login credentials. ## Configuration Details Click to expand common configuration settings ### AI and Runtime - OPENAI_API_KEY / OPENAI_BASE_URL / OPENAI_MODEL_NAME: Required settings for AI model access. - PROXY_URL: Specifies a separate HTTP/SOCKS5 proxy for AI requests. - RUN_HEADLESS: Whether to run the crawler in headless mode; keep this set to true in Docker. - SERVER_PORT: Backend listening port; defaults to 8000. - LOGIN_IS_EDGE: Allows switching to the Edge engine in local environments; the Docker image does not include Edge and always uses Chromium inside the container. - PCURL_TO_MOBILE: Whether to convert desktop product links to mobile links. ### Notifications - NTFY_TOPIC_URL - GOTIFY_URL / GOTIFY_TOKEN - BARK_URL - WX_BOT_URL - TELEGRAM_BOT_TOKEN / TELEGRAM_CHAT_ID / TELEGRAM_API_BASE_URL - WEBHOOK_* ### Proxy Rotation and Failure Protection - PROXY_ROTATION_ENABLED - PROXY_ROTATION_MODE - PROXY_POOL - PROXY_ROTATION_RETRY_LIMIT - PROXY_BLACKLIST_TTL - TASK_FAILURE_THRESHOLD - TASK_FAILURE_PAUSE_SECONDS - TASK_FAILURE_GUARD_PATH See .env.example for a complete example. ## Web Interface Authentication Click to expand authentication details - The Web UI currently collects usernames and passwords through a login page and validates them using POST /auth/status. - After a successful login, the frontend saves the login state locally in the browser for route guards and WebSocket initialization. - The default credentials are admin/admin123; be sure to change them in production. ## 🚀 Workflow The diagram below describes the core processing logic of a single monitoring task from start to finish. The main service runs in src.app and starts one or more task processes based on user actions or scheduled execution. mermaid graph TD A[Start Monitoring Task] --> B[Select Account/Proxy Configuration]; B --> C[Task: Search Products]; C --> D{New Products Found?}; D -- Yes --> E[Fetch Product Details & Seller Information]; E --> F[Download Product Images]; F --> G[Call AI for Analysis]; G --> H{Does AI Recommend It?}; H -- Yes --> I[Send Notification]; H -- No --> J[Save Record to SQLite]; I --> J; D -- No --> K[Next Page/Wait]; K --> C; J --> C; C --> L{Risk Control/Exception Triggered?}; L -- Yes --> M[Rotate Account/Proxy and Retry]; M --> C; ## Frequently Asked Questions Click to expand frequently asked questions ### Why does AI task creation not finish immediately? AI mode generates analysis criteria before creating the task. This process now runs as a background job, with a separate progress dialog displayed after submission to prevent the form from remaining stuck for a long time. ### Why is it recommended to leave the region filter blank by default? Region filtering significantly reduces search results and is suitable when you specifically want to view a particular area. If you are first assessing the overall market, it is recommended to leave it blank. ### Why does the local page report that frontend build artifacts do not exist? This means the root-level dist/ directory is missing. Run ./start.sh directly, or first run npm run build in web-ui/, then confirm that the build artifacts have been copied to the repository root. ### Why does ./start.sh report that Playwright or a browser is missing? This is the script’s prerequisite check. Install the Playwright CLI and Chromium first, ensure Chrome / Edge is available on your system (Chromium can also be used on Linux), and then run ./start.sh again. ## Acknowledgments Click to expand acknowledgments This project drew on the following excellent projects during development, with special thanks to: - superboyyy/xianyu_spider (https://github.com/superboyyy/xianyu_spider) Also, thanks to members of LinuxDo for their script contributions - @jooooody (https://linux.do/u/jooooody/summary) And thanks to the LinuxDo (https://linux.do/) community. Thanks also to model tools such as ClaudeCode/Gemini/Codex for freeing our hands and letting us experience the joy of Vibe Coding. ## Notes Click to expand details - Please comply with Xianyu’s user agreement and robots.txt rules. Avoid overly frequent requests that could burden the server or cause your account to be restricted. - This project is intended only for learning and technical research. Do not use it for illegal purposes. - This project is released under the MIT License and is provided “as is,” without warranties of any kind. - The project’s authors and contributors are not liable for any direct, indirect, incidental, or special damages or losses resulting from the use of this software. - For more details, see the Disclaimer file. ## Star History Star History Chart (https://www.star-history.com/#Usagi-org/ai-goofish-monitor&Date) Alt
Similar Articles
@XAMTO_AI: Now you can finally let AI keep an eye on bargains on Xianyu around the clock! : https://github.com/Usagi-org/ai-goofish-monitor… This tool is called ai-goofish-monitor, essentially an automated Xianyu item monitor.
ai-goofish-monitor is an open-source Xianyu item monitoring tool based on Playwright and AI, supporting multi-task concurrency, AI item analysis, multi-channel notifications, and more.
@CopperForgeAI: https://x.com/CopperForgeAI/status/2108830306014998719
A detailed Chinese tutorial on Orca, the open-source AI development workbench (from Stably, backed by Y Combinator): how to orchestrate multiple coding agents (Claude Code, Codex, Cursor, etc.) in a single window, enabling multi-agent collaboration workflows such as independent workspaces, parallel agent racing to fix issues, cross-vendor session handoffs, and line-by-line annotated code reviews.
@QingQ77: Open-source self-hosted AI Security Operations Center providing alert fusion, purple team exercises, AI-assisted triage, and MITRE ATT&CK investigation analysis. https://github.com/beenuar/AiSOC AiSOC packages security event collection, correlation analysis, AI investigation, and SOC console into a self-hosted stack...
AiSOC is an open-source self-hosted AI Security Operations Center tool built on LangGraph. It integrates alert fusion, AI-assisted triage, and MITRE ATT&CK investigation analysis, supporting full-chain reasoning log playback and flexible deployment across multiple environments.
@QingQ77: Share memory and task states across multiple AI coding agents, run a single Go binary with local SQLite, and combine keyword and semantic search. https://github.com/mathomhaus/guild… Guild is a single-binary Go MCP server, …
Guild is a single-binary MCP server built with Go, enabling multiple AI coding agents to share memory, task states, and local SQLite storage, while combining keyword and semantic search capabilities.
open-webui/open-webui
Open WebUI 是一个可自托管、可扩展且支持完全离线运行的 AI 平台,兼容 Ollama 与各类 OpenAI 兼容 API,提供插件系统、智能体、持久记忆与团队协作频道等丰富功能。