One afternoon, every download on the site stopped working at once. There was no crash, no blank page and no error in my own logs. The provider simply answered every request with the same three words: 'Service is busy.'
My site is a small video downloader written in plain PHP on shared hosting. A visitor pastes a link, my resolve.php script sends it to a third-party API, the API returns the available formats, and my proxy streams the file back. The site this all runs on is ramrom.io, and at the time every platform - TikTok, Instagram, Facebook and YouTube - went through one single all-in-one provider. When that provider had a bad afternoon, the whole site went down with it. There was no fallback, because there was nothing to fall back to.
The first thing I learned was to read the body of the response, not just the status code. The provider was returning HTTP 200 with an error message tucked inside the JSON. My code only checked for a 200 and assumed success, so it tried to read formats that were not there and handed the visitor a confusing empty result. Now resolve.php checks the response body first. If the provider says it is busy, the code says so plainly instead of guessing.
The second thing I added was a retry loop with a pause between attempts. One call, wait two seconds, try again, wait four seconds, try a third time, then stop. Three attempts, then an honest message. Retrying forever would have burned through my free quota while the provider was down, and it would have kept visitors staring at a spinner. A bounded retry is the middle ground: short outages fix themselves, long ones fail fast and say why.
The honest message mattered more than I expected. Before, a failed download showed a generic error or nothing at all, and visitors assumed the site was broken. Now it says the service is busy and suggests trying again in a few minutes. That is not a fix, but it is the truth, and people accept the truth far more easily than silence. A tool that explains itself keeps visitors; a tool that spins forever loses them.
But retries and better messages were only a sticking plaster. The real problem was that one provider was a single point of failure for the whole site, so I split the work across providers. Facebook got its own dedicated API, YouTube got its own dedicated API, and the all-in-one provider kept TikTok and Instagram. If one of them has a bad afternoon now, only one platform goes quiet instead of all four. The cost stayed inside the free tiers, because each provider only handles its own share of the traffic.
Splitting providers added a new job, though: the three APIs return errors in three different shapes. One sends an error field, one sends a message field, one sends a status code with no words at all. So resolve.php now normalises every error into one shape before the page ever sees it. The visitor gets one plain sentence, and my log gets the provider name, the time and the raw error - nothing about the visitor, because there is nothing worth storing about them.
I also put a time limit on every provider call. Before that afternoon, a slow API could hold a request open until the page gave up, and a page that hangs feels worse than a page that fails. A fifteen-second timeout means the worst case is a quick, honest failure instead of a long, silent one.
The lesson was simple, and I should have seen it coming. A side project with one provider is a side project with one point of failure. Redundancy does not have to mean a second paid plan or a second server. For me it meant three free-tier APIs instead of one, a retry loop that knows when to stop, and an error message that tells the truth. The site still goes quiet sometimes - providers still have bad afternoons - but now it goes quiet one platform at a time, and it says why.


