A reader recently wrote into ProgrammableWeb asking if we had any recent data on API support of JSON versus XML. We didn’t have the data offhand but a quick query into our API directory could surely provide insight into this question. Additionally, the data may be able to give us some clues into how frequently APIs of different styles are being developed.
To start with, we took a look at the most common request and response formats across all APIs since the start of ProgrammableWeb in 2005. The table below summarizes the data.
|URI Query String/ CRUD||JSON|
|CSV||URI Query String/CRUD|
The clearest finding is the dominance of REST styled APIs. URI Query String/CRUD as a request format refers to an APIs ability to leverage the HTTP protocol in order to take action on an API Resource. This is most commonly seen on REST-styled APIs and thus the use of URI Query String/CRUD in the request signals the use of RESTful architecture. With 18,985 web APIs using this request format, it is safe to say that REST is used by nearly 83% of the APIs in the directory. This is not a surprise by any means, but it is a stark reminder of just how prevalent REST has become over the last decade-plus.
While we are discussing URI Query String/CRUD, you may notice that it appears more than 200 times as a response data format. The great majority of these are due to event-driven APIs that use Webhooks. In a Webhooks API the client request indicates what Webhooks-based stream it wants to subscribe to. The stream is implemented through an approach where the client provisions an HTTP-based API that the server calls. When the server has an update it makes a RESTful call to the client. That’s why the response from the server would include URI Query String as a data format. For more information, please read our article on how Webhooks APIs work.
While the all-time data are helpful for understanding APIs in the big picture, it may be useful to consider where APIs are trending in recent years. We queried our database from March 2018 through March 2020 to see what modern APIs can tell us about the direction things are heading and here’s what we found.
(Since March 2018)
(Since March 2018)
|URI Query String/CRUD||JSON|
|XML||URI Query String/CRUD|
Returning to the question of JSON versus XML, we see that in the last two years JSON has been used as a response data format five-fold as many times as XML. XML is by far the number two response format used by API providers, but it is clear that JSON has been the unquestioned format of choice.
The REST architectural style and JSON data format are the staples of the API space. However, they are not the only approaches when building an API. Event-driven API architectures have been steadily growing in popularity in the last few years due to the desire for applications that perform in real-time. Two of the most popular event-driven protocols are Webhooks and WebSockets; combined they have been used in nearly 200 APIs in the last two years.
GraphQL is an RPC styled approach to APIs that has been much discussed since its arrival in 2015. While a number of overzealous commenters were quick to declare that GraphQL would replace REST, it is more properly thought of as an alternative that works extremely well in specific use cases. It has been used in 53 APIs in the last two years which is a good showing but clearly pales in comparison to the more than 3,000 new RESTful APIs to appear during the same time.
Speaking of old guard approaches, SOAP, the long-time punching bag of API development still managed to appear in 68 new APIs. One nuance here is that SOAP-based implementations invariably involve the XML data format. However, not all XML-based APIs involve SOAP. Plenty of REST-styled APIs support XML as a data format.
One final note is that Unspecified shows up as the third most frequent data format on both requests and responses. Our directory data model uses Unspecified as shorthand for when an API provider doesn’t provide this information. This may be due to poor Documentation or as is often the case, the documentation is hidden behind a registration wall that prevents us from researching those details. This is one of the most common examples of poor Developer Experience ( DX). To learn more about API providers who get this right, be sure to read our Editor’s Choice award for DX series of articles.
What do you think, is there anything we missed? The API space is constantly changing and our data helps us make sense of it and highlight trends.
If you’re an API provider, adding a listing in our directory is a great way to improve the discoverability of your APIs and raise awareness of your program. If you would like to include your APIs in our directory, you can use the link below. https://www.programmableweb.com/add/api
If you are looking for a chart that we don't currently have, please write to firstname.lastname@example.org. It's possible that the chart you need is in the process of getting published.