Skip to content
项目

关于

美国签证机器人

其他项目

这些数字如何统计

可以做什么

  • 🔄 Continuously monitors available appointment slots
  • 📅 Automatically books earlier dates when found
  • 🎯 Configurable target, minimum and maximum date constraints
  • 🪪 Books the ASC (biometrics/CASV) appointment together with the interview

实测星标增长

24小时
0
7天
0
15天
+4
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

US Visa Bot 🤖

An automated bot that monitors and reschedules US visa interview appointments to get you an earlier date.

Features

  • 🔄 Continuously monitors available appointment slots
  • 📅 Automatically books earlier dates when found
  • 🎯 Configurable target, minimum and maximum date constraints
  • 🪪 Books the ASC (biometrics/CASV) appointment together with the interview
  • 👨‍👩‍👧 Supports group (family) schedules
  • 🧮 Protects limited reschedule attempts (max date + stop on unconfirmed booking)
  • 🚨 Exits successfully when target date is reached
  • 📊 Detailed logging with timestamps
  • 🔐 Secure authentication with environment variables

How It Works

The bot logs into your account on https://ais.usvisa-info.com/ and checks for available appointment dates every few seconds. When it finds a date earlier than your current booking (and within your specified constraints), it automatically reschedules your appointment.

Prerequisites

  • Node.js 22.20+ (CI tests the maintained Node.js 22, 24, and 26 LTS lines)
  • A valid US visa interview appointment
  • Access to https://ais.usvisa-info.com/

Installation

  1. Clone the repository:
git clone https://github.com/your-username/us-visa-bot.git
cd us-visa-bot
  1. Install dependencies:
npm install

Configuration

Create a .env file in the project root with your credentials:

[email protected]
PASSWORD=your_password
COUNTRY_CODE=your_country_code
SCHEDULE_ID=your_schedule_id
FACILITY_ID=your_facility_id
ASC_FACILITY_ID=your_asc_facility_id   # only in countries with an ASC appointment
MAX_DATE=2026-11-30                    # optional
REFRESH_DELAY=3

See .env.example for a commented template.

Finding Your Configuration Values

Variable Description How to Find
EMAIL Your login email Your credentials for ais.usvisa-info.com
PASSWORD Your login password Your credentials for ais.usvisa-info.com
COUNTRY_CODE Your country code Found in URL: https://ais.usvisa-info.com/en-{COUNTRY_CODE}/
Examples: br (Brazil), fr (France), de (Germany)
SCHEDULE_ID Your appointment schedule ID Found in URL when rescheduling:
https://ais.usvisa-info.com/en-{COUNTRY_CODE}/niv/schedule/{SCHEDULE_ID}/continue_actions
FACILITY_ID Your consulate facility ID See Finding Your Facility IDs
Examples: Paris = 44, Sao Paulo = 56
ASC_FACILITY_ID Your ASC (biometrics, "CASV" in Brazil) facility ID Optional. Required in countries with a separate ASC appointment (e.g. Brazil, Mexico, Colombia): without it the site drops your existing ASC appointment. See Finding Your Facility IDs
MAX_DATE Latest acceptable interview date (YYYY-MM-DD) Optional ceiling only; it does not enable monthly step-down. The --max flag overrides it
REFRESH_DELAY Seconds between checks Optional, defaults to 3 seconds. Short delays get the account soft-banned sooner, see Rate Limiting

Finding Your Facility IDs

  1. Log in, open Reschedule Appointment and click Continue until you reach the page with the location and date fields. Opening this page does not use a reschedule attempt; do not submit it.
  2. Open the browser DevTools console (F12) and run:
    [...document.querySelectorAll('select[id$="facility_id"] option')].map(o=>`${o.parentElement.id} = ${o.value} (${o.text})`).join('\n')
    
  3. The consulate_appointment line for your city is FACILITY_ID; the asc_appointment line (if any) is ASC_FACILITY_ID.

Usage

Run the bot with your current appointment date:

npm start -- -c <current_date> [-t <target_date>] [-m <min_date>] [--max <max_date>] [--month-step-down] [--dry-run]

Command Line Arguments

