본문으로 건너뛰기
cccskills
무료GitHub에 공개

american-airlines

Check American Airlines AAdvantage balance, elite status, and loyalty points via Patchright. Handles email 2FA with 6-box code entry. Uses persistent browser profiles to skip 2FA on subsequent runs.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

연동 도구DockerPlaywright
설치 방법 보기

포함된 파일(3)

  • SKILL.md5.0 KB
  • Dockerfile328 B
  • scripts/check_balance.py21.7 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

American Airlines AAdvantage

Check AAdvantage award miles balance, elite status (Gold/Platinum/Platinum Pro/Executive Platinum), loyalty points, and million miler status. Uses Patchright (undetected Playwright fork) because AA blocks standard browser automation.

Requires Patchright. AA.com blocks vanilla Playwright and agent-browser.

Prerequisites

pip install patchright && patchright install chromium

Or use Docker (no local install needed):

docker pull ghcr.io/borski/aa-miles-check:latest
# or build locally:
docker build -t aa-check skills/american-airlines/

Usage

Pass credentials via environment variables or flags. If you use a secrets manager (1Password, Vault, etc.), inject them however you normally would.

# Environment variables
AA_USERNAME=your_aa_number AA_PASSWORD=your_password \
  python3 scripts/check_balance.py --json

# Flags
python3 scripts/check_balance.py --username YOUR_AA_NUMBER --password YOUR_PASSWORD --json

# Docker
docker run --rm -e AA_USERNAME=your_aa_number -e AA_PASSWORD=your_password aa-check --json

2FA Handling

AA requires email verification on first login from a new device. The script waits up to 120 seconds for the code.

You (the agent) do NOT have access to the user's email. AA sends the 2FA code to the account holder's email address. When the script hits 2FA, you MUST ask the user for the 6-digit code. This is not optional. Do not try to read their email. Do not guess. Do not skip. Ask them, wait for the answer, then write it to the code file.

Agent workflow

  1. Run the script in the background (nohup ... &, disown)
  2. Poll stderr for "2FA REQUIRED" to confirm the code was sent
  3. Ask the user for the 6-digit code AA emailed them
  4. Write the code to the code file: echo "123456" > /tmp/aa-2fa-code.txt
  5. Wait for the script to complete and read stdout for the JSON result

Persistent profiles (skip 2FA on repeat runs)

Use --profile name to save browser cookies. After the first successful 2FA, subsequent runs with the same profile skip 2FA entirely. Profiles are stored at ~/.aa-browser-profiles/{name}/. Sessions last hours, not days.

# First run: will need 2FA
python3 scripts/check_balance.py --profile user1 --json

# Later runs: same profile, no 2FA
python3 scripts/check_balance.py --profile user1 --json

Code input methods

  • Command hook: Set AA_2FA_COMMAND to a command that blocks until it has the code, then prints it to stdout. The script runs this first before falling back to file polling.
  • File (default): Script polls /tmp/aa-2fa-code.txt every 2 seconds. Write the 6-digit code there.
  • Direct flag: --code 123456 if you already have the code before running.
  • Custom file path: --code-file /path/to/code.txt

Output

{
  "username": "XXXXXXX",
  "status": "completed",
  "miles": 123425,
  "elite_status": "Platinum Pro",
  "loyalty_points": 180,
  "name": "John Doe",
  "aadvantage_number": "XXXXXXX",
  "million_miler": 19328,
  "member_since": "Aug 23, 2011"
}
FieldDescription
milesAward miles balance (redeemable)
elite_statusGold, Platinum, Platinum Pro, or Executive Platinum (null if none)
loyalty_pointsCurrent year loyalty points (reset March 1)
million_milerLifetime miles toward Million Miler status
member_sinceAccount creation date

When to Use

  • Checking AA miles balance (AwardWallet doesn't support AA)
  • Verifying elite status tier and expiration
  • Tracking loyalty points toward next status level
  • Comparing AA award availability against balance (combine with seats-aero)

When NOT to Use

  • Booking flights. Read-only. Does not modify anything.
  • Other airlines. Use AwardWallet for airlines it supports.

Implementation Notes

  • AA uses 6 separate input boxes for 2FA codes (one digit per box). The script types each digit individually with auto-advance.
  • Cookie consent banners are removed via JS before interacting with the Verify button.
  • The Verify button requires Tab+Enter to submit (neither JS .click() nor Playwright .click() produce a trusted pointer event that AA's React app accepts).
  • headless=False is required. AA detects headless browsers even with Patchright. Docker uses xvfb for a virtual display.

Limitations

  • 2FA on first use per profile. No way around it. AA sends an email code. Set AA_2FA_COMMAND to automate code retrieval.
  • Session expiry. Persistent profiles last hours, not days. Long gaps between runs may require 2FA again.
  • Headed mode required. Opens a Chrome window locally. Use Docker for no popup.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

alliances

무료

Airline alliance membership (Star Alliance, oneworld, SkyTeam) and cross-alliance booking relationships. Maps which loyalty programs book which airlines, including bilateral partnerships outside alliances.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

borski/travel-hacking-toolkit7092026년 10월 19일 업데이트

Search Amex travel portal for cash prices, MR points pricing, IAP discounts, and FHR/THC hotel benefits via Patchright. Use when comparing pay-with-points portal pricing to award alternatives.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

borski/travel-hacking-toolkit7092026년 10월 19일 업데이트

Search Atlas Obscura for weird, wonderful, and hidden gem places near any destination. Find the interesting stuff, not boring plaques. Search by coordinates, get full details with descriptions and images.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

borski/travel-hacking-toolkit7092026년 10월 19일 업데이트

Find the cheapest award dates for a route over a date range. Searches seats.aero across all programs, groups by date, and shows a calendar grid of the best deals. Use when dates are flexible and you want to find the sweet spot.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

borski/travel-hacking-toolkit7092026년 10월 19일 업데이트

Per-program rules for placing award flights on hold before transferring points. Covers programs with holds (AA, Lufthansa, Flying Blue, Cathay, Turkish, Virgin Atlantic, ANA, Emirates, EVA Air) and those without. Includes transfer-speed reference.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

borski/travel-hacking-toolkit7092026년 10월 19일 업데이트

Catalog of high-value award redemptions where points dramatically outvalue cash. Tiered by legendary/excellent/good with current rates, devaluation history, and booking caveats. Includes Oceania and South Pacific plays (Australia, New Zealand, Tahiti, Fiji) and transatlantic business-class sweet spots.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

borski/travel-hacking-toolkit7092026년 10월 19일 업데이트

borski의 스킬 모두 보기

이 스킬의 문제 신고