cowinapi / developer.cowin

This group is created to facilitate technical and integration discussions related to cowin platform. API related contents can be obtained at API setu portal https://apisetu.gov.in/public/marketplace/api/cowin
115 stars 30 forks source link

Api calls from local works fine, but not from remote server(hosted in bangalore) #154

Open pawanjenu opened 3 years ago

pawanjenu commented 3 years ago

I am trying to access public API's when I try to make a curl call from my local PC(my location is Bangalore) I get a response, but when I try to make a curl call from a remote instance(DigitalOcean Bangalore location), I get 403 forbidden, I am adding headers and checked all possible ways but not able to get it working, are digitalocean it's blocked? image cc: @wittyPuneet

rudrasura commented 3 years ago

Tried with Heroku Application dynamo in US region. CoWin APIs blocks this. Used AWS Ec2 Instance on India Region, works fine.

pawanjenu commented 3 years ago

Tried with Heroku Application dynamo in US region. CoWin APIs blocks this. Used AWS Ec2 Instance on India Region, works fine.

so does that mean, IP's of DigitalOcean is blocked for some reason?

rudrasura commented 3 years ago

Probably yes. Try using AWS instance on India Region. Worked well for me. Also I did asked my friends in US to directly access the COWIN get API for district, it gave them 403 as well!

pawanjenu commented 3 years ago

Probably yes. Try using AWS instance on India Region. Worked well for me. Also I did asked my friends in US to directly access the COWIN get API for district, it gave them 403 as well!

is there a way to quickly check with AWS without paying anything lol?

rudrasura commented 3 years ago

Yeah! Use it in your free tier account ! AWS is free for 1 year. Follow this approach: Spring Boot on AWS EC2

pawanjenu commented 3 years ago

@KBA07 VPN of Indian location?

KBA07 commented 3 years ago

@KBA07 VPN of Indian location?

Nevermind, Didn't read the question carefully.

Btw, Did you try to get the digital ocean ip manually and check it's location ?

pawanjenu commented 3 years ago

@KBA07 VPN of Indian location?

Nevermind, Didn't read the question carefully.

Btw, Did you try to get the digital ocean ip manually and check it's location ?

Yes, its showing as Bangalore location

kartikeyas00 commented 3 years ago

I had similar problems yesterday with the digital ocean Bangalore server and then it started to work fine. But it does in the middle sometimes have a problem accessing the API, like it is pretty slow sometimes

rohitashwachaks commented 3 years ago

Now its not working for my Azure Function hosted in IndiaCentral either :/

Raxy45 commented 3 years ago

Anyone got any leads on how to solve this IP address issue ?!

saran-surya commented 3 years ago

Hi @pawanjenu If you are using a NODE JS app, you can try this package CASSTA to proxy your server to your current location, I have tested this on HEROKU with an US server for this API.

https://github.com/saran-surya/cassata

anmolkhemuka commented 3 years ago

Yeah! Use it in your free tier account ! AWS is free for 1 year. Follow this approach: Spring Boot on AWS EC2

Any advice if we consume all the free monthly quota given in AWS free trial. Actually, I am managing 4-5 telegram groups and each of them running on different servers due to API call limit . So I am very near to exhaust the free monthly hours.

pawanjenu commented 3 years ago

Yeah! Use it in your free tier account ! AWS is free for 1 year. Follow this approach: Spring Boot on AWS EC2

Any advice if we consume all the free monthly quota given in AWS free trial. Actually, I am managing 4-5 telegram groups and each of them running on different servers due to API call limit . So I am very near to exhaust the free monthly hours.

how frequently are you polling data ?

pawanjenu commented 3 years ago

Yeah! Use it in your free tier account ! AWS is free for 1 year. Follow this approach: Spring Boot on AWS EC2

Any advice if we consume all the free monthly quota given in AWS free trial. Actually, I am managing 4-5 telegram groups and each of them running on different servers due to API call limit . So I am very near to exhaust the free monthly hours.

thanks, I switched to Linode server, its working fine as of now

pawanjenu commented 3 years ago

Yeah! Use it in your free tier account ! AWS is free for 1 year. Follow this approach: Spring Boot on AWS EC2

Any advice if we consume all the free monthly quota given in AWS free trial. Actually, I am managing 4-5 telegram groups and each of them running on different servers due to API call limit . So I am very near to exhaust the free monthly hours.

the issue with using a proxy is that it will take a lot of time to get data from Cowin API, and are not reliable, always, but thanks for the suggestion

anmolkhemuka commented 3 years ago

Yeah! Use it in your free tier account ! AWS is free for 1 year. Follow this approach: Spring Boot on AWS EC2

Any advice if we consume all the free monthly quota given in AWS free trial. Actually, I am managing 4-5 telegram groups and each of them running on different servers due to the API call limit. So I am very near to exhaust the free monthly hours.

how frequently are you polling data?

