Skip to content

How to check if an API is actually usable before you build on it

By William · · updated · 6 min read

A closed laptop on a wooden desk next to a notebook and a pen
AI-generated image.

You verify an API by sending real requests to its free tier or sandbox, reading the rate-limit headers, and checking how it handles errors before you commit a sprint to it. The ranking pages define API testing and list tools. This article gives a pre-build checklist: the exact headers to read for rate limits (X-RateLimit-Limit, X-RateLimit-Remaining, Retry-After), the specific error code (429) to look for, and the terms you must know before you start, so you can rule an API out before it costs you a sprint.

Key takeaways

  • Verify an API by sending real requests to its free tier or sandbox before committing a sprint to it.
  • Read the X-RateLimit-Limit, X-RateLimit-Remaining, and Retry-After headers to find the true rate limits.
  • Trigger a 429 response to see if the API provides clear error messages and a Retry-After header.
  • Check the API's versioning policy and changelog to ensure new releases will not break your integration.
  • If an API does not offer a sandbox or free tier, it is asking you to trust it blindly.

Why a pre-build check saves a sprint

Picking the wrong API can cost your team a sprint. The worst ones send engineers down a rabbit hole on an API that turns out to have an undocumented rate limit [1]. API testing is a process that confirms an API is working as expected [1]. API testing occurs during development to help teams catch issues before they reach production [1]. The point of a pre-build check is not to write a full test suite. It is to answer one question: can this API do the job I need, reliably, within the limits I can live with? If the answer is no, you stop. If the answer is yes, you proceed with the knowledge that the failure modes are documented and the rate limits are real. This is different from API monitoring, which occurs after the API has been deployed to production [1]. You want to know about the problems before you deploy, not after.

The terms you must know before you start

Testers should be familiar with specific technical terms including API error codes, authentication, authorization, tokens, headers, path parameters, and query parameters before starting API testing [2]. An API functions as an entry point to a complex system that can trigger longer-running server-side business processes, not just simple data exchange [2]. Testing an API requires verifying requests, responses, data (often in JSON format), headers, and response codes without needing to test the user interface [2]. You do not need to be a senior engineer to run this check. You do need to know what a 401 means versus a 403, what a Bearer token is, and where the rate-limit information lives in the response headers. If you are not comfortable with these terms, spend an hour reading the API's documentation before you send a single request. The documentation is the contract. If you cannot read the contract, you cannot verify it.

Illustration: The terms you must know before you start

Set up a controlled test environment

Before running tests, teams must configure a controlled test environment including API endpoints, required data, and available backend systems [2]. API tests can be built as soon as the logic is designed, without waiting for UI components or downstream systems to be finished [3]. A suite of hundreds of API tests can execute in minutes, whereas the same volume of UI tests could take hours [3]. For a pre-build check, you do not need hundreds of tests. You need a handful of requests that cover the core use case. Set up a sandbox or free-tier account. Get an API key. Identify the two or three endpoints that matter for your use case. Send a request to each one. Look at the response. If the sandbox does not exist, that is a signal in itself. An API that does not offer a way to test it before you pay is asking you to trust it blindly.

Read the rate-limit headers, not the marketing page

A rate limit is a software technique used to control the rate of traffic sent or received by a network, system, or online service [3]. Rate limiting involves setting limits on the number of requests or actions that can be performed within a specific time period [3]. The X-RateLimit-Limit header indicates the total requests allowed in the time window [4]. The X-RateLimit-Remaining header indicates the requests left in the current window [5]. The Retry-After header tells the client how long to wait before sending another request [5]. Send a request to the API and look at the response headers. If the X-RateLimit-Limit header is missing, the rate limit is undocumented. If it is present, note the number. If your use case requires more requests per minute than the limit allows, the API is not usable for your product, no matter how good the documentation is. The marketing page will tell you "unlimited" or "generous." The headers tell you the truth.

Trigger the 429 and read the error handling

When a client exceeds the allowed threshold, the API rejects additional requests and typically returns a 429 Too Many Requests response [5]. Manual API testing using tools like Postman or Swagger involves sending a request, observing the response, and verifying the data [5]. API testing is the process of verifying that an API behaves as intended, including validating data, edge cases, failures, and performance [6]. To test error handling, send requests until you hit the rate limit. Look at the 429 response. Does it include a Retry-After header? Does the error message tell you what went wrong? Does the API return a clear error code for invalid input, or does it return a generic 500? An API that handles errors clearly is an API you can build on. An API that returns vague errors is an API that will cost you debugging time in production.

Check the contract so a new release does not break you

API contract testing checks the content and format of requests and responses to ensure new releases don't violate the contract [6]. API testing involves sending requests to endpoints and validating responses, which is faster and more focused than UI testing. Before you commit to an API, check whether it publishes a versioned contract or a changelog. If the API changes the format of a response without notice, your integration breaks. If the API deprecates an endpoint without a migration path, your integration breaks. A pre-build check includes reading the API's versioning policy. If the policy is "we will try to keep things stable," that is not a policy. If the policy is "we will maintain backward compatibility for 12 months and publish a changelog," that is a policy you can build on. If you are deciding between building your own integration and using a unified platform, the contract stability of the underlying APIs is a key factor in that decision.

Frequently asked questions

What is the main goal of a pre-build API check?

The goal is to answer whether the API can do the job reliably within your limits, so you can rule it out before it costs a sprint.

What should you do if the X-RateLimit-Limit header is missing?

If the header is missing, the rate limit is undocumented.

Why is a sandbox or free tier important?

A sandbox allows you to test the API before paying. If it does not exist, the API is asking you to trust it blindly.

What makes a versioning policy acceptable for building on?

An acceptable policy maintains backward compatibility for a set period and publishes a changelog, rather than just promising to keep things stable.

Sources

  1. What is API Testing? A Guide to Testing APIs Postman (postman.com)
  2. How do I start to test an API? – Discussions – The Club: Software Testing & Quality Engine (club.ministryoftesting.com)
  3. What is API Testing? SmartBear Learn (smartbear.com)
  4. Testing Best Practices in REST API Design Speakeasy (speakeasy.com)
  5. What is API Rate Limiting? Understanding Best Practices (blog.postman.com)
  6. What is rate limitation? What if limits are exceeded – PubNub (pubnub.com)

Related on this site

This article was drafted with AI assistance and checked before publication.

New guides by e-mail
Be told when a new guide is out.