Rapid Profile picture
Leading API hub for developers and enterprises. 40K+ APIs to unleash innovation. Join a community of 4M+ innovators today.

Jan 3, 2022, 8 tweets

REST APIs use Uniform Resource Identifiers (URI) to access resources.

Good URIs and well-named resources make your API feasible and intuitive.

Here are a few tips that can help you. 🧵

1️⃣ Use of nouns in URIs

REST APIs are used to get and manipulate resources that are information (nouns), not actions (verbs).

In simple terms, REST URIs should not indicate CRUD (Create, Read, Update, Delete) functionality.

For example 👇🏻

2️⃣ Use forward-slash (/)

Use forward-slash (/) special character to indicate the hierarchy relationship between resources.

This will increase the readability of URIs and hence increase the adoption of API.

3️⃣ Use hyphens (-) instead of underscores ( _ )

There is nothing wrong with using underscores, but hyphens reduce chaos as underscores are sometimes not readable due to fonts or browsers.

4️⃣ Don't use file extensions

File extensions don't serve any additional features. They simply increase the length of URI and hence decrease the readability of endpoints.

You can use the `Content-Type` header to indicate the media type of a particular file, if necessary.

5️⃣ Use query parameters

Do not create a separate endpoint for a specific resource. Instead, enable sorting based on certain attributes.

For example 👇🏻

With that being said, these are five tips that can help you increase your API's adoption.

Don't forget to publish your API on RapidAPI Hub (RapidAPI.com/hub?utm_source…) and make it accessible to over 3 million developers.

Share this Scrolly Tale with your friends.

A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.

Keep scrolling