# Measuring "RESTfulness" with Richardson Maturity Model

When it comes to determining whether an API is RESTful or not, it's not an all or nothing matter. We can measure the "RESTfulness" using an already existing model or framework.

In 2008, Leonard Richardson proposed a system that was able to classify the maturity of a web service. This model is called the **Richardson Maturity Model** (**RMM**).

Leonard’s model describes three levels of service maturity based on a service’s support for URIs, HTTP verbs, and hypermedia. The model suggests that the higher the level of the service, the closer it is to being truly RESTful as each level inherits the one below it.

![https://martinfowler.com/articles/richardsonMaturityModel.html](/files/iWxsVTJZuYXwp8GdI0sB)

## Level Zero Services: Plain Old XML

Level zero, also known as Plain Old XML (POX) is the most basic level of maturity. It states that the service will only have a single URI and that only a single HTTP method (usually POST) is used.

For example.

`POST https://www.website.com/api/users` will be used for both creating a user and retrieving a list of users.

This seems quite primitive don't you agree? Luckily, most modern web APIs I've seen are not at level zero.

A note here, the service does not have to be in XML, Plain old XML is just the name because JSON was not as popular in the 2000's as opposed to today.

## Level One Services: URIs

The next level of service maturity states that many URIs are used as opposed to just one, but with only a single HTTP verb is still being used.

For example.

`POST https://www.website.com/api/users` will still be used for both creating a user and retrieving a list of users.

But we will have other URIs that map to other resources such as this.

`POST https://www.website.com/api/users/1` will be used for retrieving a single user with the ID of 1.

## Level Two Services: HTTP verbs

Now we are on to level two services, this is where most people are at. This is where multiple URIs are used to address different types of resources. Also, multiple different HTTP verbs (GET, POST, PUT, DELETE) are used on those exposed resource.

For example.

`GET https://www.website.com/api/users` will be used for retrieving a list of users.

`GET https://www.website.com/api/users/1` will be used for retrieving a single user with the ID of 1.

`POST https://www.website.com/api/users` will be used for creating a user .

## Level Three Services: Hypermedia

Now we have arrived at the final level, the level 3 service, where the web service contains hypermedia. If a service reaches this level, it has achieved all the other levels prior and has all inner resources being linked to one another in a coherent manner. At this level, the web service is considered "truly RESTFul".

We have already discussed this topic, so have a look and [revisit the previous section to learn more about what hypermedia is](https://yichenzhu1337.gitbook.io/restful-node/part-2/chapter-2/2_0_5_what_does_restful_mean).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://book.restfulnode.com/part-2/chapter-2/6-measuring-restfulness-with-richardson-maturity-model.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
