NullDev / qwant-api

:crystal_ball: Unofficial API wrapper for qwant
https://qwant.com
Apache License 2.0
32 stars 4 forks source link

How to deal with error 24? #4

Open simoniz0r opened 5 years ago

simoniz0r commented 5 years ago
24  Rate limit reached - IP Blocked until captcha is solved

How do I solve this captcha? Is there some API endpoint for this or?

geoffyuen commented 5 years ago

@simoniz0r Did you ever find a solution for this? If you wait a day or two can you use the api again?

Edit: Answering this myself... if you visit qwant.com and do a search it prompts you for a captcha.

n-o-kh commented 5 years ago

You can check the line in the code: https://github.com/NLDev/qwant-api/blob/master/lib/qwant-api.js#L52 and replace:

https://api.qwant.com/api/search/${keyword}?count=${count}&q=${query}&t=${query}&f=&offset=${offset}&locale=${lang}&uiv=4

with

http://api.scraperapi.com/?api_key=YOURAPIKEY&url=https://api.qwant.com/api/search/${keyword}?count=${count}&q=${query}&t=${query}&f=&offset=${offset}&locale=${lang}&uiv=4

You can register with scraperapi on the link below to bypass all the captcha issue (make sure you replace YOURAPIKEY with the api key you register with scraperapi.

There is a free version with 1000 calls per month or you can use the paid version: https://www.scraperapi.com/pricing?fp_ref=n_o_kh

simoniz0r commented 4 years ago

I've found a similar solution, but with 10,000 free uses per month at https://scrapestack.com

polyjitter commented 4 years ago

Is the ratelimit known?

HQuser commented 4 years ago

I've found a similar solution, but with 10,000 free uses per month at https://scrapestack.com

They now do not provide free HTTPS