Full login flow including JS instrumentation, SSO, and password steps.
Handles two-factor auth and email checkpoint verification automatically.
Route requests through HTTP/HTTPS proxies for anonymity and geo-bypass.
Extracts ct0 and full cookie string after successful login.
Built-in retry logic with exponential backoff on network failures.
Multi-stage Docker build. Deploy anywhere in seconds.
Test the login API directly from your browser.
// Result will appear here...
/health
Health check
curl https://your-space.hf.space/health
/api/login
Login to Twitter
{
"username": "your_username",
"password": "your_password",
"email": "optional@email.com",
"twoFactorCode": "optional_2fa",
"checkpointCode": "optional_checkpoint",
"proxy": "http://user:pass@host:port",
"language": "en"
}
{
"success": true,
"ct0": "abc123...",
"cookie": "ct0=abc123; auth_token=xyz..."
}
npm install twitter-unofficial-api
import { Twitter } from 'twitter-unofficial-api';
const client = new Twitter({ language: 'en' });
const result = await client.login('username', 'password');
console.log(result.cookie);