Fact · Speech recognition
The docstring of SpeechRecognition's Google recognizer says it raises a RequestError when the recognition operation fails, when the key is not valid, or when there is no internet connection.
Checked against its source on October 17, 2026
In the source's own words
“if the key isn't valid, or if there is no internet connection.”
speech_recognition/recognizers/google.py (SpeechRecognition source code), Anthony Zhang (Uberi), GitHub, source code, n.d., Docstring of recognize_google, Raises section.
Open the original- What it measures
- A script that calls recognize_google can catch this error and report that the recognition request failed, rather than crash or return an empty result.
- What it does not show
- The docstring names three causes, and it does not say how often Google refuses requests from an unofficial client. Check the error text in your own tests.