theoomoregbee / US-visa-appointment-notifier

This is just a script I put together to check and notify me via email (MailGun) when there's an earlier date before my initial appointment date. It doesn't handle rescheduling.
MIT License
104 stars 57 forks source link

After 100 or so api calls, api start sending empty list #23

Closed bhavik4748 closed 1 year ago

bhavik4748 commented 1 year ago

Your code works great, but after few api calls (like 100 or so) api start sending empty list. I believe there this rate limiter per account on https://ais.usvisa-info.com/en-ca/, any idea how can we over come that?

sulidin commented 1 year ago

I had the same issue. It's been a day but I am still not able to see open days. My wife's account can see open days but apparently mine is blocked. "There are no available appointments at the selected location. Please try again later."

sulidin commented 1 year ago

Okay system locks after 60 tries in 5 hours. So you need to change the code abit. Set a new counter to 59 and put await for 5 hours before next try.

groverjatin17 commented 1 year ago

Okay system locks after 60 tries in 5 hours. So you need to change the code abit. Set a new counter to 59 and put await for 5 hours before next try.

Hi @sulidin , I have waited longer than 5 hours(8 hours) but I am still getting empty array list. Would you know starting when I will be able to get data in arrays?

vicdup commented 1 year ago

Same question here, do we know what the rate limit is and how long we get blocked?

bhavik4748 commented 1 year ago

I initially tried and was making 70 or so calls using this api but it didn't help much as manually people were very active, before you get an email someone would have already taken that appointment. So I joined some other telegram groups where the agents were posting the appointment availability(via their bots) so I got the date using that and have stopped working on this one.

bhavik4748 commented 1 year ago

Am closing this issue as not much can be done here due to api rate limiting.

bhavik4748 commented 1 year ago

5-6 hours and you can ask Customer care.

bhavik4748 commented 1 year ago

Sometime Customer care was able to see dates so they can select appointments on phone for you

groverjatin17 commented 1 year ago

I initially tried and was making 70 or so calls using this api but it didn't help much as manually people were very active, before you get an email someone would have already taken that appointment. So I joined some other telegram groups where the agents were posting the appointment availability(via their bots) so I got the date using that and have stopped working on this one.

Hi Bhavik, I have been trying to get an appointment since last 2 months but to no avail. Would you be kind enough in sharing that telegram link please?

I can share my email address with you. groverjatin17ca@gmail.com

Kindly help 🙏

naxer-12 commented 1 year ago

Yes @bhavik4748 it will be very helpful if you can share telegram link and was customer service books date for you ? what did you ask?

bhavik4748 commented 1 year ago

https://t.me/contact_akki

https://t.me/+SGN5yCPZjb8zNjU1

image

jorgevaldivia commented 11 months ago

I know this issue is closed because not much can be done about the rate limiting, but I do think it's a good opportunity to share what everyone is seeing regarding rate limiting as it seems change over time or based on use.

I personally don't use the code in this repo, but I did write my own script which implements similar tactics with a few improvements (at least in my mind). I began running my script around 15 months ago and have strictly used it for friends and family, less than 10 total, so I don't have a great sample size.

Here's what my experience has been:

Originally I ran into the same issues that others report here, you hit the endpoint a certain number of times within a certain time window and the endpoint begins returning a 200 response but with an empty array, essentially a soft rate limit. The rate limit is based on the account (or maybe the schedule) as you can replicate this across different IPs as well as by logging in through the UI and checking the calendar (which becomes unavailable for the same time frame). The block isn't absolute, and is solely related to when you check, so 2 scripts that begin checking at different times would be blocked at different times.

With the pinging schedule that I implement I can hit the endpoint about for around 4 hours before being blocked for 5 hours. I never felt the need to improve on this as I had enough success, usually being able to get an appointment within a few weeks for ~1-3 months out.

After a few months of running the script I felt I had enough data to start looking for patterns. I noticed that there were certain times where good appointments appeared more often, and others where appointments never appeared. I modified my script's schedule to only check during these good windows. Initially I had great success, and I no longer had to worry about being blocked as I was checking far fewer times during the day.

All good, right? Well eventually I think someone caught on as I was now rate-limited for 90% of the day. I gave up on this improved schedule and reverted to my original one (checking all day, enduring blocks, etc) and within 1-2 days everything went back to normal. This was around May-June of this year.

After about 2 months of not running the script due to lack of need I started running it again in September, but I started seeing much more strict rate-limiting. Instead of being rate-limited for 5 hours, I'm now rate-limited for about 20 hours.

I plan on trying different strategies to adapt to these new rate limit rules, but I am curious what everyone else's experience is and I have a few specific questions: