A powerful, secure REST API for automating GitHub follower management. Follow back new followers, farm followers from popular repositories, and cleanup non-followers - all through a simple API.
- Auto-Follow Back - Automatically follows users who follow you
- Smart Farming - Finds and follows active users from trending repos
- Scheduled Cleanup - Unfollows users who don't follow back
- Telegram Notifications - Get reports via Telegram (optional)
- API Key Protection - Secure your API with header-based authentication
- REST API - Control everything via HTTP endpoints
pip install -r requirements.txtCopy the example environment file:
copy .env.example .envEdit .env with your credentials:
APP_NAME=GitHub-Followers-API
APP_ENV=development
API_KEY=your_secret_api_key
GITHUB_TOKEN=your_github_token
TELEGRAM_BOT_TOKEN=your_telegram_bot_token # Optional
TELEGRAM_CHAT_ID=your_chat_id # OptionalGet your GitHub Token: GitHub Settings > Developer settings > Personal access tokens
Copy and edit config.example.json to config.json:
{
"farming": {
"enabled": true,
"target_repos": ["torvalds/linux", "facebook/react"],
"daily_follow_limit": 100
},
"cleanup_non_followers": true
}Option A: Double-click run_api.bat
Option B: Run manually:
uvicorn api:app --reload --host 0.0.0.0 --port 8000The API will start at http://127.0.0.1:8000
Access the Swagger UI: http://127.0.0.1:8000/docs
Protected endpoints require the X-API-Key header:
curl -H "X-API-Key: your_api_key" http://127.0.0.1:8000/v1/start -X POST| Method | Endpoint | Description |
|---|---|---|
| GET | /health |
Health check |
| GET | /status |
Get bot status and stats |
| Method | Endpoint | Description |
|---|---|---|
| GET | /v1/config |
View current configuration |
| POST | /v1/start |
Start background farming loop |
| POST | /v1/stop |
Stop background farming loop |
| POST | /v1/follow-back |
Trigger manual follow-back check |
| POST | /v1/cleanup |
Trigger manual cleanup |
| POST | /v1/farm |
Trigger one farming cycle |
GET /health
{
"status": "ok",
"app_name": "GitHub-Followers-API",
"environment": "development"
}GET /status
{
"status": "Stopped",
"is_running": false,
"authenticated_as": "your-username",
"stats": {
"followed_count": 150,
"farming_stats": {
"today": "2026-01-17",
"follows_today": 25,
"total_farmed": 500
}
}
}POST /v1/start
{
"message": "β
Farming started in background",
"success": true
}- NEVER commit your
.envfile to GitHub - All sensitive data uses
os.getenv() - API Key protection via
X-API-Keyheader .gitignoreexcludes all secret files
If you suspect a token leak, revoke it immediately.
.
βββ api.py # FastAPI application & endpoints
βββ core.py # Bot logic (follow, farm, cleanup)
βββ requirements.txt # Python dependencies
βββ .env.example # Environment template
βββ config.example.json # Bot configuration template
βββ run_api.bat # Windows startup script
βββ .gitignore # Git exclusions
βββ README.md # This file
Created by: dewhush