DEV Community

Xing Wang
Xing Wang

Posted on • Originally published at moesif.com on

State of API Usage Report: interesting learnings from billions of API events.

Introduction to API analytics

One of the hardest things for any data driven engineer is to answer “Are these numbers any good?”We are drowning in data from various SaaS tools, but sometimes we just want to know what a normal range is.

For example, you can investigate the average latency for your API over time, but how do you benchmark against “standard”metrics for a API?

Welcome to the Summer 2018 - State of API Usage Report. We analyzed billions of API calls to guide you build the correct API and give you a benchmark to think about.

Languages used for developing APIs

API Developers by Programming Language

The below chart is the SDK or language used by Moesif customers.

chart of APIs by language

While NodeJS is still the undisputed king for building APIs driven by a rich ecosystemwith frameworks like express and Reach, what really surprised us was how popular Python got in 2018.More engineers are publishing Python APIs which can be fueled by the recent machine learning craze.Scikit-learn, PySpark, and TensorFlow are extremely popular ML frameworks that enable anyone to create a model fromthe Pickle or ProtoBuf file which can then be published via a simple REST API. In fact, we have published afew inference APIs using Python and Flask at Moesif.

API Calls by Content Type

We kept both the type and encoding to get a breakdown of who sets the encoding part. Majority of frameworks today willtry with UTF-8 if not set.

Chart of API calls by Content-Type

Is GraphQL popular?

While GraphQL has received a lot of press, we have seen a lot of developers hesitant to moving to GraphQL. At the same time, 2018 will be the year for GraphQL, and number of new open GraphQL APIs being published is accelerating.

chart of graphql popularity

API Performance

Is Keep Alive common?

Keep Alive is a common trick for servers calling other servers to keep the HTTP connection open for future calls.This reduces latency for subsequence calls such as an API server communicating with a database server.

While keep alive can be very beneficial in server to server, in applications where there are many clients, but each sends only a few or onlyone request, then the server would waste resources keeping connections open that are never reused.

API Calls by Connection

bar chart of API calls by connection

Average Latency for API calls

Keep in mind, some APIs are server-to-server calls on the same network or is designed for very low latency (such as our Collection API) which will have single digit latency in milliseconds.

a histogram of average API call latency

We see that 28% of API Calls complete within 500 ms. However, there is a long tail for latency. Potential pitfalls are not configuring timeouts (There are libraries out there that have 60 minute timeouts) or issues with database indexing.

Closing thoughts

Let us know if there is a specific metric you’re interested in. We’re always open to sharing more data as long as it OK.

Moesif is an API analytics platform uses by thousands of developers. Learn More

Top comments (0)