Flag Long Form Required Description
-c --current ✅ Your current booked interview date (YYYY-MM-DD)
-t --target ❌ Target date to stop at - exits successfully when reached
-m --min ❌ Minimum acceptable date - skips dates before this
--max ❌ Maximum acceptable date - skips dates after this (overrides MAX_DATE)
--month-step-down ❌ Require at least one calendar month of improvement, starting with the first booking
--dry-run ❌ Go through the whole booking flow but only log what would be submitted

Examples

# Basic usage - reschedule to any earlier date
npm start -- -c 2023-06-15

# With target date - stop when you get June 1st or earlier  
npm start -- -c 2023-06-15 -t 2023-06-01

# With minimum date - only accept dates after May 1st
npm start -- -c 2023-06-15 -m 2023-05-01

# With both constraints - only book between May 1st and June 1st
npm start -- -c 2023-06-15 -t 2023-06-01 -m 2023-05-01

# Ceiling only - keep looking for any earlier date within May
npm start -- -c 2023-08-15 --max 2023-05-31

# Limited attempts - require a calendar month of improvement per booking
npm start -- -c 2027-08-15 --max 2027-05-31 --month-step-down

# Check your setup without booking anything
npm start -- -c 2023-06-15 --dry-run

# Get help
npm start -- --help

Limited Reschedule Attempts

Some countries limit how many times you can reschedule (e.g. Brazil and Canada allow 3). Without constraints the bot would spend an attempt on any earlier date, even one only a day earlier.

Current (-c), minimum (-m), and maximum dates must be real YYYY-MM-DD calendar dates. Invalid input is rejected before login. The minimum and maximum are inclusive; a candidate must always be earlier than the current booking.

MAX_DATE / --max is only a ceiling. It does not change after booking and does not enable monthly step-down, including on accounts without a reschedule limit. It expires after the maximum date ends in the computer's local timezone, not at UTC midnight.

Enable --month-step-down separately to require at least one calendar month of improvement before the first booking and after every confirmed booking. It keeps the same day in the previous month, clamped to that month's last day: March 1 becomes February 1, March 31 becomes February 28 (29 in a leap year), and November 20 becomes October 20. When combined with --max, the earlier ceiling wins. The effective ceiling survives retry/re-login restarts.

Before any real POST, the bot must be able to read the existing appointment so it can compare the outcome. After submission:

  • A matching new appointment date confirms success.
  • If the appointment is exactly unchanged and the remaining-attempt count is unchanged, monitoring continues, but another booking POST waits at least five minutes. The same applies when both reads identify the recognized no-counter scheduling form. The POST backoff survives retry/re-login restarts; availability polling continues.
  • A missing or unreadable counter is not treated as an unlimited account. Only a complete recognized appointment form with no remaining-attempt warning establishes the no-counter flow.
  • An unreadable or unexpected appointment, changed limit state, failed POST, or unreadable POST response stops the bot when the outcome is uncertain. Check the site before restarting.
  • Failure to save the diagnostic HTML is logged, but verification still runs. A local file error alone cannot turn a confirmed booking into a retry.

Confirmation layout support

The confirmation flow currently expects the English group-page link (a[href*="/groups/"]) and appointment element (.consular-appt). Live evidence so far is limited to the Brazilian group layout described in the PR; offline fixtures do not establish support for other countries or account layouts. If the existing appointment cannot be read, the bot stops before submitting a booking. Do not remove that guard or guess a successful outcome when markup is missing. Other layouts need sanitized representative HTML and regression tests before claiming support.

Rate Limiting (Soft Ban)

