Open mohitj1983 opened 3 years ago
Hi @mohitj1983 I am also seeing the same behaviour. Telegram channel from under45.in is showing slot availability which my API calls is completely missing.
I doubt that they (under45.in telegram channel) are using non-public endpoint.
However, would like to learn what is the reason exactly... I am aware that public API is cached for 30 mins, but the question is
... which my API calls are completely missing.
Have you tried contrasting the responses of protected and private APIs?
Hi @mohitj1983 I am also seeing the same behaviour. Telegram channel from under45.in is showing slot availability which my API calls is completely missing.
I doubt that they (under45.in telegram channel) are using non-public endpoint.
However, would like to learn what is the reason exactly... I am aware that public API is cached for 30 mins, but the question is
- is it cached universally? (i.e., for everyone)
- is it cached for each IP?
- is it cached for each request type? (district, pincode, etc... separately)
It's not cached for 30 minutes, my code is working completely fine
It's not cached for 30 minutes, my code is working completely fine
There are two way to identify if it is cached or not.
Read the documentation. https://apisetu.gov.in/public/marketplace/api/cowin/cowin-public-v2#/ here it is clearly written that public APIs are cached and could be 30 mins old.
Hit API and get availability for a centre. API is returning doses available while cowin site is showing all is booked out. Hence, it could be inferred that APIs are not seeing real-time data.
... which my API calls are completely missing.
Have you tried contrasting the responses of protected and private APIs?
I will need to make a comparison for this... will share my findings if I can do so
... which my API calls are completely missing.
Have you tried contrasting the responses of protected and private APIs?
I have tried comparing both... hitting public as well as protected APIs, both of them are returning same data. I am not sure about caching behaviour in both of them as I would need larger sample to compare.
Public end-point used:
/v2/appointment/sessions/public/calendarByDistrict
Private end-point used:
/v2/appointment/sessions/calendarByDistrict
I think the behaviour of Private end-point would change if authenticated via OTP and bearer token is supplied.
I would need larger sample to compare.
I agree.
I think the behaviour of Private end-point would change if authenticated via OTP and bearer token is supplied.
I'm not sure about that, but that can happen. But one thing for certain, I have observed differences between the response from the public and protected (with bearer token) in the past.
... which my API calls are completely missing.
Have you tried contrasting the responses of protected and private APIs?
I will need to make a comparison for this... will share my findings if I can do so
Check out my repo for CoWin tracker it opens chrome as soon as vaccine is available and I just have to login for every 15 mins. I know that API setu says data MAYBE CACHED UPTO 30 minutes but that is nothing to do with vaccine availability because it totally runs on Dynamic Database
... which my API calls are completely missing.
Have you tried contrasting the responses of protected and private APIs?
I have tried comparing both... hitting public as well as protected APIs, both of them are returning same data. I am not sure about caching behaviour in both of them as I would need larger sample to compare.
Public end-point used:
/v2/appointment/sessions/public/calendarByDistrict
Private end-point used:
/v2/appointment/sessions/calendarByDistrict
I think the behaviour of Private end-point would change if authenticated via OTP and bearer token is supplied.
Can you share your code by hiding your private information? Can you please check if the generate otp API function is working or not? Some say it has stopped responding.
i thoroughly checked and the findbydistrict is a real time endpoint.
... which my API calls are completely missing.
Have you tried contrasting the responses of protected and private APIs?
I have tried comparing both... hitting public as well as protected APIs, both of them are returning same data. I am not sure about caching behaviour in both of them as I would need larger sample to compare. Public end-point used:
/v2/appointment/sessions/public/calendarByDistrict
Private end-point used:/v2/appointment/sessions/calendarByDistrict
I think the behaviour of Private end-point would change if authenticated via OTP and bearer token is supplied.Can you share your code by hiding your private information? Can you please check if the generate otp API function is working or not? Some say it has stopped responding.
GenerateOTP and Validateotp endpoint is working absolutely fine
I would need larger sample to compare.
I agree.
I think the behaviour of Private end-point would change if authenticated via OTP and bearer token is supplied.
I'm not sure about that, but that can happen. But one thing for certain, I have observed differences between the response from the public and protected (with bearer token) in the past.
The best is to use unauthenticated findbydistrict api.
... which my API calls are completely missing.
Have you tried contrasting the responses of protected and private APIs?
I have tried comparing both... hitting public as well as protected APIs, both of them are returning same data. I am not sure about caching behaviour in both of them as I would need larger sample to compare. Public end-point used:
/v2/appointment/sessions/public/calendarByDistrict
Private end-point used:/v2/appointment/sessions/calendarByDistrict
I think the behaviour of Private end-point would change if authenticated via OTP and bearer token is supplied.Can you share your code by hiding your private information? Can you please check if the generate otp API function is working or not? Some say it has stopped responding.
GenerateOTP and Validateotp endpoint is working absolutely fine
can you share the code to authenticate a user using otp? I am getting an error 404 in my python script. when i try to send request to generateotp in protectedAPI
@here, do calendarByPin/calendarByDistrict public APIs return cached response? In my script, I keep getting slots information but as soon as I go to the portal to book the slot, it says all are booked.
would the behaviour be different if a user gets authenticated?
@here, do calendarByPin/calendarByDistrict public APIs return cached response? In my script, I keep getting slots information but as soon as I go to the portal to book the slot, it says all are booked.
would the behaviour be different if a user gets authenticated?
Please share screenshot of Response, I will check with CoWin Dev Team
Hi, I am not able to get the private API to work on the website try out
section. I use the test key provided in the docs to hit the test server, but I am not sure how I can get the bearer token. Also, I tried to run the OTP thing, but it gives me Failed to fetch data
.
@siddhesh1770 I am facing a weird issue with the calendarByDistrict
public API.
I am trying to get the data for May 1, Mumbai, but it shows only 2 centers.
However, as per the official tweet, there was supposedly 5 centers where vaccinations happened. Is the data via public API partial or something?
@siddhesh1770 I am facing a weird issue with the
calendarByDistrict
public API.I am trying to get the data for May 1, Mumbai, but it shows only 2 centers.
However, as per the official tweet, there was supposedly 5 centers where vaccinations happened. Is the data via public API partial or something?
May be BMC failed to update that particular CVC slot availability. Slots of vaccinations are updated by local government authorities or private hospitals according to their stock which is allotted by State Gov. Cowin is just portal for booking the same.
Hi, I am not able to get the private API to work on the website
try out
section. I use the test key provided in the docs to hit the test server, but I am not sure how I can get the bearer token. Also, I tried to run the OTP thing, but it gives meFailed to fetch data
.
Test Server is currently down for a while.
@siddhesh1770 I am facing a weird issue with the
calendarByDistrict
public API. I am trying to get the data for May 1, Mumbai, but it shows only 2 centers. However, as per the official tweet, there was supposedly 5 centers where vaccinations happened. Is the data via public API partial or something?May be BMC failed to update that particular CVC slot availability. Slots of vaccinations are updated by local government authorities or private hospitals according to their stock which is allotted by State Gov. Cowin is just portal for booking the same.
Possibly, although it is super weird that I have seen this for Delhi and Bangalore too. Some centres that people said they booked via COWIN portal, don't show up in the data for that day!
@here, do calendarByPin/calendarByDistrict public APIs return cached response? In my script, I keep getting slots information but as soon as I go to the portal to book the slot, it says all are booked. would the behaviour be different if a user gets authenticated?
Please share screenshot of Response, I will check with CoWin Dev Team
@siddhesh1770 Please take a look at the screenshot, I am getting notifications just now and when I went there to book a slot, it says it is booked but still notifications are coming.
@here, do calendarByPin/calendarByDistrict public APIs return cached response? In my script, I keep getting slots information but as soon as I go to the portal to book the slot, it says all are booked. would the behaviour be different if a user gets authenticated?
Please share screenshot of Response, I will check with CoWin Dev Team
@siddhesh1770 Please take a look at the screenshot, I am getting notifications just now and when I went there to book a slot, it says it is booked but still notifications are coming.
Please Confirm that you are filtering out dose 1 availability from response you are getting using API, so that I can look into this.
@here, do calendarByPin/calendarByDistrict public APIs return cached response? In my script, I keep getting slots information but as soon as I go to the portal to book the slot, it says all are booked. would the behaviour be different if a user gets authenticated?
Please share screenshot of Response, I will check with CoWin Dev Team
@siddhesh1770 Please take a look at the screenshot, I am getting notifications just now and when I went there to book a slot, it says it is booked but still notifications are coming.
Please Confirm that you are filtering out dose 1 availability from response you are getting using API, so that I can look into this.
Yes. and one more thing, here we could say that we only get 1 slot so it could be possible it got filled before I log in but today morning I got 18 slots from API and I could see in the next 20 min they got decreased gradually from API response but on the UI it was showing all booked through out 20 mins.
@here, do calendarByPin/calendarByDistrict public APIs return cached response? In my script, I keep getting slots information but as soon as I go to the portal to book the slot, it says all are booked. would the behaviour be different if a user gets authenticated?
Please share screenshot of Response, I will check with CoWin Dev Team
@siddhesh1770 Please take a look at the screenshot, I am getting notifications just now and when I went there to book a slot, it says it is booked but still notifications are coming.
Please Confirm that you are filtering out dose 1 availability from response you are getting using API, so that I can look into this.
Yes. and one more thing, here we could say that we only get 1 slot so it could be possible it got filled before I log in but today morning I got 18 slots from API and I could see in the next 20 min they got decreased gradually from API response but on the UI it was showing all booked through out 20 mins.
@siddhesh1770,
@mukultaneja instead of calenderbydistrict use this endpoint, https://cdn-api.co-vin.in/api/v2/appointment/sessions/public/findByDistrict
It returns data only when slots are open, It gives accurate data, It is faster than Co-win app because they are using calenderbydistrict endpoints which are heavily cached.
Are the responses to findByDistrict API being cached? I see that telegram is sending notifications for centres which my code is unable to identify. Im invoking my code every 6 seconds