Got an 'API Error' from Wikipedia API

Kevin_Deng

Junior Member
Joined
Sep 29, 2021
Messages
105
Reaction score
34
I want to get data from Wikipedia API by Python, this is my code:
result = wikipedia.summary(kw,sentences=10)

At first, it works very well, but when i tried too many times, I got the error message as follows:
HTTPSConnectionPool(host='en.wikipedia.org', port=443): Max retries exceeded with url: /w/api.php?list=search&srprop=&srlimit=1&limit=1&srsearch=twotooth+achyranthes+root&srinfo=suggestion&format=json&action=query (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)'),))

Does sb know how to solve this problem?
or any better solution?
Thanks.
 
I want to get data from Wikipedia API by Python, this is my code:


At first, it works very well, but when i tried too many times, I got the error message as follows:


Does sb know how to solve this problem?
or any better solution?
Thanks.
Try this (assuming you are using requests.. If not, tell us what you are using)..

Code:
https://stackoverflow.com/a/15445989/1437261

Basically, turn certificate verification off and you should be fine.

If you still get error, it's something else. You have probably reached the api rate limit or something.
 
Back
Top