Backup your Any.do tasks. Raw JSON and markdown.
This project is created as a tribute to Any.do's excellent task management service.
Flow inspired by Any.do's own efficient web implementation, ensuring this client remains respectful of Any.do's infrastructure while providing useful backup capabilities that do not currently exist on the official site.
- π‘οΈ Server-Friendly: Designed to minimize impact on Any.do's infrastructure with smart change detection and incremental sync
- π Secure Authentication: Session persistence with 2FA support
- π Multiple Export Formats: JSON and Markdown exports
- Python 3.7 or higher
- Any.do account
# Clone the repository
git clone <repository-url>
cd anydo-api
# Run the setup script (creates venv and installs dependencies)
python setup.py
# On macOS/Linux
source venv/bin/activate
# On Windows
venv\Scripts\activate
# First run will prompt to create config.json
python anydown.py
The script will automatically:
- β
Detect if
config.json
exists - π§ Offer to create one if missing
- π Prompt for your Any.do credentials
- πΎ Save configuration securely
- π Sync and display your tasks
- Session persistence: Saves login session to avoid re-authentication
- 2FA support: Interactive prompts for two-factor authentication
- Timestamped exports: Saves tasks to outputs/YYYY-MM-DD_HHMM-SS_anydo-tasks.json
- Markdown generation: Creates markdown files from JSON when meaningful changes are detected
- Change detection: Only creates new files when tasks have changed
- Smart sync: Incremental sync downloads only changes since last sync
- Rate limiting: Prevents excessive full syncs (max once per minute)
The client includes several optimizations to reduce server load and improve performance:
- Session reuse: Maintains persistent HTTP session with connection reuse
- Compression support: Automatic gzip/br/zstd decompression for reduced bandwidth
- Smart sync strategy: Uses incremental sync to download only changes when possible
- Exponential backoff: For polling sync operations to avoid overwhelming the server
- Rate limiting: Prevents full syncs more than once per minute
- Smart change detection: Only downloads when there are actual changes to tasks
- Data hashing: Tracks changes using SHA-256 hashes to avoid unnecessary exports
- Session persistence: Stores authentication and sync state to minimize login requests
- Incremental sync: Downloads only tasks updated since last sync (when available)
- Full sync fallback: Automatically falls back to full sync when incremental fails
- Background sync polling: Efficient polling with exponential backoff for async operations
python anydown.py
The application will create a config.json
file on first run:
{
"email": "your@email.com",
"password": "your_password",
"save_raw_data": true,
"auto_export": true,
"text_wrap_width": 80
}
Security Note: config.json
is automatically added to .gitignore
for protection.
If you encounter login issues or prefer to use existing browser sessions, you can manually create a session.json
file using browser developer tools:
- Login authentication failures
- 2FA/MFA complications
- Already logged into Any.do in your browser
- Debugging authentication issues
- Open Any.do in your browser and ensure you're logged in
- Open Developer Tools (F12 or right-click β Inspect)
- Go to the Application/Storage tab
- Navigate to Cookies β
https://any.do
- Find the authentication cookie (usually
SPRING_SECURITY_REMEMBER_ME_COOKIE
) - Copy the cookie value
Create a session.json
file in your project root with the following structure (use session.json.example
as a template):
{
"cookies": [
{
"name": "SPRING_SECURITY_REMEMBER_ME_COOKIE",
"value": "YOUR_COPIED_COOKIE_VALUE_HERE",
"domain": ".any.do",
"path": "/"
}
],
"user_info": {
"email": "your@email.com",
"timezone": "Your/Timezone",
"isPremium": false
},
"saved_at": "2025-01-01T00:00:00.000000",
"last_data_hash": null,
"last_pretty_hash": null,
"last_sync_timestamp": 0
}
To populate the user_info
section:
- In Developer Tools, go to the Network tab
- Refresh the Any.do page
- Look for API calls to endpoints like
/me
or/user
- Copy relevant user data from the response
Note: You can start with minimal user info - the client will update it during sync.
- Keep session.json private - it contains authentication data
- Cookie expiration - Sessions may expire and need refreshing
- Don't commit session.json to version control (it's in
.gitignore
) - Use session.json.example as a template with sanitized placeholder values
The client generates multiple export formats:
outputs/
βββ raw-json/ # Complete API responses
βββ markdown/ # Formatted tables and lists
- Change Detection: Only creates new files when data changes
- Timestamped Files: Organized by date and time
- Smart Markdown Generation: Clean tables with task hierarchies
- Nested Subtasks: Properly organized task hierarchies
from anydo_client import AnyDoClient
client = AnyDoClient()
client.login("your@email.com", "your_password")
# Get tasks (with smart change detection)
tasks = client.get_tasks()
# Display task summary
client.print_tasks_summary()
# Get simplified task list
simple_tasks = client.get_simple_tasks()
# Get lists/categories
lists = client.get_lists()
# Run all tests
python run_tests.py
# Or use pytest directly
python -m pytest tests/ -v
anydo-api/
βββ anydown.py # Main CLI application
βββ anydo_client.py # Core client library
βββ debug_login.py # Login troubleshooting tool
βββ setup.py # Setup script
βββ requirements.txt # Dependencies
βββ tests/ # Test suite
βββ outputs/ # Generated exports
βββ config.json # Your credentials (auto-created)
- Local Storage: All data stays on your machine
- Session Persistence: Reduces authentication requests
- Secure Config: Configuration files are gitignored
- 2FA Support: Interactive prompts for verification codes
The client analyzes Any.do's own website patterns and implements:
- Smart Change Detection: Only downloads when there are actual changes
- Incremental Sync: Downloads only updated tasks when possible
- Full Sync Fallback: Automatically falls back when incremental sync fails
- Session Management: Persistent authentication
- Error Handling: Graceful failure recovery
Authentication: https://sm-prod4.any.do/login
Background Sync: https://sm-prod4.any.do/api/v14/me/bg_sync
Sync Results: https://sm-prod4.any.do/me/bg_sync_result/{task_id}
pip install -r requirements.txt
session.json
: Stores login session and optimization dataoutputs/raw-json/YYYY-MM-DD_HHMM-SS_anydo-tasks.json
: Raw task dataoutputs/markdown/YYYY-MM-DD_HHMM-SS_anydo-tasks.md
: Formatted markdown
config.json
andsession.json
are in.gitignore
for security- Session tokens are stored locally and reused safely
- Smart sync reduces authentication requests
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
The client is designed to be respectful of Any.do's servers while providing efficient access to your data.
Made with β€οΈ for the Any.do community