What is API Abuse?
API abuse is misuse of a working API through bots, scraping, credential stuffing or sheer volume. Types, an example, detection and how to prevent it.
What is API abuse?
API abuse is the use of a working API in ways its owner did not intend: scraping, credential stuffing, bot-driven purchases or sheer volume. Nothing is broken. Every request can carry a valid token and get a 200 OK. The problem is who is calling, how often and why, and that only shows in the aggregate across many requests, accounts or IP addresses.
OWASP covers the business side as API6:2023 Unrestricted Access to Sensitive Business Flows.
API abuse vs API attacks and vulnerabilities
A vulnerability is a flaw in the API, such as a missing authorization check. An API attack exploits a flaw like that to break the system. Abuse is different: the abuser follows the documented contract, but at a scale or with an intent the business never wanted. Defending against flaws is covered in API security. Defending against abuse is about behavior and volume, not patching code, though abusers often probe for flaws as well.
Common types of API abuse
- Scraping: automated clients pull large volumes of prices, listings or profiles through public or authenticated endpoints.
- Credential stuffing: bots replay username and password pairs leaked elsewhere against a login endpoint. A low success rate still yields compromised accounts at that volume.
- Bot automation: scripts create fake accounts, post spam or claim promotions far faster than a person could.
- Limit evasion: rotating IP addresses, API keys or accounts to stay under per-client limits.
- Business-logic abuse: using a flow as designed for an unwanted outcome. OWASP's examples include buying most of a limited-stock product to resell it and automating fake sign-ups to collect referral credit.
- Payment and loyalty fraud: card testing through a payment endpoint, or guessing gift-card numbers.
- Denial of wallet: flooding a paid or expensive endpoint so the provider's bill grows, without taking the service down.
An example: the paid SMS endpoint
A password-reset endpoint sends an SMS through a provider that charges per message. A script calls it in a loop with different phone numbers. Each call returns a normal 200, latency looks fine and no error is logged, but the SMS bill climbs. OWASP uses this scenario for API4:2023 Unrestricted Resource Consumption. The fix is a limit per phone number and per client on that endpoint, plus a spending cap or billing alert with the provider.
How to detect API abuse
Single requests look legitimate, so detection compares behavior with a baseline.
- Volume and velocity: requests per account, key and IP over time, and many accounts sharing one device fingerprint.
- Behavior: people pause and vary. Bots show machine-speed timing and identical sequences.
- Traffic mix: a login or reset endpoint with many times its usual volume, or a sudden shift in geography or user agent.
- Monitoring: API monitoring keeps a history of response time and errors, so a gradual slowdown shows on the charts. LoadFocus API monitoring checks status code, response body, headers and response time (free checks every 5 minutes). It does not detect or block abuse itself, so pair it with logs and a WAF or bot tool.
How to prevent API abuse
- Strong authentication: short-lived tokens, multi-factor authentication on login, and careful handling of API keys, which are easy to share and harvest.
- Rate limits and quotas: per user, per key and per IP, designed so that rotating one of them does not reset everything. How clients should behave on a 429 is covered in avoiding API rate limiting.
- Bot management: fingerprinting, human-detection challenges and reputation scoring. OWASP lists device fingerprinting, CAPTCHA and detection of actions faster than a human could. Apply friction to suspicious sessions only.
- Business-flow limits: purchase caps per account, velocity limits on rewards and checkout.
- Spending limits: caps or billing alerts for every paid third-party integration.
- Test the limits under load: a rate limit is only proven when requests actually hit it. A cloud load test shows whether throttling triggers at the intended rate and whether the API degrades gracefully under a burst.
Common mistakes
- Limiting only by IP. Abusers spread requests over many addresses. Combine it with account and key limits.
- Protecting login but not the neighbors. Password reset, OTP and sign-up endpoints are abused just as often.
- Reading 200 as healthy. A flood of valid-looking calls looks like success on a status dashboard.
- Challenging everyone. CAPTCHA on every request punishes real users. Reserve it for suspicious traffic.
- Never testing the limits. A rule that has not been hit under load is an assumption.
FAQ about API abuse
Is API abuse the same as an API attack?
No. An API attack exploits a flaw to break the system. API abuse misuses functionality that works as designed, using automation, stolen credentials or excessive volume to extract value the business never meant to give away.
How is API abuse different from a DDoS attack?
A DDoS tries to knock a service offline. API abuse usually wants the service to stay up so it can keep extracting value, and it is often slow and quiet to stay under detection thresholds. For flood attacks, see how to stop DDoS attacks.
Can rate limiting alone stop API abuse?
No. Abusers rotate IP addresses, keys and accounts to stay under per-client limits. Rate limiting works as one layer next to authentication, bot management, behavioral analysis and limits on business flows.
What is denial of wallet?
Abuse aimed at cost instead of availability. On usage-based APIs, an attacker triggers paid or expensive operations, such as SMS or compute calls, so the provider's bill grows while the service stays up.
How does LoadFocus help with API abuse?
LoadFocus does not block abuse. API monitoring keeps a history of response time and status so slowdowns show up, and load testing with k6 or JMeter lets you check that your rate limits and throttling hold under heavy traffic.
Related terms
- What is API Access? Keys, OAuth and Tokens
- What is API Caching? Headers, Layers and Invalidation
- API Deprecation: Definition, Best Practices, Examples
- What is API Discovery? Definition and Methods
- API-First Approach: Definition, Workflow and Pitfalls
- What is an API Marketplace?
- What is API Mocking? Tools, Use Cases, Examples
- What is API Pagination? Cursor vs Offset Strategies
Related LoadFocus Tools
Put this concept into practice with LoadFocus, the same platform that powers everything you just read about.