Decide what to do
The full list of codes is in Errors.
A retry loop
Common cases
401 unauthorized: the key is missing or wrong. Check theAuthorization: Bearer <key>header.402 insufficientCredits: your balance is too low. Nothing was charged, and the error says how many credits the call needs and how many you have. Top up and try again.429 rateLimitedortooManyInFlight: you are over your rate limits. Wait, then retry.400 invalidRequest: the input is not valid. The message names the field, or repeats the source’s own complaint. Check the endpoint’s input in the API reference.404 notFound: the thing you asked for does not exist. The message is the source’s own, such asYouTube says: This video is unavailable. Don’t retry.