5 Tips for Dealing with Unreliable Web APIs

A recent post on the Instavest Blog covered the topic of dealing with unreliable web APIs, such as ones that provide inconsistent error responses or suffer from reliability issues. The author offered these 5 tips to ease the pain for developers dealing with these kinds of APIs.

  1. Retry Loops – Since undocumented error responses should make up only a small percentage of requests, retrying the request twice could take success rate of requests from, for example, 90% up to 99.9%
  2. Thorough Logging – Keeping accurate and detailed records of the success or failure of every API request can speed up debugging and act as a trustworthy audit trail
  3. Set up Automatic Emails – An extension of the logging process, sending error reporting emails with diagnostics reports to tech support teams can help maintain third-party APIs that are non-critical, but may still be important from a UX perspective
  4. Use Error-Reporting Tools – Whether you are using third-party APIs or not, you should integrate some form of middleware that reports on unhandled exceptions, including frequency of instances and the users affected
  5. Track Response Latency and Warn Yourself Internally – Keeping a record of response latency can help you understand the reasons it might be happening. This data can be used to improve your processes, such as timing heavy data pulls to times where third-party APIs are more available.
Original Article

Working with unreliable web APIs

Martin W Brennan Martin W Brennan is a co-founder of ViewPop, the social network that puts the creation of 3D photos and videos in the hands of anyone with a smartphone. For his day job, Martin is a copywriting consultant at We Write Words, learning about the world as he writes about it.

Comments