Sir, I am making only 6 API requests in 1 minute i.e. 30 in 5 minutes, which is less than the given limit(100 API per 5min) but the thing is the script is running 24x7(since the timing of slots in my region has no fixed pattern), and I have no idea how I am going to manage once the free monthly hours of Amazon EC2 get finished.

pawanjenu commented 3 years ago

Yeah! Use it in your free tier account ! AWS is free for 1 year. Follow this approach: Spring Boot on AWS EC2

Any advice if we consume all the free monthly quota given in AWS free trial. Actually, I am managing 4-5 telegram groups and each of them running on different servers due to the API call limit. So I am very near to exhaust the free monthly hours.

how frequently are you polling data?

Sir, I am making only 6 API requests in 1 minute i.e. 30 in 5 minutes, which is less than the given limit(100 API per 5min) but the thing is the script is running 24x7(since the timing of slots in my region has no fixed pattern), and I have no idea how I am going to manage once the free monthly hours of Amazon EC2 get finished.

try linode server

priyankay27 commented 3 years ago

Tried with Heroku Application dynamo in US region. CoWin APIs blocks this. Used AWS Ec2 Instance on India Region, works fine.

I am using "asia-south1" which is a Mumbai Google server on Firebase. Still 403 error!!??

pawanjenu commented 3 years ago

Tried with Heroku Application dynamo in US region. CoWin APIs blocks this. Used AWS Ec2 Instance on India Region, works fine.

I am using "asia-south1" which is a Mumbai Google server on Firebase. Still 403 error!!??

Yeahh, many servers are blocked as of now, linode and aws are working, You can do one thing to verify, There is a 10% chance that all your requests are going via a VPN or something, basically your requests are being made by non-indian IP, so if you can verify what's the IP when a request is made, That would be helpful

priyankay27 commented 3 years ago

Tried with Heroku Application dynamo in US region. CoWin APIs blocks this. Used AWS Ec2 Instance on India Region, works fine.

I am using "asia-south1" which is a Mumbai Google server on Firebase. Still 403 error!!??

Yeahh, many servers are blocked as of now, linode and aws are working, You can do one thing to verify, There is a 10% chance that all your requests are going via a VPN or something, basically your requests are being made by non-indian IP, so if you can verify what's the IP when a request is made, That would be helpful

The "callerIP" while making the request is 103.99.199.38 which is of Delhi, India.

aashimgarg commented 3 years ago

Hi @pawanjenu If you are using a NODE JS app, you can try this package CASSTA to proxy your server to your current location, I have tested this on HEROKU with an US server for this API.

https://github.com/saran-surya/cassata

is this working fine ?

pawanjenu commented 3 years ago

Hi @pawanjenu If you are using a NODE JS app, you can try this package CASSTA to proxy your server to your current location, I have tested this on HEROKU with an US server for this API. https://github.com/saran-surya/cassata

is this working fine ?

Sorry but I switched to linode server and am not using node js

saran-surya commented 3 years ago

Hi @pawanjenu If you are using a NODE JS app, you can try this package CASSTA to proxy your server to your current location, I have tested this on HEROKU with an US server for this API. https://github.com/saran-surya/cassata

is this working fine ?

Hi @aashimgarg , the package is stable and you can use it, Kindly check them here. https://github.com/saran-surya/cassata 🦄

pawanjenu commented 3 years ago

Tried with Heroku Application dynamo in US region. CoWin APIs blocks this. Used AWS Ec2 Instance on India Region, works fine.

I am using "asia-south1" which is a Mumbai Google server on Firebase. Still 403 error!!??

Yeahh, many servers are blocked as of now, linode and aws are working, You can do one thing to verify, There is a 10% chance that all your requests are going via a VPN or something, basically your requests are being made by non-indian IP, so if you can verify what's the IP when a request is made, That would be helpful

The "callerIP" while making the request is 103.99.199.38 which is of Delhi, India.

So you have 2 options, trying using different clients machine or use proxy servers

Yuvraj102 commented 3 years ago

@KBA07 VPN of Indian location?

Nevermind, Didn't read the question carefully.

Btw, Did you try to get the digital ocean ip manually and check it's location ?

I am trying from India from my local machine using nodejs (axios package) to make a post request to auth API's but docent work , Actually works fine with Postman but doesn't work via nodejs , dont know why any idea ?

Yuvraj102 commented 3 years ago

Hi @pawanjenu If you are using a NODE JS app, you can try this package CASSTA to proxy your server to your current location, I have tested this on HEROKU with an US server for this API. https://github.com/saran-surya/cassata

is this working fine ?

https://github.com/cowinapi/developer.cowin/issues/154#issuecomment-868417428

saran-surya commented 3 years ago

Hi @pawanjenu If you are using a NODE JS app, you can try this package CASSTA to proxy your server to your current location, I have tested this on HEROKU with an US server for this API. https://github.com/saran-surya/cassata

is this working fine ?

#154 (comment)

Hi @Yuvraj102 , I have a server that does access the data, And yes using the package the server works fine, If you wish maybe I can create a new end point and give you for the API you need. ?