The site has no published rate limit, but too many requests or logins in a short time get the account temporarily throttled ("soft ban"):

  • Symptom: the date list comes back empty (no dates available) even though dates existed minutes before. In the browser, the reschedule page shows a red message saying there are no appointments at the selected location or the system is busy (in Portuguese: "Não há agendamentos disponíveis no local selecionado ou o sistema está ocupado"). The account itself is not locked, and you can still log in.
  • Cause: every run of the bot (including --dry-run) and every debugging script logs in again, and manual page refreshes also count. In our case, about 8 logins within 10 minutes (several dry runs and debugging scripts) triggered it right away. Polling alone also adds up: community reports mention empty lists after ~48 requests, or after ~3 hours of polling every 60 seconds.
  • Duration: there is no official policy. Community reports consistently mention about 5 hours. Some tools simply sleep 5 hours when the list is empty, others retry after 1 hour.
  • What to do: stop the bot (Ctrl+C), do not keep refreshing the site, open the reschedule page once after a few hours, and restart the bot only when dates show up again. Polling through the ban returns nothing and may extend it.
  • Prevention: do not run several dry runs, restarts or debugging scripts back to back; test once and leave it running. Prefer a longer REFRESH_DELAY: a steady, slower poll over the whole day catches more cancellations than a fast burst followed by hours of soft ban.

Sources (community reports, not official): gist comments on ban length and intervals, uxDaniel/visa_rescheduler#76, zangjiucheng/us_visa_scheduler.

How It Behaves

The bot will:

  1. Log in to your account using provided credentials
  2. Check for available dates every few seconds
  3. Compare found dates against your constraints:
    • Must be earlier than current date (-c)
    • Must be after minimum date (-m) if specified
    • Must be before maximum date (--max / MAX_DATE) if specified
    • Will exit successfully if target date (-t) is reached
  4. Find an ASC slot for the chosen interview slot when ASC_FACILITY_ID is set, trying the returned ASC days until a time is found (no ASC slot, no booking)
  5. Book the appointment the same way the site does: confirm the scheduling limit warning, select every applicant of a group schedule, then submit
  6. Continue monitoring until target is reached or manually stopped

Output Examples

[2023-07-16T10:30:00.000Z] Initializing with current date 2023-08-15
[2023-07-16T10:30:00.000Z] Max date: 2023-07-31
[2023-07-16T10:30:00.000Z] Target date: 2023-07-01
[2023-07-16T10:30:01.000Z] Logging in
[2023-07-16T10:30:03.000Z] date 2023-09-01 is further than already booked (2023-08-15)
[2023-07-16T10:30:03.000Z] no good dates found after filtering
[2023-07-16T10:30:06.000Z] found 1 good dates: 2023-07-15, using earliest: 2023-07-15
[2023-07-16T10:30:06.000Z] booking 2023-07-15 09:00 + ASC 2023-07-10 08:30
[2023-07-16T10:30:07.000Z] group schedule, selecting applicants: 111, 222
[2023-07-16T10:30:08.000Z] booked 2023-07-15 09:00 + ASC 2023-07-10 08:30
[2023-07-16T10:30:08.000Z] Target date reached! Successfully booked appointment on 2023-07-15

Safety Features

  • ✅ Read-only until booking - Only books when better dates are found
  • ✅ Respects constraints - Won't book outside your specified date range
  • ✅ Keeps your ASC appointment - Never submits without an ASC slot when ASC_FACILITY_ID is set
  • ✅ Verified bookings - Stops if the site does not confirm a booking, instead of retrying blindly
  • ✅ POST backoff - Proven unchanged rejections wait at least five minutes before another booking submission
  • ✅ Graceful exit - Stops automatically when target is reached
  • ✅ Error recovery - Automatically retries on network errors
  • ✅ Secure credentials - Uses environment variables for sensitive data

Testing

npm test

The tests run offline against stubbed clients and HTTP fixtures, with unmocked requests blocked. Date/time boundary tests use controlled clocks and timezones; no real appointments or credentials are needed.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run the checks in CONTRIBUTING.md
  5. Submit a pull request

License

This project is licensed under the PolyForm Noncommercial License 1.0.0.

Commercial use is not permitted. You may use, modify, and distribute this software for noncommercial purposes — personal use, research, education, and use by nonprofit and government organizations. Selling it, offering it as a paid service, or using it as part of a commercial offering requires a separate license. Contact the copyright holder to discuss commercial terms.

Disclaimer

This bot is for educational purposes. Use responsibly and in accordance with the terms of service of the visa appointment system. The authors are not responsible for any misuse or consequences.

探索相关项目

加载中…