1. API DOCUMENTATION
    Always provide clear and concise documentation is necessary for any API, it becomes harder to use that API later without good documentation. So make sure that your API has good documentation using simple languages with updates and new releases.

  2. DON’T RETURN PLAIN TEXT
    It is not necessary to go above JSON in REST architecture, as most REST APIs use JSON as a data format. But there are times when returning a body that contains a JSON-formated string isn’t enough.

  3. AUTOMATE CACHING
    Repeated request and responding to those request consumes resources and this becomes a sign of flawed design. To solve this problem you must store data fetched from the API on the server and serve later from there.

  4. USE PLURAL RESOURCE NOUNS
    There is nothing wrong with singular resource nouns, but if you want to just keep things simple, then it is recommended to use plural resource nouns.

  5. HANDLE TRAILING SLASHES
    Using trailing slashes is a matter of choice, but make sure that you are sticking to that one choice with trailing slashes. As there are times when inconsistency will be there due to some minor mistakes.

  6. FILTERING AND PAGINATION
    Every database behind a REST API becomes larger with time and there are times when we have to control the flow of the data at once, otherwise, that can bring our systems down easily. This is why always allow filtering in your APIs.

Read more Best Practices For Rest API Design

#web #web-development #api #design

Best Practices for REST API Design
1.15 GEEK