What It Is
This system is a production Flask API for Google account login automation at scale. It orchestrates AdsPower anti-detect browser profiles, location-aligned proxies, and Xano as the system of record running single and batch logins, tracking step-level attempt logs, validating signed-out sessions, and collecting browser cookies through configured post-login browsing flows.
The architecture treats browser farms as an operations platform: parallel workers, profile reuse, evidence capture, and Grafana-backed visibility not one-off scripts.
The Problem We Solved
Managing thousands of browser-backed accounts manually does not scale:
- Each account needs an isolated fingerprint (AdsPower profile) and a consistent proxy strategy
- Login flows fail in many ways (CAPTCHA, challenges, terms, recovery) and need structured retry metadata
- Operators lack a single API to run batches, inspect runs, and see which step failed
- Session drift (signed-out Gmail) wastes profiles until detected and reclaimed
- Cookie state after login must be harvested and stored for downstream tools
The service centralizes login orchestration, persistence, and maintenance so engineering and operations share one control plane.
What We Work On
Login automation
Single and batch login endpoints, parallel workers (MAX_PARALLEL_ACCOUNTS), and step-level account_login_attempts with run-level aggregates.
Profile & proxy management
AdsPower profile lifecycle, proxy assignment with geo alignment, fallback modes, and profile cleanup APIs.
Session maintenance
Signed-out detection, scheduled validity checks, session reopen with backoff, and resource reclamation.
Cookie farming
Post-login top-sites browsing and CDP cookie capture persisted to Xano for accounts that completed successfully.
Resilience & safety
CAPTCHA integrations (2Captcha, Anti-Captcha, CapMonster), recovery and terms handlers, evidence screenshots, and account ban/unban controls.
Observability & ops
Flasgger API docs, Grafana dashboards (Xano/Infinity and optional MySQL sources), APScheduler crons, and Docker/PM2 deployment patterns.
How It Works (In Simple Terms)
- Configure: Accounts, proxies, and AdsPower profiles are registered in Xano.
- Assign: The service picks or creates a profile and aligns a proxy to the account’s location.
- Automate: Selenium drives the browser inside AdsPower for Google sign-in and verification steps.
- Record: Each step and run is logged; failures store challenge and cooldown metadata.
- Maintain: Cron jobs check session/cookie validity, reopen sessions, and run cookie-farming flows.
The API is the orchestration layer; AdsPower owns browser isolation and Xano owns durable state.
Key Outcomes
- Scalable throughput: Parallel login workers across a large account pool.
- Fingerprint isolation: Per-account AdsPower profiles instead of shared browser state.
- Operational visibility: Step logs, run metrics, and Grafana views for incidents.
- Automated hygiene: Signed-out checks and cookie-farming pipelines reduce manual rework.
- Production hardening: Evidence capture, ban controls, and documented runbooks for operators.
Technologies & Approaches We Used
| Area | What we used | Why it matters |
|---|---|---|
| API | Flask, Gunicorn, Flasgger | REST control plane with Swagger for operators |
| Automation | Selenium 4, AdsPower local API | Real browser flows with anti-detect profiles |
| Data | Xano REST repositories | Central SoT for accounts, runs, proxies, cookies |
| Scheduling | APScheduler | Session validity, cookie checks, maintenance crons |
| Validation | Pydantic, python-dotenv | Typed config and safer deployments |
| CAPTCHA | 2Captcha, Anti-Captcha, CapMonster | Automated recovery on challenge steps |
| Monitoring | Grafana, Docker Compose | Dashboards and local ops stack |
| Deploy | PM2, Make | Repeatable prod/dev process management |
Approach in practice: We kept orchestration in Python, state in Xano, and browsers in AdsPower so each layer can scale independently. Parallelism, geo-matched proxies, and structured attempt logs make failures diagnosable without replaying full manual sessions.
Who It's For
- Internal platform teams managing large browser-account fleets
- Operators running batch logins, session checks, and cookie collection
- Engineers integrating anti-detect automation with a centralized data backend