DEV Community

Cover image for How Much Bandwidth Do You Need for an API in 2025?
reynaldi
reynaldi

Posted on • Originally published at corsfix.com

How Much Bandwidth Do You Need for an API in 2025?

When talking about bandwidth or data transfer in the context of the web, most people think of bandwidth used by the actual webpages that you host. Thanks to a report by HTTP Archive, we know that webpages in 2025 weigh around 2.5 MB.

Page Weight
Page Weight (source: HTTP Archive)

This page weight includes everything that gets downloaded to render a page, like HTML, CSS, JS, fonts, images, and other assets.

However, this does not tell the story about bandwidth used for APIs.

Websites Are Heavy

It's tempting to assume that HTML, CSS, and JS are tiny since they are just text. However, HTML itself is bloated since you need to use markup tags, not including the attributes and more inline data.

Add to that:

  • CSS frameworks that load hundreds of KB
  • JavaScript bundles
  • Images, assets, fonts
  • Tracking scripts, analytics, etc.

So it's not a surprise that when talking about websites, they are in the MB range.

APIs Are a Different Story

There's no equivalent report for APIs similar to HTTP Archive for webpages. However, we can make some educated estimates.

APIs typically send structured data, mostly in JSON format, without extra markup, styles, or images. To put this into perspective, here is a 128 KB dummy JSON data.

128 KB JSON
128 KB JSON

It contains over 700+ objects, each with multiple fields. In most scenarios, an API response in this size range (100KB) is already considered large.

Estimate: APIs Are 20x Lighter Than Webpages

If we compare:

Type Size Content
Webpage ~2.5MB HTML, CSS, JS, images, assets
API ~100 KB Mostly text JSON data

That's a 20x difference. If a webpage consumes that amount of bandwidth, an API request would likely be 5% of that.

What This Means for Bandwidth Planning

For a website with heavy assets, total data transfer can easily reach hundreds of gigabytes or even terabytes per month at scale. This is why you see website hosting providers offer a lot of bandwidth compared to API services.

APIs, however, are much lighter. So your data transfer costs and bandwidth needs for APIs are often much lower than for a full website, even with the same number of requests.

Conclusion

APIs are significantly lighter compared to webpages. They can be up to 20x lighter than websites, even with the same number of requests. When planning for bandwidth needs or data transfer usage with APIs, you can expect to use much less data compared to your web hosting requirements.

Top comments (3)

Collapse
 
natasha_sturrock_07dac06b profile image
Eminence Technology

This really highlights how much lighter APIs are compared to full webpages, mostly because they skip bulky assets like images and styles. Besides bandwidth savings, smaller API responses reduce latency and processing time on both client and server, improving user experience and scalability. So, optimizing JSON payloads benefits not just costs but overall app performance too.

Collapse
 
anik_sikder_313 profile image
Anik Sikder

Great breakdown! The 20x difference between webpage and API bandwidth really puts things in perspective. It’s a useful reminder for developers to optimize API payloads since even small savings per request can add up significantly at scale. Curious how compression strategies like gzip or Brotli factor into these numbers in real-world scenarios. Thanks for sharing!

Collapse
 
reynaldi profile image
reynaldi

Thanks for the comment, Anik.
I would imagine if we factor in compression, the size difference will be more noticable!